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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fbb0fff0ef23cb8e4fbde7fc36e985894379ee7a | 195 | py | Python | examples/hello.py | dmtrs/depends | dac3b9d315aeb3e7b73e4a9b594a0d77e1d8ace8 | [
"MIT"
] | 2 | 2021-07-31T19:46:42.000Z | 2021-12-21T09:24:47.000Z | examples/hello.py | dmtrs/dependable | dac3b9d315aeb3e7b73e4a9b594a0d77e1d8ace8 | [
"MIT"
] | 4 | 2021-03-29T21:14:13.000Z | 2021-04-03T20:25:17.000Z | examples/hello.py | dmtrs/depends | dac3b9d315aeb3e7b73e4a9b594a0d77e1d8ace8 | [
"MIT"
] | 1 | 2021-07-31T19:46:46.000Z | 2021-07-31T19:46:46.000Z | import asyncio
from random import random
from dependable import Depends, dependant
@dependant
async def main(*, choice: int = Depends(random)) -> None:
print(choice)
asyncio.run(main())
| 15 | 57 | 0.733333 |
510a70f30cefeb2ec340ce489d370ebc75221f63 | 8,589 | py | Python | script/hassfest/requirements.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | script/hassfest/requirements.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | script/hassfest/requirements.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Validate requirements."""
from __future__ import annotations
from collections import deque
import json
import os
import re
import subprocess
import sys
from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
from stdlib_list import stdlib_list
from tqdm import tqdm
from homeassistant.const import REQUIR... | 29.016892 | 94 | 0.613808 |
3cf14a39b512308bee0b8670a434cac89e7e7651 | 15,506 | py | Python | google/cloud/firestore_v1/async_client.py | noxxious/python-firestore | 6b5a7795bb2827b65f8015fcef6663880a29a65d | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_v1/async_client.py | noxxious/python-firestore | 6b5a7795bb2827b65f8015fcef6663880a29a65d | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_v1/async_client.py | noxxious/python-firestore | 6b5a7795bb2827b65f8015fcef6663880a29a65d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC 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... | 37.635922 | 107 | 0.644912 |
e8e52cb365163697b90c9b6fcbbc85954e670ae9 | 546 | py | Python | Chapter_1_Introduction/Adhoc_Problems/kattis_friday.py | BrandonTang89/CP4_Code | 5114471f439978dd11f6f2cbf6af20ca654593da | [
"MIT"
] | 2 | 2021-12-29T04:12:59.000Z | 2022-03-30T09:32:19.000Z | Chapter_1_Introduction/Adhoc_Problems/kattis_friday.py | BrandonTang89/CP4_Code | 5114471f439978dd11f6f2cbf6af20ca654593da | [
"MIT"
] | null | null | null | Chapter_1_Introduction/Adhoc_Problems/kattis_friday.py | BrandonTang89/CP4_Code | 5114471f439978dd11f6f2cbf6af20ca654593da | [
"MIT"
] | 1 | 2022-03-01T06:12:46.000Z | 2022-03-01T06:12:46.000Z | '''
Kattis - friday
Do some modular arithmetic to determine whether friday falls on the 13th of a particular month,
it depends on the first day of the month. Also note that some months have less than 13 days.
Time: O(m), Space: O(m)
'''
num_tc = int(input())
for tc in range(num_tc):
D, m = map(int, input().split()... | 24.818182 | 95 | 0.56044 |
1548ac917129ea75938199fe4d2b1d1013ef153e | 300 | py | Python | setup.py | bateman-research/search-sifter | 78b05beac5ca21862d2773609dc4b9395a4982a5 | [
"MIT"
] | 1 | 2020-07-20T13:20:00.000Z | 2020-07-20T13:20:00.000Z | setup.py | bateman-research/search-sifter | 78b05beac5ca21862d2773609dc4b9395a4982a5 | [
"MIT"
] | null | null | null | setup.py | bateman-research/search-sifter | 78b05beac5ca21862d2773609dc4b9395a4982a5 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import versioneer
setup(name='SearchSifter',
packages=find_packages(),
include_package_data=True,
install_requires=[
"pymysql",
],
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
)
| 23.076923 | 43 | 0.67 |
12a8f8471f61c0280e0c7e4f1865fd601c74da0b | 203 | py | Python | jp.atcoder/abc130/abc130_c/11992853.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc130/abc130_c/11992853.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc130/abc130_c/11992853.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
w, h, x, y = map(int, sys.stdin.readline().split())
def main():
s = w * h / 2
t = x * 2 == w and y * 2 == h; t *= 1
print(s, t)
if __name__ == '__main__':
main()
| 16.916667 | 52 | 0.453202 |
1572a6ab2485cd76079b2953a8aad1bf1989e391 | 1,083 | py | Python | main/migrations/versions/041fc2d56de5_.py | FedTheBug/pReview | ea4dd814ebb9ef5fa1e2ae13038b52b5edd99bec | [
"MIT"
] | 5 | 2021-04-17T11:19:38.000Z | 2021-04-19T15:19:38.000Z | main/migrations/versions/041fc2d56de5_.py | FedTheBug/pReview | ea4dd814ebb9ef5fa1e2ae13038b52b5edd99bec | [
"MIT"
] | null | null | null | main/migrations/versions/041fc2d56de5_.py | FedTheBug/pReview | ea4dd814ebb9ef5fa1e2ae13038b52b5edd99bec | [
"MIT"
] | null | null | null | """empty message
Revision ID: 041fc2d56de5
Revises:
Create Date: 2021-04-17 10:17:53.407508
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '041fc2d56de5'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 26.414634 | 71 | 0.674977 |
04226110dffca459e2fc9952c6abbd7c5fb1d9c7 | 10,144 | py | Python | example/image-classification/symbols/resnet_fp16.py | padentomasello/mxnet | f5e11c403873ad2b7d9d230e405ec8c3d614271a | [
"Apache-2.0"
] | 1 | 2021-12-01T07:32:58.000Z | 2021-12-01T07:32:58.000Z | example/image-classification/symbols/resnet_fp16.py | padentomasello/mxnet | f5e11c403873ad2b7d9d230e405ec8c3d614271a | [
"Apache-2.0"
] | null | null | null | example/image-classification/symbols/resnet_fp16.py | padentomasello/mxnet | f5e11c403873ad2b7d9d230e405ec8c3d614271a | [
"Apache-2.0"
] | 3 | 2019-07-17T08:02:45.000Z | 2021-05-17T09:14:38.000Z | '''
Adapted from https://github.com/tornadomeet/ResNet/blob/master/symbol_resnet.py
Original author Wei Wu
Implemented the following paper:
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. "Identity Mappings in Deep Residual Networks"
'''
import mxnet as mx
import numpy as np
def residual_unit(data, num_filter, st... | 52.833333 | 136 | 0.613565 |
ecb0f50ad3fe3835bd3bac89fc234ae581fbb859 | 730 | py | Python | source/loss/MarginLoss.py | celsofranssa/E2ECodeSearch | 8f11029fbcca968885658a7e152e7edd8200b6fe | [
"MIT"
] | null | null | null | source/loss/MarginLoss.py | celsofranssa/E2ECodeSearch | 8f11029fbcca968885658a7e152e7edd8200b6fe | [
"MIT"
] | null | null | null | source/loss/MarginLoss.py | celsofranssa/E2ECodeSearch | 8f11029fbcca968885658a7e152e7edd8200b6fe | [
"MIT"
] | null | null | null | import torch
from torch import nn
class MarginLoss(nn.Module):
def __init__(self, name):
super(MarginLoss, self).__init__()
self.mse = nn.MSELoss()
def cos_sim(self, r1, r2):
"""
Computes the cosine similarity cos_sim(a[i], b[j]) for all i and j.
:return: Matrix with... | 26.071429 | 75 | 0.594521 |
48106bff2893c8207f558ef145a625d6837e363c | 6,704 | py | Python | xarray/core/nanops.py | st-bender/xarray | a6b44d72010c5311fad4f60194b527194e26094b | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-05-09T20:55:23.000Z | 2021-05-09T20:55:23.000Z | xarray/core/nanops.py | st-bender/xarray | a6b44d72010c5311fad4f60194b527194e26094b | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | 15 | 2020-07-15T14:20:59.000Z | 2022-02-14T04:05:13.000Z | xarray/core/nanops.py | st-bender/xarray | a6b44d72010c5311fad4f60194b527194e26094b | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-03-08T11:31:54.000Z | 2022-03-08T11:31:54.000Z | import warnings
import numpy as np
from . import dtypes, nputils, utils
from .duck_array_ops import (
_dask_or_eager_func,
count,
fillna,
isnull,
where,
where_method,
)
from .pycompat import dask_array_type
try:
import dask.array as dask_array
from . import dask_array_compat
except I... | 33.024631 | 87 | 0.681384 |
dd39ec54d637c687b50202b61abd718f021169a4 | 1,056 | py | Python | OmniMarkupLib/Renderers/libs/python3/textile/tools/imagesize.py | henumohe/OmniMarkupPreviewer | a15382a8309fe04f2c515151c00c074ab9c0d1ab | [
"MIT"
] | 476 | 2015-01-07T08:59:53.000Z | 2022-02-11T09:46:06.000Z | OmniMarkupLib/Renderers/libs/python3/textile/tools/imagesize.py | henumohe/OmniMarkupPreviewer | a15382a8309fe04f2c515151c00c074ab9c0d1ab | [
"MIT"
] | 82 | 2015-01-15T12:30:43.000Z | 2022-01-06T02:56:53.000Z | OmniMarkupLib/Renderers/libs/python3/textile/tools/imagesize.py | henumohe/OmniMarkupPreviewer | a15382a8309fe04f2c515151c00c074ab9c0d1ab | [
"MIT"
] | 99 | 2015-01-14T19:53:45.000Z | 2021-08-11T15:17:26.000Z | def getimagesize(url):
"""
Attempts to determine an image's width and height, and returns a string
suitable for use in an <img> tag, or an empty string in case of failure.
Requires that PIL is installed.
>>> getimagesize("http://www.google.com/intl/en_ALL/images/logo.gif")
... #doctest: +ELLIPS... | 25.142857 | 76 | 0.569129 |
c4997d9385dc9732383465c4e62f68c4cb3673aa | 1,859 | py | Python | cfg.py | KasaiKonoru/Glitch | c298c3bc50003da7a7f110a0da4d884a214385d3 | [
"MIT"
] | null | null | null | cfg.py | KasaiKonoru/Glitch | c298c3bc50003da7a7f110a0da4d884a214385d3 | [
"MIT"
] | null | null | null | cfg.py | KasaiKonoru/Glitch | c298c3bc50003da7a7f110a0da4d884a214385d3 | [
"MIT"
] | null | null | null | import os
from utils import get_config
from time import time
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
SCRIPT_DIR = SCRIPT_DIR + ('/' if not SCRIPT_DIR.endswith('/') else '')
SAPPHIRE_ID = None
TIER_ICONS = {
'sapphire': ':gem:',
'diamond': ':diamond_shape_with_a_dot_inside:',
}
# Store s... | 24.786667 | 109 | 0.726735 |
1eaed48f25e70b5d2816786a7527ee3bf4117a2c | 8,244 | py | Python | superset/examples/tabbed_dashboard.py | razzius/superset | 93f59e055e8312fb28687bc9fc22342b4be68d0e | [
"Apache-2.0"
] | 18,621 | 2017-06-19T09:57:44.000Z | 2021-01-05T06:28:21.000Z | superset/examples/tabbed_dashboard.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 9,043 | 2017-07-05T16:10:48.000Z | 2021-01-05T17:58:01.000Z | superset/examples/tabbed_dashboard.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 5,527 | 2017-07-06T01:39:43.000Z | 2021-01-05T06:01:11.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 not u... | 24.034985 | 70 | 0.463367 |
9238b8a432a543509d3043510181f63896b52359 | 584 | py | Python | Chapter15/chapter15_1_xml.py | Jolium/Mastering-Python-Networking-Third-Edition | f8086fc9a28e441cf8c31099d16839c2e868c7fc | [
"MIT"
] | 79 | 2019-09-19T08:40:19.000Z | 2022-03-01T06:33:48.000Z | Chapter15/chapter15_1_xml.py | muzhang90/Mastering-Python-Networking-Third-Edition | f8086fc9a28e441cf8c31099d16839c2e868c7fc | [
"MIT"
] | 3 | 2020-03-29T14:14:43.000Z | 2020-10-29T18:21:09.000Z | Chapter15/chapter15_1_xml.py | muzhang90/Mastering-Python-Networking-Third-Edition | f8086fc9a28e441cf8c31099d16839c2e868c7fc | [
"MIT"
] | 65 | 2019-09-30T04:31:08.000Z | 2022-01-27T15:28:48.000Z | #!/usr/env/bin python3
import xml.etree.ElementTree as ET
import pprint
with open('chapter15_topology.virl', 'rt') as f:
tree = ET.parse(f)
devices = {}
for node in tree.findall('./{http://www.cisco.com/VIRL}node'):
name = node.attrib.get('name')
devices[name] = {}
for attr_name, attr_value in sort... | 22.461538 | 62 | 0.638699 |
b4b4ef7fec309398b4063071d49a2454dd838e1d | 2,026 | py | Python | drf_demo/model_less/serializers.py | Thiyageshv/PizzaReminder | ebb10055249721474ea98c9ff2b94976bb8a1cd0 | [
"BSD-3-Clause"
] | null | null | null | drf_demo/model_less/serializers.py | Thiyageshv/PizzaReminder | ebb10055249721474ea98c9ff2b94976bb8a1cd0 | [
"BSD-3-Clause"
] | null | null | null | drf_demo/model_less/serializers.py | Thiyageshv/PizzaReminder | ebb10055249721474ea98c9ff2b94976bb8a1cd0 | [
"BSD-3-Clause"
] | null | null | null | from rest_framework import serializers
from . import yelp
from .models import userloc, groupusers
class groupserializer(serializers.Serializer):
groupid = serializers.CharField(max_length=200)
users = serializers.CharField(max_length=200)
def create(self, validated_data):
return groupusers.objects.creat... | 35.54386 | 81 | 0.72458 |
a7ffa1e897c44b565ec086c3bff976121bcab101 | 1,541 | py | Python | pcat2py/class/2190f852-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/2190f852-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/2190f852-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
# 2190f852-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... | 40.552632 | 172 | 0.626866 |
a6b5ff99ff662194b778db8113bd97359fd54feb | 83 | py | Python | Birnn_Transformer/ncc/tasks/type_prediction/__init__.py | code-backdoor/code-backdoor | 1eeb3d79aa8a54c8f08e8d0156b569de5edd974e | [
"MIT"
] | 1 | 2021-12-21T05:52:37.000Z | 2021-12-21T05:52:37.000Z | ncc/tasks/type_prediction/__init__.py | hrshy0629/naturalcc | 9c3329dd8387c8242deb52bf590ebe3ac795f8de | [
"MIT"
] | null | null | null | ncc/tasks/type_prediction/__init__.py | hrshy0629/naturalcc | 9c3329dd8387c8242deb52bf590ebe3ac795f8de | [
"MIT"
] | null | null | null | from .type_prediction import TypePredictionTask
# from .typilus import TypilusTask
| 27.666667 | 47 | 0.855422 |
4d9edfc35b8e125bcb001d25e01f1a5c35c4ea68 | 5,096 | py | Python | iris/api/authentication.py | dioptra-io/iris | 1a7dfb8210fdc0f0554b61b81cbfdba7872f9d39 | [
"MIT"
] | 6 | 2022-01-13T16:09:57.000Z | 2022-03-26T08:39:47.000Z | iris/api/authentication.py | dioptra-io/iris | 1a7dfb8210fdc0f0554b61b81cbfdba7872f9d39 | [
"MIT"
] | 16 | 2022-02-01T06:09:13.000Z | 2022-03-01T06:12:30.000Z | iris/api/authentication.py | dioptra-io/iris | 1a7dfb8210fdc0f0554b61b81cbfdba7872f9d39 | [
"MIT"
] | null | null | null | """Security management."""
import uuid
from fastapi import Depends, HTTPException, Request, status
from fastapi_users import BaseUserManager, FastAPIUsers, UUIDIDMixin
from fastapi_users.authentication import (
AuthenticationBackend,
BearerTransport,
CookieTransport,
JWTStrategy,
)
from fastapi_users.a... | 31.45679 | 87 | 0.723901 |
851848719488d5563c8003df3ba94d99ddfbbd12 | 2,435 | py | Python | trac/tests/contentgen.py | clubturbo/Trac-1.4.2 | 254ce54a3c2fb86b4f31810ddeabbd4ff8b54a78 | [
"BSD-3-Clause"
] | null | null | null | trac/tests/contentgen.py | clubturbo/Trac-1.4.2 | 254ce54a3c2fb86b4f31810ddeabbd4ff8b54a78 | [
"BSD-3-Clause"
] | null | null | null | trac/tests/contentgen.py | clubturbo/Trac-1.4.2 | 254ce54a3c2fb86b4f31810ddeabbd4ff8b54a78 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This soft... | 30.061728 | 78 | 0.619713 |
aaab369f77302718bc1f3a7493b06341462b4378 | 770 | py | Python | force_gromacs/chemicals/i_fragment.py | force-h2020/force-bdss-plugin-gromacs | 1518185e4cdab824d57570bc5df6c719f1f11bea | [
"MIT"
] | null | null | null | force_gromacs/chemicals/i_fragment.py | force-h2020/force-bdss-plugin-gromacs | 1518185e4cdab824d57570bc5df6c719f1f11bea | [
"MIT"
] | 28 | 2019-09-05T09:05:52.000Z | 2020-11-11T13:32:46.000Z | force_gromacs/chemicals/i_fragment.py | force-h2020/force-bdss-plugin-gromacs | 1518185e4cdab824d57570bc5df6c719f1f11bea | [
"MIT"
] | 1 | 2020-01-15T20:53:17.000Z | 2020-01-15T20:53:17.000Z | # (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
from traits.api import Int
from .i_particle_group import IParticleGroup
class IFragment(IParticleGroup):
"""Contains all input values for each molecular fragment. A
fragment is defined as a part of a molecule that may become
... | 33.478261 | 65 | 0.745455 |
c87c39ae0ba89287a9d15301edb63c972bdd5dc0 | 2,610 | py | Python | install_scripts/param.py | reedloden/replicated-installer | e7747d5eb9d3735952af68e45298e8ce5fd6a90b | [
"MIT"
] | null | null | null | install_scripts/param.py | reedloden/replicated-installer | e7747d5eb9d3735952af68e45298e8ce5fd6a90b | [
"MIT"
] | null | null | null | install_scripts/param.py | reedloden/replicated-installer | e7747d5eb9d3735952af68e45298e8ce5fd6a90b | [
"MIT"
] | null | null | null | from __future__ import print_function
import boto3
import os
import sys
param_cache = None
param_lookup = {
'ENVIRONMENT': '/replicated/environment',
'GRAPHQL_PREM_ENDPOINT': '/graphql/prem_endpoint',
'MIN_DOCKER_VERSION': '/install_scripts/min_docker_version',
'MYSQL_DATABASE': '/mysql/database',
... | 26.363636 | 78 | 0.648659 |
acf5939c08559ad5a4a36d611fa0635c924ab20f | 1,360 | py | Python | tests/test_getPackageDir.py | ktlim/utils | 3afcb0f245807a502f1e73dac4782a1b239bb3e0 | [
"BSD-3-Clause"
] | null | null | null | tests/test_getPackageDir.py | ktlim/utils | 3afcb0f245807a502f1e73dac4782a1b239bb3e0 | [
"BSD-3-Clause"
] | 1 | 2021-09-15T15:13:34.000Z | 2021-09-15T15:13:34.000Z | tests/test_getPackageDir.py | ktlim/utils | 3afcb0f245807a502f1e73dac4782a1b239bb3e0 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of utils.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a... | 29.565217 | 98 | 0.730147 |
8379c5d5505a8c42b094ecebd442855c5db505de | 1,071 | py | Python | TimeSpentInCollab.py | blackboard/BBDN-BlackboardData-Python | fd83b09356a3f9dc30770e2277372c411c0873a0 | [
"BSD-3-Clause"
] | 8 | 2020-02-19T20:21:24.000Z | 2022-01-12T17:48:24.000Z | TimeSpentInCollab.py | elmiguel/BBDN-BlackboardData-Python | 360f63912cee79e2c3079481b6e323f020df28af | [
"BSD-3-Clause"
] | 3 | 2020-02-21T14:33:07.000Z | 2020-02-21T16:27:06.000Z | TimeSpentInCollab.py | blackboard/BBDN-BlackboardData-Python | fd83b09356a3f9dc30770e2277372c411c0873a0 | [
"BSD-3-Clause"
] | 4 | 2020-02-20T16:34:22.000Z | 2021-03-08T16:11:31.000Z | #!/usr/bin/env python
import snowflake.connector
import pandas as pd
import Config as cfg
query = """
select
count(distinct room_id) as room_count,
count(id) as session_count,
session_count / room_count as avg_sessions_per_room,
sum(attended_duration/60) as session_minutes_sum
from cdm_clb.session
where attend... | 25.5 | 98 | 0.721755 |
e05d7dda2a8ff863d861f9ae6575829b1046224c | 12,574 | py | Python | misc/all_utils.py | anshulpaigwar/GndNet | 24328602a8cbaeabe67cafbf1b96c35f5c5c9023 | [
"MIT"
] | 73 | 2020-09-02T09:28:38.000Z | 2022-03-28T05:50:44.000Z | misc/all_utils.py | jasonlee020/GndNet | 323af65c9c16a725805f480ff799936b77b04d53 | [
"MIT"
] | 6 | 2020-11-04T13:43:04.000Z | 2022-02-07T21:22:29.000Z | misc/all_utils.py | jasonlee020/GndNet | 323af65c9c16a725805f480ff799936b77b04d53 | [
"MIT"
] | 14 | 2020-10-28T06:59:23.000Z | 2022-03-24T09:14:13.000Z |
"""
Author: Anshul Paigwar
email: p.anshul6@gmail.com
"""
from __future__ import print_function
from __future__ import division
import argparse
import os
import sys
sys.path.append("..") # Adds higher directory to python modules path.
import shutil
import time
import yaml
import torch
from torchvision import data... | 30.371981 | 163 | 0.590425 |
fd568af1078a1984cd9c28237665495d5b2230e3 | 7,653 | py | Python | examples/run_glue.py | malteos/transformers | cafa6a9e29f3e99c67a1028f8ca779d439bc0689 | [
"Apache-2.0"
] | null | null | null | examples/run_glue.py | malteos/transformers | cafa6a9e29f3e99c67a1028f8ca779d439bc0689 | [
"Apache-2.0"
] | null | null | null | examples/run_glue.py | malteos/transformers | cafa6a9e29f3e99c67a1028f8ca779d439bc0689 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 36.099057 | 133 | 0.683523 |
c7e6ddd8694bcc0eb66e90a8b09ffc77fd857b28 | 2,046 | py | Python | setup.py | rsalmaso/pyzotero3 | a2408e2c160faac5e4818ec99cf0392311c36944 | [
"MIT"
] | null | null | null | setup.py | rsalmaso/pyzotero3 | a2408e2c160faac5e4818ec99cf0392311c36944 | [
"MIT"
] | null | null | null | setup.py | rsalmaso/pyzotero3 | a2408e2c160faac5e4818ec99cf0392311c36944 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
setup.py
Created by Stephan Hügel on 2011-03-04
"""
import os
import re
import io
from setuptools import setup, find_packages
def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8"),
) as fp:
... | 28.816901 | 88 | 0.63392 |
c47a12ed6a090dbd70e776c3f2ac420487038d43 | 969 | py | Python | msgvis/apps/questions/migrations/0005_auto_20150302_2308.py | hds-lab/textvis-drg | bfb136b6105df84fb6c1c89cc595bf9e9f22c5fe | [
"MIT"
] | 10 | 2015-12-04T07:43:11.000Z | 2021-01-23T00:44:56.000Z | msgvis/apps/questions/migrations/0005_auto_20150302_2308.py | hds-lab/textvis-drg | bfb136b6105df84fb6c1c89cc595bf9e9f22c5fe | [
"MIT"
] | 200 | 2015-02-11T05:41:57.000Z | 2015-11-13T03:47:25.000Z | msgvis/apps/questions/migrations/0005_auto_20150302_2308.py | hds-lab/textvis-drg | bfb136b6105df84fb6c1c89cc595bf9e9f22c5fe | [
"MIT"
] | 6 | 2015-10-02T18:01:09.000Z | 2021-01-23T00:44:58.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('dimensions', '0005_auto_20150227_2303'),
('questions', '0004_question_dimensions'),
]
operations = [
migrations.Crea... | 29.363636 | 114 | 0.556244 |
5732910593b6f30fa19738e5393c27d633ec5f73 | 20,122 | py | Python | lib/drivers/ili9XXX.py | lixas/SmartHome-Central | 12550f994a57e820ba23af4664ebfd660797296d | [
"MIT"
] | null | null | null | lib/drivers/ili9XXX.py | lixas/SmartHome-Central | 12550f994a57e820ba23af4664ebfd660797296d | [
"MIT"
] | null | null | null | lib/drivers/ili9XXX.py | lixas/SmartHome-Central | 12550f994a57e820ba23af4664ebfd660797296d | [
"MIT"
] | null | null | null | enable_lvesp32 = True
##############################################################################
# Pure/Hybrid micropython lvgl display driver for ili9341 and ili9488 on ESP32
#
# For ili9341 display:
#
# Build micropython with
# LV_CFLAGS="-DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=1"
# (make parameter) to con... | 38.182163 | 156 | 0.601928 |
65c625b5732bc4e290300a6459014d5ab0809f7d | 8,025 | py | Python | userbot/plugins/memes2.py | Munnipopz/CatUserbot | b0e54241aad6b4778b99807c4f78c922ef7befa0 | [
"MIT"
] | 1 | 2020-07-18T07:42:58.000Z | 2020-07-18T07:42:58.000Z | userbot/plugins/memes2.py | praveen368/CatUserbot | 4b0cd970551ffaf86b9fdd5da584c1b3882821ff | [
"MIT"
] | null | null | null | userbot/plugins/memes2.py | praveen368/CatUserbot | 4b0cd970551ffaf86b9fdd5da584c1b3882821ff | [
"MIT"
] | null | null | null | #Added by @Sur_vivor
import asyncio
import random
import re
import time
from random import choice, randint
from collections import deque
from telethon import events
import requests
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName
from userbot.utils import... | 26.75 | 92 | 0.330841 |
4ec21dbdf817130e1465e0531a975633d4b59b85 | 84 | py | Python | multi_tools/c/_c_types/__init__.py | Jerem2360/multitools | cd2c5aee72e5c2c8b60bbedd458303051b104c29 | [
"Unlicense"
] | null | null | null | multi_tools/c/_c_types/__init__.py | Jerem2360/multitools | cd2c5aee72e5c2c8b60bbedd458303051b104c29 | [
"Unlicense"
] | null | null | null | multi_tools/c/_c_types/__init__.py | Jerem2360/multitools | cd2c5aee72e5c2c8b60bbedd458303051b104c29 | [
"Unlicense"
] | null | null | null | from ._base_types import *
from ._const import *
from . import _win
win32 = _win
| 10.5 | 26 | 0.714286 |
f0c07200565d51b396a86a54b90dd80e6baa2311 | 846 | py | Python | manage.py | EmmanuelMuchiri/JamboPay | a4912cd81c35faa91791de44eda4fd92b75d4581 | [
"MIT"
] | null | null | null | manage.py | EmmanuelMuchiri/JamboPay | a4912cd81c35faa91791de44eda4fd92b75d4581 | [
"MIT"
] | null | null | null | manage.py | EmmanuelMuchiri/JamboPay | a4912cd81c35faa91791de44eda4fd92b75d4581 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import dotenv
if __name__ == "__main__":
dotenv.read_dotenv()
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Jambopay.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fai... | 32.538462 | 77 | 0.646572 |
344cea2ad107503be634ed156cc78562a0da51ea | 381 | py | Python | app/email.py | kelvin-daniel/pitches | 4aef04f414cfdd1d92c8b22e41a932724bcd97a0 | [
"MIT"
] | null | null | null | app/email.py | kelvin-daniel/pitches | 4aef04f414cfdd1d92c8b22e41a932724bcd97a0 | [
"MIT"
] | null | null | null | app/email.py | kelvin-daniel/pitches | 4aef04f414cfdd1d92c8b22e41a932724bcd97a0 | [
"MIT"
] | null | null | null | from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email ='kaymutor@gmail.com'
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.html = rend... | 38.1 | 66 | 0.740157 |
917461c90ca0483da875659bdfd322186e2c9ac3 | 2,580 | py | Python | fractal/cifs.py | pysrc/fractal | 323865020250e284b62f5a9722081c8c9ffe16fa | [
"MIT"
] | 26 | 2018-01-24T11:59:19.000Z | 2022-02-28T20:41:21.000Z | fractal/cifs.py | ChenL1994/fractal | 323865020250e284b62f5a9722081c8c9ffe16fa | [
"MIT"
] | 1 | 2018-11-02T05:58:34.000Z | 2018-11-02T06:00:25.000Z | fractal/cifs.py | pysrc/fractal | 323865020250e284b62f5a9722081c8c9ffe16fa | [
"MIT"
] | 10 | 2018-05-14T12:16:05.000Z | 2022-01-19T14:29:59.000Z | """
Complex Iterated Function System.
复迭代函数系统
"""
import pygame
from .base import Base
from .colors import *
from threading import Thread
class CIFS(Base):
def __init__(self, size, title=""):
Base.__init__(self, size, self.__run, title)
self.setRadius(10)
self.width = size[0]
... | 26.875 | 125 | 0.473256 |
37251fbac0b412af4addb7c49fdc260a983a56df | 7,567 | py | Python | main/control/admin.py | lipis/the-smallest-creature | 3079046a574bb4bae528b3ab467d34f24b9bd5c7 | [
"MIT"
] | 1 | 2016-01-01T20:56:32.000Z | 2016-01-01T20:56:32.000Z | main/control/admin.py | lipis/the-smallest-creature | 3079046a574bb4bae528b3ab467d34f24b9bd5c7 | [
"MIT"
] | null | null | null | main/control/admin.py | lipis/the-smallest-creature | 3079046a574bb4bae528b3ab467d34f24b9bd5c7 | [
"MIT"
] | null | null | null | # coding: utf-8
from flask.ext import wtf
import flask
import wtforms
import auth
import config
import model
import util
from main import app
###############################################################################
# Admin Stuff
###############################################################################... | 49.782895 | 171 | 0.725254 |
f503c7079db6cef5fafdeb00f1b38c9c3d91ed4e | 14,181 | py | Python | aioresponses/core.py | bnavigator/aioresponses | fc8f747cc64a55709836c6a1eace6d260b591bd8 | [
"MIT"
] | null | null | null | aioresponses/core.py | bnavigator/aioresponses | fc8f747cc64a55709836c6a1eace6d260b591bd8 | [
"MIT"
] | null | null | null | aioresponses/core.py | bnavigator/aioresponses | fc8f747cc64a55709836c6a1eace6d260b591bd8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import asyncio
import json
import copy
from collections import namedtuple
from distutils.version import StrictVersion
from functools import wraps
from typing import Callable, Dict, Tuple, Union, Optional, List # noqa
from unittest.mock import Mock, patch
import inspect
from aiohttp import (
... | 34.587805 | 79 | 0.556801 |
7f33c3371f4e155518c4ef1ec2562806183b4d02 | 209 | py | Python | signbank/attachments/urls.py | codev/bslsignbank | 5c8f48c4aa14f48483b38f922f4bc4a4d4eda33e | [
"BSD-3-Clause"
] | 5 | 2016-01-19T04:06:40.000Z | 2020-05-01T17:10:46.000Z | signbank/attachments/urls.py | codev/bslsignbank | 5c8f48c4aa14f48483b38f922f4bc4a4d4eda33e | [
"BSD-3-Clause"
] | 2 | 2020-02-12T00:09:31.000Z | 2020-06-05T17:51:51.000Z | signbank/attachments/urls.py | codev/bslsignbank | 5c8f48c4aa14f48483b38f922f4bc4a4d4eda33e | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import *
from signbank.attachments.views import *
urlpatterns = patterns('',
url(r'^$', AttachmentListView.as_view(), name="attachments"),
url(r'^upload/', upload_file),
)
| 20.9 | 65 | 0.679426 |
150bbe24eb64b6fc8a14d6acc08c4fd47773ff12 | 948 | py | Python | affiliates/base/forms.py | glogiotatidis/affiliates | 34d0ded8e24be9dd207d6419a5157dc8ce34bc06 | [
"BSD-3-Clause"
] | 15 | 2015-01-01T07:17:44.000Z | 2020-11-09T06:28:29.000Z | affiliates/base/forms.py | glogiotatidis/affiliates | 34d0ded8e24be9dd207d6419a5157dc8ce34bc06 | [
"BSD-3-Clause"
] | 16 | 2015-02-25T23:17:27.000Z | 2015-08-20T10:28:18.000Z | affiliates/base/forms.py | glogiotatidis/affiliates | 34d0ded8e24be9dd207d6419a5157dc8ce34bc06 | [
"BSD-3-Clause"
] | 12 | 2015-01-17T20:57:03.000Z | 2019-11-03T15:04:31.000Z | from django import forms
from django.conf import settings
from tower import ugettext_lazy as _lazy
COUNTRY_CHOICES = sorted(settings.COUNTRIES.items(), lambda a, b: cmp(a[1], b[1]))
class EmailInput(forms.TextInput):
"""Input specifically for email addresses."""
input_type = 'email'
class NewsletterSubs... | 36.461538 | 92 | 0.704641 |
9f9b8ac57dd8c418c2f5ed854b3e21bde9295b13 | 3,995 | py | Python | models.py | grapesmoker/pdf-library | 34132c29ce851dade035e26642fac5099d189cb6 | [
"MIT"
] | null | null | null | models.py | grapesmoker/pdf-library | 34132c29ce851dade035e26642fac5099d189cb6 | [
"MIT"
] | 1 | 2016-09-16T05:30:55.000Z | 2016-09-16T15:58:50.000Z | models.py | grapesmoker/pdf-library | 34132c29ce851dade035e26642fac5099d189cb6 | [
"MIT"
] | null | null | null | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey, Sequence, Table, Date, Text
from sqlalchemy.orm import relationship
Base = declarative_base()
author_documents = Table('author_documents', Base.metadata,
Column('author_id', Fo... | 35.990991 | 111 | 0.683855 |
e4c75faa5353667a334b50c4ef43d9b7581c59f5 | 2,429 | py | Python | examples/adwords/v201506/basic_operations/get_keywords.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | 1 | 2018-09-06T18:50:58.000Z | 2018-09-06T18:50:58.000Z | examples/adwords/v201506/basic_operations/get_keywords.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201506/basic_operations/get_keywords.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 30.746835 | 80 | 0.672293 |
b231370dd52926466e20da25c13503543213dec5 | 1,556 | py | Python | freqtrade/optimize/hyperopt_loss_sortino.py | Fractate/freqbot | 47b35d2320dc97977411454c1466c762d339fdee | [
"MIT"
] | 1 | 2022-03-06T22:44:30.000Z | 2022-03-06T22:44:30.000Z | freqtrade/optimize/hyperopt_loss_sortino.py | Fractate/freqbot | 47b35d2320dc97977411454c1466c762d339fdee | [
"MIT"
] | null | null | null | freqtrade/optimize/hyperopt_loss_sortino.py | Fractate/freqbot | 47b35d2320dc97977411454c1466c762d339fdee | [
"MIT"
] | 1 | 2021-09-22T23:28:21.000Z | 2021-09-22T23:28:21.000Z | """
SortinoHyperOptLoss
This module defines the alternative HyperOptLoss class which can be used for
Hyperoptimization.
"""
from datetime import datetime
import numpy as np
from pandas import DataFrame
from freqtrade.optimize.hyperopt import IHyperOptLoss
class SortinoHyperOptLoss(IHyperOptLoss):
"""
Defin... | 31.12 | 88 | 0.660668 |
3f86ae1c55d04be5569b6117395867efcd2b5652 | 1,510 | py | Python | Santos-2010/ut_Santos2010.py | Lyle-zhang/literature | c1266d326ee8a733e801c23aca89ab34edc09b6e | [
"MIT"
] | 1 | 2020-05-23T15:38:54.000Z | 2020-05-23T15:38:54.000Z | Santos-2010/ut_Santos2010.py | Lyle-zhang/literature | c1266d326ee8a733e801c23aca89ab34edc09b6e | [
"MIT"
] | null | null | null | Santos-2010/ut_Santos2010.py | Lyle-zhang/literature | c1266d326ee8a733e801c23aca89ab34edc09b6e | [
"MIT"
] | 1 | 2021-08-14T13:39:25.000Z | 2021-08-14T13:39:25.000Z | # Calculate terminal velocity, Ut, for a near spherical particle
# from Santos2010 book, pg 86, Eqs 4.12 - 4.15
# use Python 3 print function and division
from __future__ import print_function
from __future__ import division
#---- Parameters
# air properties at T = 300K, P = 1 atm
rhog = 1.17 # density (kg/m^3)
... | 26.034483 | 76 | 0.562252 |
c3a045b692703b834f59c1af4647d982b68ed137 | 8,902 | py | Python | augur/cli/configure.py | ritikavar/augur | eeb6013a4aa95641d4b47691e39a366e621b73cc | [
"MIT"
] | null | null | null | augur/cli/configure.py | ritikavar/augur | eeb6013a4aa95641d4b47691e39a366e621b73cc | [
"MIT"
] | null | null | null | augur/cli/configure.py | ritikavar/augur | eeb6013a4aa95641d4b47691e39a366e621b73cc | [
"MIT"
] | null | null | null | #SPDX-License-Identifier: MIT
"""
Augur library script for generating a config file
"""
import os
import click
import json
ENVVAR_PREFIX = "AUGUR_"
default_config = {
"Database": {
"name": "augur",
"host": "localhost",
"key": "key",
"password": "augur",
... | 34.503876 | 161 | 0.43069 |
ef9890c3f12a11028ddddbad2a99117a727d4563 | 602 | py | Python | tests/extmod/uctypes_ptr_le.py | willcharlton/micropython | 2097c8b1e16ed2e4a2ed9dd75623f02b42cf805a | [
"MIT"
] | 2 | 2019-04-17T03:56:40.000Z | 2019-04-17T03:56:42.000Z | tests/extmod/uctypes_ptr_le.py | roger-/micropython | bad2df3e95cd5719099319d71590a79bf6bc4493 | [
"MIT"
] | null | null | null | tests/extmod/uctypes_ptr_le.py | roger-/micropython | bad2df3e95cd5719099319d71590a79bf6bc4493 | [
"MIT"
] | null | null | null | import uctypes
desc = {
"ptr": (uctypes.PTR | 0, uctypes.UINT8),
"ptr16": (uctypes.PTR | 0, uctypes.UINT16),
"ptr2": (uctypes.PTR | 0, {"b": uctypes.UINT8 | 0}),
}
bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(4)
S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.LITTLE_ENDIAN)... | 23.153846 | 71 | 0.616279 |
c5c2abd729302f5b48ccce02cf940e69fd08558e | 13,016 | py | Python | vistrans/utils/linalg.py | FlyBrainLab/VisTrans | ba096778d4bd895a0e0fab02b9c519c5941bc82b | [
"BSD-3-Clause"
] | 1 | 2021-12-24T11:40:41.000Z | 2021-12-24T11:40:41.000Z | vistrans/utils/linalg.py | FlyBrainLab/VisTrans | ba096778d4bd895a0e0fab02b9c519c5941bc82b | [
"BSD-3-Clause"
] | null | null | null | vistrans/utils/linalg.py | FlyBrainLab/VisTrans | ba096778d4bd895a0e0fab02b9c519c5941bc82b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import pycuda.driver as cuda
import pycuda.gpuarray as garray
from pycuda.tools import dtype_to_ctype, context_dependent_memoize
from pycuda.compiler import SourceModule
import skcuda.cublas as cublas
from . import parray
""" assuming row major storage as in Pitc... | 37.295129 | 80 | 0.393823 |
f803d6e379099d82912f32ed474ecb90299f5b2f | 6,590 | py | Python | python_modules/dagster/dagster/core/selector/subset_selector.py | abhishekvermax/dagster | 668ab236b89c89faa9057d5d61a1a40b825da8a1 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/selector/subset_selector.py | abhishekvermax/dagster | 668ab236b89c89faa9057d5d61a1a40b825da8a1 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/selector/subset_selector.py | abhishekvermax/dagster | 668ab236b89c89faa9057d5d61a1a40b825da8a1 | [
"Apache-2.0"
] | null | null | null | import re
import sys
from dagster.core.definitions.dependency import DependencyStructure
from dagster.utils import check
MAX_NUM = sys.maxsize
def generate_dep_graph(pipeline_def):
"""'pipeline to dependency graph. It currently only supports top-level solids.
Args:
pipeline (PipelineDefinition): Th... | 35.621622 | 99 | 0.631866 |
4fc015fc13619158e9a0e00f8d30046287c3f1b0 | 1,102 | py | Python | setup.py | zhulik/aiophotoprism | 91cc263ffbd85c7dc7ccef6d4cdafdfdaf2a4c85 | [
"MIT"
] | 4 | 2021-08-09T05:02:23.000Z | 2022-01-30T03:04:29.000Z | setup.py | zhulik/aiophotoprism | 91cc263ffbd85c7dc7ccef6d4cdafdfdaf2a4c85 | [
"MIT"
] | null | null | null | setup.py | zhulik/aiophotoprism | 91cc263ffbd85c7dc7ccef6d4cdafdfdaf2a4c85 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup
with open("README.md", "r") as f:
readme = f.read()
setup(
name="aiophotoprism",
version="0.2.0",
author="Gleb Sinyavskiy",
author_email="zhulik.gleb@gmail.com",
description="Asynchronous Python client for the Photopri... | 31.485714 | 73 | 0.641561 |
46aff4b3751fded1af7e341cc736a522c6094363 | 10,353 | py | Python | uuv_control/uuv_trajectory_control/scripts/rov_nmb_sm_controller.py | jpliquid/testActions2 | 6f314fa1430f654e5943e47ac278101b9c24f938 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | uuv_control/uuv_trajectory_control/scripts/rov_nmb_sm_controller.py | jpliquid/testActions2 | 6f314fa1430f654e5943e47ac278101b9c24f938 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | uuv_control/uuv_trajectory_control/scripts/rov_nmb_sm_controller.py | jpliquid/testActions2 | 6f314fa1430f654e5943e47ac278101b9c24f938 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator Authors
# licensed under the Apache license, Version 2.0
# cf. 3rd-party-licenses.txt ... | 38.0625 | 100 | 0.570656 |
85035fe5457245177338239e95e36e6874f4c914 | 3,967 | py | Python | alipay/aop/api/request/AlipayIserviceMindvJobCreateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayIserviceMindvJobCreateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayIserviceMindvJobCreateRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayIserviceMindvJobCreateModel import AlipayIserviceMindvJobCreateModel
class AlipayIserviceMindvJobCreateRequest(object):
d... | 27.358621 | 148 | 0.644316 |
8b5da6ce6e38b69adf512d0dde0150488a102ba2 | 1,313 | py | Python | app/__init__.py | NaujOinotna/resthouse | e1f53515bf2bc5edde300e242b9228443b02bb4a | [
"MIT"
] | null | null | null | app/__init__.py | NaujOinotna/resthouse | e1f53515bf2bc5edde300e242b9228443b02bb4a | [
"MIT"
] | null | null | null | app/__init__.py | NaujOinotna/resthouse | e1f53515bf2bc5edde300e242b9228443b02bb4a | [
"MIT"
] | null | null | null | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bootstrap import Bootstrap
from app.main.views import views
from app.controls.auth import auth
from app.controls.operacoes import operacoes
from app.model.models import models
db = SQLAlchemy()
app_dir = os.path.abspath(os.path.dirna... | 32.02439 | 131 | 0.762376 |
3ab550a2499b77d53354ee7d24af93da3216e98c | 11,081 | py | Python | oscrypto/_mac/_security_cffi.py | frennkie/oscrypto | 24aff3148379b931d9c72ab3b069e537dc2195f8 | [
"MIT"
] | 1 | 2020-05-17T06:44:51.000Z | 2020-05-17T06:44:51.000Z | oscrypto/_mac/_security_cffi.py | frennkie/oscrypto | 24aff3148379b931d9c72ab3b069e537dc2195f8 | [
"MIT"
] | null | null | null | oscrypto/_mac/_security_cffi.py | frennkie/oscrypto | 24aff3148379b931d9c72ab3b069e537dc2195f8 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import platform
from ctypes.util import find_library
from .._ffi import register_ffi
from ..errors import LibraryNotFoundError
from cffi import FFI
__all__ = [
'Security',
'version',
'version_info',
]
v... | 45.600823 | 120 | 0.76771 |
5bd711ed8b75c0d9e7e84a2ddb8bbaeded1a8673 | 8,793 | py | Python | go/billing/migrations/0005_auto__add_field_statement_type__chg_field_statement_title.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/billing/migrations/0005_auto__add_field_statement_type__chg_field_statement_title.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/billing/migrations/0005_auto__add_field_statement_type__chg_field_statement_title.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Statement.type'
db.add_column(u'billing_statement', 'type',
self.gf('d... | 70.344 | 187 | 0.566018 |
e1406ff5cc535f0d325a2547b8d932ff46d56518 | 701 | py | Python | forign/101/Raspberry pi codes/resizeImg.py | extinctCoder/thesis | ebe135f343f0c4e66255f3792a515d408db5b627 | [
"MIT"
] | null | null | null | forign/101/Raspberry pi codes/resizeImg.py | extinctCoder/thesis | ebe135f343f0c4e66255f3792a515d408db5b627 | [
"MIT"
] | null | null | null | forign/101/Raspberry pi codes/resizeImg.py | extinctCoder/thesis | ebe135f343f0c4e66255f3792a515d408db5b627 | [
"MIT"
] | 1 | 2020-09-21T18:13:24.000Z | 2020-09-21T18:13:24.000Z | import cv2
import time
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306, ssd1325, ssd1331, sh1106
from time import sleep
from PIL import Image
RST = 24
image = cv2.imread("download.jpeg")
w=128... | 20.617647 | 63 | 0.760342 |
6b94b2900c0f839382ae8a85c43058c2580c4a3e | 3,462 | py | Python | api/user/views.py | uktrade/market-access-api | 850a59880f8f62263784bcd9c6b3362e447dbc7a | [
"MIT"
] | null | null | null | api/user/views.py | uktrade/market-access-api | 850a59880f8f62263784bcd9c6b3362e447dbc7a | [
"MIT"
] | 51 | 2018-05-31T12:16:31.000Z | 2022-03-08T09:36:48.000Z | api/user/views.py | uktrade/market-access-api | 850a59880f8f62263784bcd9c6b3362e447dbc7a | [
"MIT"
] | 2 | 2019-12-24T09:47:42.000Z | 2021-02-09T09:36:51.000Z | from http import HTTPStatus
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.http import HttpResponse
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import generics
from rest_framework.decorators import api_view, permission_class... | 30.368421 | 75 | 0.718949 |
877296e368fda47db5f83c7dff4662177eaedafe | 4,640 | py | Python | ceilometer/openstack/common/loopingcall.py | rackerlabs/instrumented-ceilometer | 6ac5215ac0476120d9c99adcabc9cad0d32963da | [
"Apache-2.0"
] | 3 | 2021-04-18T00:37:48.000Z | 2021-07-21T10:20:11.000Z | ceilometer/openstack/common/loopingcall.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | ceilometer/openstack/common/loopingcall.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | 31.780822 | 78 | 0.597845 |
9c8160db46e0001895d5e3d3a80e0e1fed257d2d | 3,659 | py | Python | infcommon/generic_factory_test.py | aleasoluciones/infcommon | cdd64dacba6b1219e511b3410168434080c668da | [
"MIT"
] | null | null | null | infcommon/generic_factory_test.py | aleasoluciones/infcommon | cdd64dacba6b1219e511b3410168434080c668da | [
"MIT"
] | 1 | 2021-03-26T09:16:07.000Z | 2021-03-26T09:16:07.000Z | infcommon/generic_factory_test.py | aleasoluciones/infcommon | cdd64dacba6b1219e511b3410168434080c668da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import types
import importlib
import traceback
import os
import fnmatch
import re
from datetime import datetime
TOTALS_TESTS_PASSED = 0
LAST_CALL = None
GREEN_COLOR = "\033[0;32m"
WHITE_COLOR = "\033[0;39m"
RED_COLOR = "\033[91m"
def find_and_call_functions_from():
global TOT... | 38.515789 | 143 | 0.576387 |
7a620e058757c1b2a4a3df9f63a397647a4b0a78 | 634 | py | Python | manage.py | Nikolas-01/Lesson_21- | 025ff91547465a57e6a8d5911896fcdfb8c7e3f8 | [
"MIT"
] | null | null | null | manage.py | Nikolas-01/Lesson_21- | 025ff91547465a57e6a8d5911896fcdfb8c7e3f8 | [
"MIT"
] | 4 | 2021-03-30T14:19:21.000Z | 2021-09-22T19:33:36.000Z | manage.py | Nikolas-01/Lesson_21- | 025ff91547465a57e6a8d5911896fcdfb8c7e3f8 | [
"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', 'automation_app.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise... | 28.818182 | 78 | 0.68612 |
54c3c885a863f2986e6db67de645cbd03d157d12 | 9,534 | py | Python | packages/dcos-integration-test/extra/test_helpers.py | catsouthard/dcos | 53a31071349cd0cf6560ef48e5bbd36489e97022 | [
"Apache-2.0"
] | 1 | 2020-03-24T12:04:41.000Z | 2020-03-24T12:04:41.000Z | packages/dcos-integration-test/extra/test_helpers.py | catsouthard/dcos | 53a31071349cd0cf6560ef48e5bbd36489e97022 | [
"Apache-2.0"
] | 1 | 2021-06-02T02:49:47.000Z | 2021-06-02T02:49:47.000Z | packages/dcos-integration-test/extra/test_helpers.py | catsouthard/dcos | 53a31071349cd0cf6560ef48e5bbd36489e97022 | [
"Apache-2.0"
] | null | null | null | import copy
import json
import uuid
from dcos_test_utils import marathon
__maintainer__ = 'mellenburg'
__contact__ = 'tools-infra-team@mesosphere.io'
TEST_APP_NAME_FMT = 'integration-test-{}'
def get_exhibitor_admin_password():
try:
with open('/opt/mesosphere/etc/exhibitor_realm', 'r') as f:
... | 40.058824 | 110 | 0.594084 |
071098ca489d54e19aef30baef1c920873ef932e | 9,394 | py | Python | app/models.py | Aaron1992/shiguang2 | c2bc9eb765a417a191bdb3238cf49a541d14deb2 | [
"Apache-2.0"
] | 1 | 2015-11-05T19:45:40.000Z | 2015-11-05T19:45:40.000Z | app/models.py | Aaron1992/shiguang | c2bc9eb765a417a191bdb3238cf49a541d14deb2 | [
"Apache-2.0"
] | null | null | null | app/models.py | Aaron1992/shiguang | c2bc9eb765a417a191bdb3238cf49a541d14deb2 | [
"Apache-2.0"
] | null | null | null | from werkzeug.security import generate_password_hash,check_password_hash
from datetime import datetime
from app import db
from flask import url_for
'''==============================================================
The User Model
=============================================================='''
class User(... | 29.35625 | 97 | 0.588887 |
6a65011ba736c91fd3a85164ba6b912e77a67029 | 594 | py | Python | dump_videos.py | dibyajit30/Unsupervised-Video-Summerization | 2bff6e2e79247945ec14525f12c5c93461491394 | [
"MIT"
] | null | null | null | dump_videos.py | dibyajit30/Unsupervised-Video-Summerization | 2bff6e2e79247945ec14525f12c5c93461491394 | [
"MIT"
] | 1 | 2021-08-07T03:19:51.000Z | 2021-08-07T03:19:51.000Z | dump_videos.py | dibyajit30/Unsupervised-Video-Summerization | 2bff6e2e79247945ec14525f12c5c93461491394 | [
"MIT"
] | 1 | 2021-03-10T12:10:14.000Z | 2021-03-10T12:10:14.000Z | import cv2
from tqdm.auto import tqdm
import numpy as np
import glob
import os
import gc
files = glob.glob("ydata-tvsum50-v1_1/video/*.mp4")
for file in tqdm(files):
prefix = file.split("/")[-1].split(".")[0]
save_path = f"videos_npy/{prefix}.npy"
if os.path.exists(save_path):
continue
frames =... | 22 | 51 | 0.616162 |
6e66689e646ccde9bf1d1dd1d38becc381fabc10 | 84,108 | py | Python | music_publisher/migrations/0002_mayday.py | mashanz/django-music-publisher | 4107a28460f175d17920010fc89f1f2d547c6226 | [
"MIT"
] | 44 | 2018-07-24T22:08:17.000Z | 2022-03-10T14:51:37.000Z | music_publisher/migrations/0002_mayday.py | mashanz/django-music-publisher | 4107a28460f175d17920010fc89f1f2d547c6226 | [
"MIT"
] | 43 | 2018-10-09T11:43:55.000Z | 2022-02-05T10:47:23.000Z | music_publisher/migrations/0002_mayday.py | mashanz/django-music-publisher | 4107a28460f175d17920010fc89f1f2d547c6226 | [
"MIT"
] | 20 | 2019-01-11T02:10:39.000Z | 2022-02-17T22:34:45.000Z | # Generated by Django 3.2 on 2021-04-16 14:49
import django.core.validators
from django.db import migrations, models
import django.db.migrations.operations.special
import music_publisher.validators
from django.conf import settings
def persist_recording_ids(apps, schema_editor):
Work = apps.get_model('music_publi... | 584.083333 | 9,864 | 0.565226 |
681bcc702da4b783eb01a4f068589cf870b3c78d | 6,068 | py | Python | neutron/tests/functional/cmd/process_spawn.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:31.000Z | 2018-07-04T07:59:31.000Z | neutron/tests/functional/cmd/process_spawn.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/cmd/process_spawn.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | 1 | 2018-08-28T17:13:16.000Z | 2018-08-28T17:13:16.000Z | # Copyright 2016 Red Hat, 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 agre... | 32.8 | 78 | 0.573995 |
24eeb8ca74a7cf4c88c6b18ba7c3e156a0fdae5d | 679 | py | Python | qoqo_pyquest/__version__.py | kbarkhqs/qoqo_pyquest | cc8b9c7daf3fcdc094c16308c59cbe86a6d04295 | [
"Apache-2.0"
] | 2 | 2021-12-16T04:31:01.000Z | 2022-01-20T08:08:35.000Z | qoqo_pyquest/__version__.py | kbarkhqs/qoqo_pyquest | cc8b9c7daf3fcdc094c16308c59cbe86a6d04295 | [
"Apache-2.0"
] | null | null | null | qoqo_pyquest/__version__.py | kbarkhqs/qoqo_pyquest | cc8b9c7daf3fcdc094c16308c59cbe86a6d04295 | [
"Apache-2.0"
] | 3 | 2021-02-04T16:46:34.000Z | 2021-12-16T04:33:16.000Z | # Copyright © 2019-2021 HQS Quantum Simulations 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... | 48.5 | 99 | 0.765832 |
efd2c15d9844505a88fe04959e1c9120d2e1c155 | 7,315 | py | Python | server/www/packages/packages-windows/x86/ldap3/strategy/mockSync.py | tinygg/teleport | 5ac759c707d355767a209e29becaadf250b0e366 | [
"Apache-2.0"
] | 640 | 2018-09-12T03:14:13.000Z | 2022-03-30T04:38:09.000Z | server/www/packages/packages-windows/x86/ldap3/strategy/mockSync.py | tinygg/teleport | 5ac759c707d355767a209e29becaadf250b0e366 | [
"Apache-2.0"
] | 175 | 2018-09-10T19:52:20.000Z | 2022-03-30T04:37:30.000Z | server/www/packages/packages-windows/x86/ldap3/strategy/mockSync.py | tinygg/teleport | 5ac759c707d355767a209e29becaadf250b0e366 | [
"Apache-2.0"
] | 230 | 2018-09-13T02:40:49.000Z | 2022-03-29T11:53:58.000Z | """
"""
# Created on 2014.11.17
#
# Author: Giovanni Cannata
#
# Copyright 2014 - 2020 Giovanni Cannata
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Founda... | 54.589552 | 176 | 0.639645 |
ebb977550cc6801cd1560990314f8992aa0e344b | 15,064 | py | Python | allenact_plugins/habitat_plugin/habitat_tasks.py | klemenkotar/dcrl | 457be7af1389db37ec12e165dfad646e17359162 | [
"MIT"
] | 18 | 2021-06-09T04:50:47.000Z | 2022-02-04T22:56:56.000Z | allenact_plugins/habitat_plugin/habitat_tasks.py | klemenkotar/dcrl | 457be7af1389db37ec12e165dfad646e17359162 | [
"MIT"
] | null | null | null | allenact_plugins/habitat_plugin/habitat_tasks.py | klemenkotar/dcrl | 457be7af1389db37ec12e165dfad646e17359162 | [
"MIT"
] | 4 | 2021-06-09T06:20:25.000Z | 2022-03-13T03:11:17.000Z | from abc import ABC
from typing import Tuple, List, Dict, Any, Optional, Union, Sequence, cast
import gym
import numpy as np
from habitat.sims.habitat_simulator.actions import HabitatSimActions
from habitat.sims.habitat_simulator.habitat_simulator import HabitatSim
from habitat.tasks.nav.shortest_path_follower import ... | 36.211538 | 97 | 0.628585 |
c5022a6e36c1533b15319c7da5d21dd9b6910933 | 4,915 | py | Python | utils/configue.py | psunlpgroup/Summ-N | 3285317e7bbb24519bc709de52d7b45c732a8a9c | [
"MIT"
] | null | null | null | utils/configue.py | psunlpgroup/Summ-N | 3285317e7bbb24519bc709de52d7b45c732a8a9c | [
"MIT"
] | null | null | null | utils/configue.py | psunlpgroup/Summ-N | 3285317e7bbb24519bc709de52d7b45c732a8a9c | [
"MIT"
] | null | null | null | import argparse
import configparser
import datetime
import os
DEFAULT_CONFIGURE_DIR = "configure"
DEFAULT_DATASET_DIR = "data"
DEFAULT_MODEL_DIR = "models"
class Args(object):
def __init__(self, contain=None):
self.__self__ = contain
self.__default__ = None
self.__default__ = set(dir(self... | 32.335526 | 102 | 0.542625 |
00a1e226f38882688181cdc91362c767fbaaa8bb | 22,551 | py | Python | exopy_qcircuits/instruments/drivers/ZI/UHFLI.py | rassouly/ecpy_qcircuits | 0b2b41126c93ba6db5fcc5db931ba35f0b525aa3 | [
"BSD-3-Clause"
] | null | null | null | exopy_qcircuits/instruments/drivers/ZI/UHFLI.py | rassouly/ecpy_qcircuits | 0b2b41126c93ba6db5fcc5db931ba35f0b525aa3 | [
"BSD-3-Clause"
] | 2 | 2018-05-25T09:35:27.000Z | 2020-10-28T15:50:52.000Z | exopy_qcircuits/instruments/drivers/ZI/UHFLI.py | rassouly/ecpy_qcircuits | 0b2b41126c93ba6db5fcc5db931ba35f0b525aa3 | [
"BSD-3-Clause"
] | 4 | 2017-11-23T10:14:29.000Z | 2020-01-27T16:13:49.000Z | # -*- coding: utf-8 -*-
"""This module defines drivers for UHFLI using Zhinst Library.
:Contains:
UHFLI
Python package zhinst from Zurick Instruments need to be install
"""
from __future__ import (division, unicode_literals, print_function,
absolute_import)
from ..driver_tools import (I... | 46.401235 | 139 | 0.476121 |
8ca1ef4c644ce71f8cb12d45ac323b0b5698490f | 2,794 | py | Python | src/ordename_od/skeleton.py | rcallea/ordename_od | 85a197f82c6e4386d6f4aa0b87e0f88273907864 | [
"MIT"
] | null | null | null | src/ordename_od/skeleton.py | rcallea/ordename_od | 85a197f82c6e4386d6f4aa0b87e0f88273907864 | [
"MIT"
] | null | null | null | src/ordename_od/skeleton.py | rcallea/ordename_od | 85a197f82c6e4386d6f4aa0b87e0f88273907864 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
[options.entry_points] section in setup.cfg:
console_scripts =
fibonacci = ordename_od.skeleton:run
Then run `python setup.py install... | 24.086207 | 77 | 0.63529 |
20a361932d637002975d2bcaee17470cd2b2a7ec | 890 | py | Python | osd/classes/boolean.py | bmeyers/optimal-signal-decomposition | 14376d38e3b2965e0ccdaf4a8a1c3683697c146c | [
"BSD-3-Clause"
] | 9 | 2022-02-22T00:43:12.000Z | 2022-03-20T22:00:43.000Z | osd/classes/boolean.py | cvxgrp/signal-decomposition | 14376d38e3b2965e0ccdaf4a8a1c3683697c146c | [
"BSD-3-Clause"
] | 1 | 2022-02-04T21:28:55.000Z | 2022-02-04T21:28:55.000Z | osd/classes/boolean.py | cvxgrp/signal-decomposition | 14376d38e3b2965e0ccdaf4a8a1c3683697c146c | [
"BSD-3-Clause"
] | null | null | null | ''' Boolean Signal
This module contains the class for Boolean signal
Author: Bennet Meyers
'''
import numpy as np
from osd.classes.component import Component
class Boolean(Component):
def __init__(self, scale=1, shift=0, **kwargs):
super().__init__(**kwargs)
self.scale = scale
self.shi... | 24.054054 | 71 | 0.61236 |
43097af0bcbafabf2ff83c01155d7a68126c505b | 912 | py | Python | rest_notifications/migrations/0005_pushwooshtoken.py | yeti/rest_notifications | ff282eedbe5588766b0eaebd06054873b6ee7f93 | [
"MIT"
] | 1 | 2016-09-27T04:12:23.000Z | 2016-09-27T04:12:23.000Z | rest_notifications/migrations/0005_pushwooshtoken.py | yeti/rest_notifications | ff282eedbe5588766b0eaebd06054873b6ee7f93 | [
"MIT"
] | null | null | null | rest_notifications/migrations/0005_pushwooshtoken.py | yeti/rest_notifications | ff282eedbe5588766b0eaebd06054873b6ee7f93 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('rest_notifications', '0004_auto_20141020_... | 30.4 | 114 | 0.594298 |
de1c622ad6385b4dc0326701af14a9b2fe5c3526 | 1,265 | py | Python | server/app/middlewares.py | SheetWithoutShit/sws | 1217891fcc00c1d2ea840586e31bbd038fdce42e | [
"MIT"
] | null | null | null | server/app/middlewares.py | SheetWithoutShit/sws | 1217891fcc00c1d2ea840586e31bbd038fdce42e | [
"MIT"
] | 51 | 2020-04-30T13:08:37.000Z | 2020-08-28T12:16:26.000Z | server/app/middlewares.py | SheetWithoutShit/sws | 1217891fcc00c1d2ea840586e31bbd038fdce42e | [
"MIT"
] | null | null | null | """This module provides middlewares for server app."""
from aiohttp import web
from core.jwt import decode_jwt
USER_PATH = "/user"
@web.middleware
async def check_auth(request, handler):
"""Check if client has correct token in case of accessing protected paths."""
if request.path.startswith(USER_PATH):
... | 31.625 | 103 | 0.660079 |
7685c944164aca735d980b12fdeef3724683be40 | 82 | py | Python | ex10-d3.py | Haceau-Zoac/LPtHWExercises | d4f2e473660bad654e8c400f60a7839154a4b954 | [
"MIT"
] | null | null | null | ex10-d3.py | Haceau-Zoac/LPtHWExercises | d4f2e473660bad654e8c400f60a7839154a4b954 | [
"MIT"
] | null | null | null | ex10-d3.py | Haceau-Zoac/LPtHWExercises | d4f2e473660bad654e8c400f60a7839154a4b954 | [
"MIT"
] | null | null | null | 格式字符串 = "待办清单: {}"
待办清单 = '''
\t* 吃饭
\t* 睡觉
\t* 打豆豆
'''
print(格式字符串.format(待办清单)) | 10.25 | 25 | 0.52439 |
60ca2e8088f36d13e47289c287728c4a67d8a340 | 22,687 | py | Python | tests/api/v1/test_topics.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 17 | 2016-09-02T09:21:29.000Z | 2021-09-27T11:33:58.000Z | tests/api/v1/test_topics.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 80 | 2015-12-09T09:29:26.000Z | 2021-01-06T08:24:22.000Z | tests/api/v1/test_topics.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 10 | 2015-09-29T21:34:53.000Z | 2021-09-27T11:34:01.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Red Hat, 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... | 36.2992 | 93 | 0.602724 |
725f476446c1efc7eb7b45fa326482b30f8c3395 | 5,917 | py | Python | lunisolar/lunisolar.py | SimonHung/lunisolar | e539da2bba2d5ae0b4b7dfd9cb08ef4410cb4109 | [
"MIT"
] | null | null | null | lunisolar/lunisolar.py | SimonHung/lunisolar | e539da2bba2d5ae0b4b7dfd9cb08ef4410cb4109 | [
"MIT"
] | null | null | null | lunisolar/lunisolar.py | SimonHung/lunisolar | e539da2bba2d5ae0b4b7dfd9cb08ef4410cb4109 | [
"MIT"
] | null | null | null | from pycalcal.wrappers import \
chinese_from_gregorian, \
gregorian_from_chinese, \
chinese_date as CDate, \
get_branch, \
get_stem, \
is_valid_chinese_date
from .constants import zodiac, elements, heavenly_stems, earthly_branches
#from exceptions import ValueError, TypeError
from datetime impo... | 29.733668 | 79 | 0.627007 |
b2840cc9b02f537ea02911a1fe215ca768aeae56 | 1,268 | py | Python | annotation_gui_gcp/lib/views/tools_view.py | svenkreiss/OpenSfM | 39cb7746f12f2c06a0e9809e48e8844775977c47 | [
"BSD-2-Clause"
] | 1 | 2022-01-10T15:22:01.000Z | 2022-01-10T15:22:01.000Z | annotation_gui_gcp/lib/views/tools_view.py | svenkreiss/OpenSfM | 39cb7746f12f2c06a0e9809e48e8844775977c47 | [
"BSD-2-Clause"
] | null | null | null | annotation_gui_gcp/lib/views/tools_view.py | svenkreiss/OpenSfM | 39cb7746f12f2c06a0e9809e48e8844775977c47 | [
"BSD-2-Clause"
] | null | null | null | from annotation_gui_gcp.lib.views.web_view import WebView
class ToolsView(WebView):
def __init__(self, main_ui, web_app):
super().__init__(main_ui, web_app, "/tools")
self.main_ui = main_ui
def process_client_message(self, data):
# Got some input from the frontend
if data["eve... | 33.368421 | 72 | 0.573344 |
81dad4bb9811a3f6923e3d10df96b5e82d8fb63a | 526 | py | Python | Num/one.py | Ashokkommi0001/patterns | daa1a1d8f3bc6e021e02a0e34458e2c178fc71d2 | [
"MIT"
] | 2 | 2021-03-17T12:08:22.000Z | 2021-03-17T12:11:10.000Z | Num/one.py | Ashokkommi0001/patterns | daa1a1d8f3bc6e021e02a0e34458e2c178fc71d2 | [
"MIT"
] | null | null | null | Num/one.py | Ashokkommi0001/patterns | daa1a1d8f3bc6e021e02a0e34458e2c178fc71d2 | [
"MIT"
] | 1 | 2021-03-17T11:49:39.000Z | 2021-03-17T11:49:39.000Z | def for_one():
for row in range(7):
for col in range(7):
if (col==3 or row==6) or (row<3 and row+col==2):
print("*",end="")
else:
print(end=" ")
print()
def while_one():
row=0
while row<7:
col=0
while col... | 22.869565 | 61 | 0.361217 |
ead96b72c46b2a119560e85fa60f5ead91ca06b2 | 1,005 | py | Python | myaxf/urls.py | zhouqi007/test22221 | fc1b53f5daf6e3f2637abca440069d83346aa3e0 | [
"Apache-2.0"
] | null | null | null | myaxf/urls.py | zhouqi007/test22221 | fc1b53f5daf6e3f2637abca440069d83346aa3e0 | [
"Apache-2.0"
] | null | null | null | myaxf/urls.py | zhouqi007/test22221 | fc1b53f5daf6e3f2637abca440069d83346aa3e0 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from .views import *
urlpatterns = [
url(r"^home$",home,name="home"),
url(r"^market$",market,name="market"),
url(r"^cart$",cart,name="cart"),
url(r"^mine$",mine,name="mine"),
url(r"^market_with_params/(\d+)/(\d+)/(\d+)",
market_with_params,
... | 29.558824 | 70 | 0.578109 |
743744b9275569e0b19048db59d0587c17c0481f | 1,082 | py | Python | src/routeControllers/createRawOutages.py | rohit98077/wrldc_mis_flask_ui | 6cbda753518e31ddbbeec9a8944a59737148d912 | [
"MIT"
] | null | null | null | src/routeControllers/createRawOutages.py | rohit98077/wrldc_mis_flask_ui | 6cbda753518e31ddbbeec9a8944a59737148d912 | [
"MIT"
] | null | null | null | src/routeControllers/createRawOutages.py | rohit98077/wrldc_mis_flask_ui | 6cbda753518e31ddbbeec9a8944a59737148d912 | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify, render_template, request
from src.appConfig import getConfig
from src.services.rawOutagesCreationHandler import RawOutagesCreationHandler
import datetime as dt
# get application config
appConfig = getConfig()
createRawOutagesPage = Blueprint('createRawOutages', __name__,
... | 41.615385 | 76 | 0.711645 |
d2abecf7c53ef14516281ae7fc7e0a7b59897336 | 13,358 | py | Python | src/GraphAlgo.py | haimgoldfisher/OOP_Ex3 | a47e0e95be9cdbf3f3f415515492c7ce8a6fcc88 | [
"MIT"
] | null | null | null | src/GraphAlgo.py | haimgoldfisher/OOP_Ex3 | a47e0e95be9cdbf3f3f415515492c7ce8a6fcc88 | [
"MIT"
] | null | null | null | src/GraphAlgo.py | haimgoldfisher/OOP_Ex3 | a47e0e95be9cdbf3f3f415515492c7ce8a6fcc88 | [
"MIT"
] | 1 | 2022-03-28T18:29:05.000Z | 2022-03-28T18:29:05.000Z | import copy
import itertools
import math
import queue
from random import random, randrange
from typing import List
import json
from matplotlib import patheffects
import GraphInterface
from GraphAlgoInterface import GraphAlgoInterface
from DiGraph import DiGraph
from Loc_Node_Edge import Node, Location
import matplotlib... | 39.288235 | 151 | 0.547986 |
0663cc086cea1064ccba1d59173cbabf510b0667 | 677 | py | Python | Chapter03/tf1/variable_2.py | PacktPublishing/Hands-On-Neural-Networks-with-TensorFlow-2.0 | 8b21ecfca7504d5104cced2375e23a1a3e72e767 | [
"MIT"
] | 112 | 2019-09-24T11:00:19.000Z | 2022-03-24T09:31:47.000Z | Chapter03/variable_2.py | sweaterr/Hands-On-Neural-Networks-with-TensorFlow-2.0 | e9a76ee25d359e5e7652d6301c116fa071ded13d | [
"MIT"
] | 2 | 2021-08-25T16:01:02.000Z | 2022-02-10T01:40:27.000Z | Chapter03/variable_2.py | sweaterr/Hands-On-Neural-Networks-with-TensorFlow-2.0 | e9a76ee25d359e5e7652d6301c116fa071ded13d | [
"MIT"
] | 63 | 2019-09-30T06:15:42.000Z | 2022-03-28T05:46:44.000Z | import tensorflow as tf
import numpy as np
A = tf.Variable([[1, 2], [3, 4]], dtype=tf.float32)
A = A.assign_add(tf.ones_like(A))
x = tf.Variable([[0, 10], [0, 0.5]])
b = tf.constant([[1, -1]], dtype=tf.float32)
y = tf.add(tf.matmul(A, x), b, name="result")
init = tf.global_variables_initializer()
writer = tf.summary... | 27.08 | 68 | 0.638109 |
bcb48de37598a2bea15cd9bab7056de1a8422081 | 1,274 | py | Python | game_generation_scripts/csv_analysis/make_lists.py | elexis-eu/word-game | 146aa14d5fbb2fd5e33c6021b60b09e0552c948d | [
"Apache-2.0"
] | null | null | null | game_generation_scripts/csv_analysis/make_lists.py | elexis-eu/word-game | 146aa14d5fbb2fd5e33c6021b60b09e0552c948d | [
"Apache-2.0"
] | 4 | 2020-09-22T11:04:13.000Z | 2020-09-22T11:04:27.000Z | game_generation_scripts/csv_analysis/make_lists.py | elexis-eu/word-games | 146aa14d5fbb2fd5e33c6021b60b09e0552c948d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import argparse
import codecs
import shutil
import os
arg_parser = argparse.ArgumentParser(description='Extract headword lists by structure (#1112).')
arg_parser.add_argument('-infile', type=str, help='Input file')
arg_parser.add_argument('-outdir', type=str, help='Output directory ')
arguments = a... | 31.073171 | 96 | 0.692308 |
06cde87553e1454794715ac240e0a7ee640ff3cd | 6,182 | py | Python | Recognize/recognition_object.py | l976308589/cnn_captcha_copy | ebc440300b84a87df41393f5de2b97d7ff3cad26 | [
"Apache-2.0"
] | null | null | null | Recognize/recognition_object.py | l976308589/cnn_captcha_copy | ebc440300b84a87df41393f5de2b97d7ff3cad26 | [
"Apache-2.0"
] | null | null | null | Recognize/recognition_object.py | l976308589/cnn_captcha_copy | ebc440300b84a87df41393f5de2b97d7ff3cad26 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
识别图像的类,为了快速进行多次识别可以调用此类下面的方法:
R = Recognizer(image_height, image_width, max_captcha)
for i in range(10):
r_img = Image.open(str(i) + ".jpg")
t = R.rec_image(r_img)
简单的图片每张基本上可以达到毫秒级的识别速度
"""
import tensorflow as tf
import numpy as np
from PIL import Image
from Config.config import sa... | 39.126582 | 111 | 0.593012 |
4b3e8039ef03b96b0a01bf2bfa5d4e52fd398665 | 624 | py | Python | proembedding/utils/txtparser.py | thomasly/proembedding | 838c447c4987e92aac5d3a695c3179ec548dfdb1 | [
"MIT"
] | null | null | null | proembedding/utils/txtparser.py | thomasly/proembedding | 838c447c4987e92aac5d3a695c3179ec548dfdb1 | [
"MIT"
] | null | null | null | proembedding/utils/txtparser.py | thomasly/proembedding | 838c447c4987e92aac5d3a695c3179ec548dfdb1 | [
"MIT"
] | null | null | null | class ExcludeTxt:
def __init__(self, path):
self.path = path
@property
def indices_set(self):
try:
return self._indices_set
except AttributeError:
self._indices_set = self._get_indices()
return self._indices_set
def _get_indices(self):
... | 24.96 | 51 | 0.519231 |
7fbc26f490489059850944ca9e9d4c1538304ae5 | 1,229 | py | Python | Moon_Data/source/model.py | KevinHubert-Dev/AWS-MachineLearning-Nanodegree | 25e8c887befc296ed7d3a6bea45431b89cb8b818 | [
"MIT"
] | null | null | null | Moon_Data/source/model.py | KevinHubert-Dev/AWS-MachineLearning-Nanodegree | 25e8c887befc296ed7d3a6bea45431b89cb8b818 | [
"MIT"
] | null | null | null | Moon_Data/source/model.py | KevinHubert-Dev/AWS-MachineLearning-Nanodegree | 25e8c887befc296ed7d3a6bea45431b89cb8b818 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
## TODO: Complete this classifier
class SimpleNet(nn.Module):
## TODO: Define the init function
def __init__(self, input_dim, hidden_dim, output_dim):
'''Defines layers of a neural network.
:param input_dim: Number of in... | 34.138889 | 86 | 0.609439 |
01656f16db5e760246043312477c9f9025193382 | 257 | py | Python | rps3env/opponents/__init__.py | islamelnabarawy/rps3env | e7728a5c310fa82a9fa9b65a628cb77e4efbc425 | [
"Apache-2.0"
] | null | null | null | rps3env/opponents/__init__.py | islamelnabarawy/rps3env | e7728a5c310fa82a9fa9b65a628cb77e4efbc425 | [
"Apache-2.0"
] | null | null | null | rps3env/opponents/__init__.py | islamelnabarawy/rps3env | e7728a5c310fa82a9fa9b65a628cb77e4efbc425 | [
"Apache-2.0"
] | null | null | null | from rps3env.opponents.base_opponent import BaseOpponent
from rps3env.opponents.minmax_opponent import MinMaxOpponent
from rps3env.opponents.random_opponent import RandomOpponent
__all__ = [
'BaseOpponent',
'RandomOpponent',
'MinMaxOpponent'
]
| 25.7 | 60 | 0.809339 |
9c18181d4a7c3b3ce77c009eff5fd44ed5f13255 | 2,233 | py | Python | bigfastapi/models/auth_models.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | 1 | 2022-03-20T21:46:05.000Z | 2022-03-20T21:46:05.000Z | bigfastapi/models/auth_models.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | bigfastapi/models/auth_models.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | import datetime as _dt
from sqlite3 import Timestamp
import sqlalchemy as _sql
import sqlalchemy.orm as _orm
import passlib.hash as _hash
from sqlalchemy.schema import Column
from sqlalchemy.types import String, Integer, Enum, DateTime, Boolean, ARRAY, Text
from sqlalchemy import ForeignKey
from uuid import UUID, uuid4... | 42.132075 | 82 | 0.753695 |
b625532f7c7dd04e07edbec9da87834c5659257e | 1,599 | py | Python | deploy/fab.py | aptivate/opendatacomparison | 49784acee56108e37b98744686e1f648a97bd960 | [
"MIT"
] | null | null | null | deploy/fab.py | aptivate/opendatacomparison | 49784acee56108e37b98744686e1f648a97bd960 | [
"MIT"
] | null | null | null | deploy/fab.py | aptivate/opendatacomparison | 49784acee56108e37b98744686e1f648a97bd960 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# a script to set up the virtualenv so we can use fabric and tasks
import os
from os import path
import sys
import subprocess
from ve_mgr import check_python_version, find_package_dir_in_ve, UpdateVE
# check python version is high enough
check_python_version(2, 6, __file__)
if 'VIRTUAL_ENV' in ... | 29.611111 | 75 | 0.742339 |
f9101a5542c9fdf0bec184d63d4f2b039dce0769 | 212 | py | Python | src/wikirepo/data/climate/aqi.py | djKooks/wikirepo | 1764dd1b8f3e3b2d34cf63ad5fe487e1ce9c98d0 | [
"BSD-3-Clause"
] | null | null | null | src/wikirepo/data/climate/aqi.py | djKooks/wikirepo | 1764dd1b8f3e3b2d34cf63ad5fe487e1ce9c98d0 | [
"BSD-3-Clause"
] | null | null | null | src/wikirepo/data/climate/aqi.py | djKooks/wikirepo | 1764dd1b8f3e3b2d34cf63ad5fe487e1ce9c98d0 | [
"BSD-3-Clause"
] | null | null | null | """
Air Quality Index
-----------------
Functions querying 'PXYZ' (air quality index) information.
Contents
query_prop_data
"""
# Note: whether this is daily or a lower time_lvl would need to be discussed
| 17.666667 | 76 | 0.683962 |
82b5e5e767165e64437aef69bdcc4ad32ca5f082 | 1,278 | py | Python | lib/taurus/core/__init__.py | MikeFalowski/taurus | ef041bf35dd847caf08a7efbe072f4020d35522e | [
"CC-BY-3.0"
] | null | null | null | lib/taurus/core/__init__.py | MikeFalowski/taurus | ef041bf35dd847caf08a7efbe072f4020d35522e | [
"CC-BY-3.0"
] | 1 | 2020-02-28T16:36:04.000Z | 2020-03-02T07:51:12.000Z | lib/taurus/core/__init__.py | MikeFalowski/taurus | ef041bf35dd847caf08a7efbe072f4020d35522e | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... | 31.170732 | 77 | 0.664319 |
914b325e0785940c5d27c6700f54fea2925b010f | 3,568 | py | Python | image-comment-generation/utils/logger.py | stonyhu/Image-Commenting | eb925a3f99075d8b74c6cabd125f7b9a1f9786d2 | [
"Apache-2.0"
] | null | null | null | image-comment-generation/utils/logger.py | stonyhu/Image-Commenting | eb925a3f99075d8b74c6cabd125f7b9a1f9786d2 | [
"Apache-2.0"
] | null | null | null | image-comment-generation/utils/logger.py | stonyhu/Image-Commenting | eb925a3f99075d8b74c6cabd125f7b9a1f9786d2 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import logging
from datetime import datetime
from utils import draw_caption
class Logger:
def __init__(self, args):
log = logging.getLogger(args.output_dir)
if not log.handlers:
log.setLevel(logging.DEBUG)
fh = logging.FileHandler(os.path.join(args.outp... | 37.557895 | 116 | 0.564742 |
e6db254d2903eac10c83e7b54e1b7c7faec1831f | 2,849 | py | Python | tests/sp_bert_test.py | lhideki/text-vectorian | 24e9a2bc69a5c1a25ce4e1102c5c52e2a5a87a7d | [
"MIT"
] | 10 | 2019-04-24T02:30:59.000Z | 2021-11-15T12:34:40.000Z | tests/sp_bert_test.py | lhideki/text-vectorian | 24e9a2bc69a5c1a25ce4e1102c5c52e2a5a87a7d | [
"MIT"
] | null | null | null | tests/sp_bert_test.py | lhideki/text-vectorian | 24e9a2bc69a5c1a25ce4e1102c5c52e2a5a87a7d | [
"MIT"
] | null | null | null | from text_vectorian import SpBertVectorian
import unittest
from logging import getLogger
import tensorflow as tf
from pprint import pprint
import numpy as np
logger = getLogger(__name__)
logger.setLevel('INFO')
class SpBertVectorianTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
# 以下より各ファイ... | 35.17284 | 75 | 0.681643 |
44455f6e8b72c84a1beaaf66196bc6411fd9b37d | 3,093 | py | Python | python/GafferImageTest/ObjectToImageTest.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | python/GafferImageTest/ObjectToImageTest.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | python/GafferImageTest/ObjectToImageTest.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Red... | 35.551724 | 118 | 0.680569 |
9f5fad11a0809196c36e7065d63324921a6270ec | 10,840 | py | Python | cert_manager/_certificates.py | UMN-PeopleSoft/python-cert_manager | e5b1a93261a75ae8c0ef6830728eb53ba9526b21 | [
"BSD-3-Clause"
] | null | null | null | cert_manager/_certificates.py | UMN-PeopleSoft/python-cert_manager | e5b1a93261a75ae8c0ef6830728eb53ba9526b21 | [
"BSD-3-Clause"
] | null | null | null | cert_manager/_certificates.py | UMN-PeopleSoft/python-cert_manager | e5b1a93261a75ae8c0ef6830728eb53ba9526b21 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Define the cert_manager._certificate.Certificates base class."""
import logging
from requests.exceptions import HTTPError
from ._helpers import Pending
from ._endpoint import Endpoint
LOGGER = logging.getLogger(__name__)
class Certificates(Endpoint):
"""Act as a superclass for all ce... | 43.015873 | 117 | 0.63893 |
2b5b99cc4c12659867dc7b4c6315e1a318066402 | 5,764 | py | Python | tests/test_notes.py | PureDreamer/lms | 4e4c2030f4f51a552e1fbfe82c16dc837e95310c | [
"BSD-3-Clause"
] | null | null | null | tests/test_notes.py | PureDreamer/lms | 4e4c2030f4f51a552e1fbfe82c16dc837e95310c | [
"BSD-3-Clause"
] | null | null | null | tests/test_notes.py | PureDreamer/lms | 4e4c2030f4f51a552e1fbfe82c16dc837e95310c | [
"BSD-3-Clause"
] | null | null | null | from flask import json
from lms.lmsdb.models import Exercise, User
from tests import conftest
class TestNotes:
@staticmethod
def test_notes(
staff_user: User,
student_user: User,
):
staff_user2 = conftest.create_staff_user(index=1)
private_note, _ = conftest.create_note(
... | 35.146341 | 80 | 0.592991 |
0aa342b72c49c2061d0c4b9e02c2b89b7a5969cf | 7,063 | py | Python | networking_brocade/mlx/tests/unit/ml2/drivers/brocade/test_brocade_fi_ni_mechanism_driver.py | greatbn/networking-brocade | 39b65195c279a857f7a35574f08798e39f4774a8 | [
"Apache-2.0"
] | null | null | null | networking_brocade/mlx/tests/unit/ml2/drivers/brocade/test_brocade_fi_ni_mechanism_driver.py | greatbn/networking-brocade | 39b65195c279a857f7a35574f08798e39f4774a8 | [
"Apache-2.0"
] | null | null | null | networking_brocade/mlx/tests/unit/ml2/drivers/brocade/test_brocade_fi_ni_mechanism_driver.py | greatbn/networking-brocade | 39b65195c279a857f7a35574f08798e39f4774a8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Brocade Communications Systems, 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 o... | 31.815315 | 79 | 0.640804 |
93d5a685d140fda09da39fbc357fd2a7071103fb | 315 | py | Python | bin/help.py | popwu/mipyshell | afa001d0aff2ac26d79f2594474579d65268074f | [
"MIT"
] | 31 | 2019-09-19T03:01:51.000Z | 2021-07-21T13:11:30.000Z | bin/help.py | popwu/mipyshell | afa001d0aff2ac26d79f2594474579d65268074f | [
"MIT"
] | 1 | 2020-11-16T17:18:19.000Z | 2020-11-16T17:18:19.000Z | bin/help.py | popwu/mipyshell | afa001d0aff2ac26d79f2594474579d65268074f | [
"MIT"
] | 5 | 2020-10-14T19:50:55.000Z | 2022-02-04T12:23:23.000Z | from sh import get_bins, cmds_integrated
def __main__(args):
print ("Available commands:")
for k in cmds_integrated:
print ("{}".format(k))
print ("")
print ("Available bins:")
pybins, shbins = get_bins()
for k in pybins:
print ("{}".format(k))
for k in shbins:
print ("{}".format(k))
print ("")
| 17.5 | 40 | 0.638095 |
b4f8939af6de19fe36db79e50dc1d7b62095eaa9 | 1,750 | py | Python | krysztalki/workDir/tests/test matrices/test_matrices_like_-4_x00.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | krysztalki/workDir/tests/test matrices/test_matrices_like_-4_x00.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | krysztalki/workDir/tests/test matrices/test_matrices_like_-4_x00.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_m4_x00:
def test_matrix_m4_x00(self):
expected = Point([ -x, z, -y, 1])
calculated = Point.calculate(... | 33.653846 | 63 | 0.646857 |
0d97e09857147e9c0c989d2b107ea4b9e0ff8b00 | 2,146 | py | Python | venv/lib/python3.8/site-packages/cloudinary/search.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 199 | 2015-01-11T14:46:06.000Z | 2022-03-22T15:37:23.000Z | venv/lib/python3.8/site-packages/cloudinary/search.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 132 | 2015-01-21T08:13:27.000Z | 2022-03-04T14:36:44.000Z | venv/lib/python3.8/site-packages/cloudinary/search.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 117 | 2015-02-04T04:23:59.000Z | 2022-03-19T11:30:34.000Z | import json
from cloudinary.api_client.call_api import call_json_api
from cloudinary.utils import unique
class Search:
_KEYS_WITH_UNIQUE_VALUES = {
'sort_by': lambda x: next(iter(x)),
'aggregate': None,
'with_field': None,
}
"""Build and execute a search query."""
def __init_... | 28.613333 | 100 | 0.599254 |
83516f65f9dd7d0b81f40cb0a4017573994a87e6 | 7,538 | py | Python | Brain.py | alexmartinnnnnn/Mr_Runner_Servo | 3040b1dafc6fa3f453bde700f8087bb7c1cdc5f2 | [
"Apache-2.0"
] | 2 | 2019-07-05T04:03:56.000Z | 2020-03-04T12:36:38.000Z | Brain.py | alexmartinnnnnn/Mr_Runner_Servo | 3040b1dafc6fa3f453bde700f8087bb7c1cdc5f2 | [
"Apache-2.0"
] | null | null | null | Brain.py | alexmartinnnnnn/Mr_Runner_Servo | 3040b1dafc6fa3f453bde700f8087bb7c1cdc5f2 | [
"Apache-2.0"
] | 1 | 2020-11-19T17:59:45.000Z | 2020-11-19T17:59:45.000Z | #!/usr/bin/env python
#This is a program which allows the user to modify the parameters of 8 sine waves with a graphical interface. These
#parameters are then formatted and written to the specified serial port.
from Tkinter import *
import serial
import time
import math
##############################################... | 34.108597 | 167 | 0.565402 |
29ee464627c588a4e2d2477c3e87f10f8315ddaa | 1,027 | py | Python | tests/test_strange.py | iluxonchik/the-chronic | 4dd41ea1a96e4c5cb1741de02d55cf09b2e78979 | [
"MIT"
] | null | null | null | tests/test_strange.py | iluxonchik/the-chronic | 4dd41ea1a96e4c5cb1741de02d55cf09b2e78979 | [
"MIT"
] | null | null | null | tests/test_strange.py | iluxonchik/the-chronic | 4dd41ea1a96e4c5cb1741de02d55cf09b2e78979 | [
"MIT"
] | null | null | null | import unittest
from thechronic.strange import Strange
class StrangeTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_basic(self):
srange = Strange(1, 10)
self.assertEqual(len(list(srange)), 9)
srange = list(Strange(1, 10))
... | 24.452381 | 59 | 0.561831 |
af1f495352364c19a12e1a1e62b3b4d028c803f2 | 1,015 | py | Python | benchmarks/benchmarks/blas_lapack.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 9,095 | 2015-01-02T18:24:23.000Z | 2022-03-31T20:35:31.000Z | benchmarks/benchmarks/blas_lapack.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 11,500 | 2015-01-01T01:15:30.000Z | 2022-03-31T23:07:35.000Z | benchmarks/benchmarks/blas_lapack.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 5,838 | 2015-01-05T11:56:42.000Z | 2022-03-31T23:21:19.000Z | import numpy as np
from .common import Benchmark, safe_import
with safe_import():
import scipy.linalg.blas as bla
class GetBlasLapackFuncs(Benchmark):
"""
Test the speed of grabbing the correct BLAS/LAPACK routine flavor.
In particular, upon receiving strange dtype arrays the results shouldn't
d... | 30.757576 | 87 | 0.62069 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.