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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d2350bf68fb1716e05a3629fa53141d61d80b2b5 | 13,137 | py | Python | lib/utils/boxes.py | zhaowujie/EFPN-pytorch | 5c8ad3d0439c0168a34f6ec619b8b655813d3e2a | [
"MIT"
] | 2 | 2020-12-08T07:18:52.000Z | 2022-03-06T10:54:31.000Z | lib/utils/boxes.py | zhaowujie/EFPN-pytorch | 5c8ad3d0439c0168a34f6ec619b8b655813d3e2a | [
"MIT"
] | null | null | null | lib/utils/boxes.py | zhaowujie/EFPN-pytorch | 5c8ad3d0439c0168a34f6ec619b8b655813d3e2a | [
"MIT"
] | 2 | 2020-07-13T09:28:52.000Z | 2020-11-15T02:19:25.000Z | # Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 37.968208 | 86 | 0.61696 |
273a749254a7e42b705a3822e410752c4368fa87 | 19,876 | py | Python | rebuild_test.py | josh-mckenzie/apache-cassandra-dtest | da6ad8317e18ebaa5e8b428df79d1da086a19dd9 | [
"Apache-2.0"
] | null | null | null | rebuild_test.py | josh-mckenzie/apache-cassandra-dtest | da6ad8317e18ebaa5e8b428df79d1da086a19dd9 | [
"Apache-2.0"
] | null | null | null | rebuild_test.py | josh-mckenzie/apache-cassandra-dtest | da6ad8317e18ebaa5e8b428df79d1da086a19dd9 | [
"Apache-2.0"
] | null | null | null | import time
from threading import Thread
from cassandra import ConsistencyLevel
from ccmlib.node import ToolError
from dtest import Tester, debug, create_ks, create_cf
from tools.data import insert_c1c2, query_c1c2
from tools.decorators import since, no_vnodes
class TestRebuild(Tester):
ignore_log_patterns = (
... | 44.968326 | 190 | 0.601781 |
fa6521023a6f25b1939c7c450556b9c28247b9b6 | 4,138 | py | Python | cogs_linkyaicore.py | moonjail/BotlerIsland | a38d97bc35d99ffbece2ac04ef1b956f683921ba | [
"MIT"
] | 1 | 2021-04-15T12:27:03.000Z | 2021-04-15T12:27:03.000Z | cogs_linkyaicore.py | moonjail/BotlerIsland | a38d97bc35d99ffbece2ac04ef1b956f683921ba | [
"MIT"
] | 1 | 2021-04-13T16:24:13.000Z | 2021-04-13T16:24:13.000Z | cogs_linkyaicore.py | moonjail/BotlerIsland | a38d97bc35d99ffbece2ac04ef1b956f683921ba | [
"MIT"
] | 4 | 2021-04-13T16:04:08.000Z | 2021-04-28T12:19:30.000Z | # The LinkyBot Cog.
import os
from random import randrange, choices, sample
from itertools import islice
import discord as dc
from discord.ext import commands, tasks
from chainproofrhg import ChainProofRHG as RHG
from cogs_textbanks import url_bank, query_bank, response_bank
from bot_common import bot, CONST_ADMINS,... | 35.672414 | 85 | 0.582649 |
b59ff38ad3d40f81c08babd05182ab9b588f5731 | 3,545 | py | Python | tests/test_password_set.py | meals-app/django-graphql-auth | f6136a14e2ff4c6cb21ab25ed66b5832b03d2fd4 | [
"MIT"
] | 290 | 2020-01-15T17:47:09.000Z | 2022-03-28T19:24:16.000Z | tests/test_password_set.py | meals-app/django-graphql-auth | f6136a14e2ff4c6cb21ab25ed66b5832b03d2fd4 | [
"MIT"
] | 136 | 2020-01-31T16:47:30.000Z | 2022-03-29T13:17:22.000Z | tests/test_password_set.py | meals-app/django-graphql-auth | f6136a14e2ff4c6cb21ab25ed66b5832b03d2fd4 | [
"MIT"
] | 85 | 2020-02-07T12:48:26.000Z | 2022-03-24T08:56:59.000Z | from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_payload
class PasswordSetTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
email=... | 29.789916 | 80 | 0.53653 |
79e7b5f6cdb003c0dada8d3c9e96541c5733e57c | 15,349 | py | Python | MinkowskiEngine/SparseTensor.py | euivmar/MinkowskiEngine | 123f12de1158fe554e41a3dfe96bb2c211cda8e4 | [
"MIT"
] | 1 | 2019-12-12T07:16:05.000Z | 2019-12-12T07:16:05.000Z | MinkowskiEngine/SparseTensor.py | nigamapurv/Minkowski_planview | 1c887bf0c54b9bdd632b9249cac71b275be8b2c2 | [
"MIT"
] | null | null | null | MinkowskiEngine/SparseTensor.py | nigamapurv/Minkowski_planview | 1c887bf0c54b9bdd632b9249cac71b275be8b2c2 | [
"MIT"
] | null | null | null | # Copyright (c) Chris Choy (chrischoy@ai.stanford.edu).
#
# 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, modify, ... | 37.345499 | 88 | 0.606359 |
1043309952009c1a5888e1e934d88b646f46e07b | 2,397 | py | Python | tests/python/test_stat1.py | hustbeef/bcc | 63c21ea1e25dbe89ab2dcc8743dbd658469e7a3a | [
"Apache-2.0"
] | 1 | 2021-01-30T18:25:18.000Z | 2021-01-30T18:25:18.000Z | tests/python/test_stat1.py | msuslu/bcc | e17c4f7324d8fc5cc24ba8ee1db451666cd7ced3 | [
"Apache-2.0"
] | 1 | 2021-01-04T21:44:14.000Z | 2021-01-04T21:44:14.000Z | tests/python/test_stat1.py | msuslu/bcc | e17c4f7324d8fc5cc24ba8ee1db451666cd7ced3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# test program to count the packets sent to a device in a .5
# second period
from ctypes import c_uint, c_ulong, Structure
from netaddr import IPAddress
from bcc import BPF
from subprocess import chec... | 32.835616 | 90 | 0.604923 |
3ff0be35757df3d6bd5c1377b9a544487fd7f71f | 2,178 | py | Python | conf.py | FlorentPoinsaut/documentation | ce0c711e540f4b8c0d0152de75e702c119e1515d | [
"CC-BY-3.0"
] | 354 | 2016-06-11T16:05:03.000Z | 2022-03-21T05:17:27.000Z | conf.py | FlorentPoinsaut/documentation | ce0c711e540f4b8c0d0152de75e702c119e1515d | [
"CC-BY-3.0"
] | 1,893 | 2016-06-12T11:46:39.000Z | 2022-03-29T13:00:26.000Z | conf.py | FlorentPoinsaut/documentation | ce0c711e540f4b8c0d0152de75e702c119e1515d | [
"CC-BY-3.0"
] | 1,291 | 2016-06-12T19:47:27.000Z | 2022-03-31T20:32:34.000Z | # global configuration for every documentation added at the end
import os, sys, datetime
import sphinx_rtd_theme
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath(dir_path + '/_ext'))
now = datetime.datetime.now()
extensions = []
# General information about the project.
copy... | 31.114286 | 109 | 0.735996 |
418f660529f0e9c35660ac31e5365bdceb4b3829 | 4,042 | py | Python | cirq/devices/device.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | 2 | 2019-04-02T10:22:21.000Z | 2019-06-19T04:54:04.000Z | cirq/devices/device.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | 4 | 2019-03-27T22:51:42.000Z | 2019-04-03T22:41:36.000Z | cirq/devices/device.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | 1 | 2019-03-27T21:30:44.000Z | 2019-03-27T21:30:44.000Z | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 31.578125 | 79 | 0.635329 |
987cb5dd9327842e187c98377e0f87ee0c511279 | 38,961 | py | Python | upvote/gae/modules/santa_api/sync.py | cclauss/upvote | 9d526fec72690cde1575dbd32dacf68cbbab81d1 | [
"Apache-2.0"
] | null | null | null | upvote/gae/modules/santa_api/sync.py | cclauss/upvote | 9d526fec72690cde1575dbd32dacf68cbbab81d1 | [
"Apache-2.0"
] | null | null | null | upvote/gae/modules/santa_api/sync.py | cclauss/upvote | 9d526fec72690cde1575dbd32dacf68cbbab81d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.156784 | 91 | 0.72416 |
9c26cf2339aa7a4ef06216de7bd0bf3332068b1a | 948 | py | Python | api/src/error_report/models.py | Noahffiliation/corpus-christi | c69ec88784de7d2e5acde3012926f307b43e38b3 | [
"MIT"
] | 35 | 2018-11-29T20:06:52.000Z | 2021-04-12T19:01:42.000Z | api/src/error_report/models.py | Noahffiliation/corpus-christi | c69ec88784de7d2e5acde3012926f307b43e38b3 | [
"MIT"
] | 529 | 2018-12-31T23:51:25.000Z | 2022-02-26T10:42:29.000Z | api/src/error_report/models.py | Noahffiliation/corpus-christi | c69ec88784de7d2e5acde3012926f307b43e38b3 | [
"MIT"
] | 10 | 2018-12-04T16:17:00.000Z | 2021-04-07T00:47:52.000Z | from marshmallow import Schema, fields
from marshmallow.validate import Range, Length
from sqlalchemy import Column, Integer, Boolean, DateTime
from ..db import Base
from ..shared.models import StringTypes
# ---- Error-report
class ErrorReport(Base):
__tablename__ = 'error_report'
id = Column(Integer, prim... | 29.625 | 77 | 0.728903 |
71b5a720747ad293c556f5cf5488a2dd5db26a6a | 26,735 | py | Python | mlflow/store/file_store.py | jke-zq/mlflow | 127c4f427b77eef202ce2c8cdaba9ae373aee314 | [
"Apache-2.0"
] | null | null | null | mlflow/store/file_store.py | jke-zq/mlflow | 127c4f427b77eef202ce2c8cdaba9ae373aee314 | [
"Apache-2.0"
] | null | null | null | mlflow/store/file_store.py | jke-zq/mlflow | 127c4f427b77eef202ce2c8cdaba9ae373aee314 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import uuid
import six
from mlflow.entities import Experiment, Metric, Param, Run, RunData, RunInfo, RunStatus, RunTag, \
ViewType
from mlflow.entities.lifecycle_stage import LifecycleStage
from mlflow.entities.run_info import check_run_is_active, check_run_is_dele... | 47.655971 | 100 | 0.657677 |
b31b4971e87caad1bd14df8bbfa71e4b2f5b49da | 40,843 | py | Python | dobby/dobby.py | jordan9001/dobby2 | 9adc9923ac4d80099495a90087076a4d93759be8 | [
"MIT"
] | 59 | 2020-12-03T19:45:15.000Z | 2022-01-15T06:56:30.000Z | dobby/dobby.py | jordan9001/dobby2 | 9adc9923ac4d80099495a90087076a4d93759be8 | [
"MIT"
] | null | null | null | dobby/dobby.py | jordan9001/dobby2 | 9adc9923ac4d80099495a90087076a4d93759be8 | [
"MIT"
] | 6 | 2020-12-03T20:44:07.000Z | 2021-10-21T13:58:18.000Z | from .dobby_const import *
from .dobby_types import *
import os
import lief
import json
import struct
import string
import pickle
class Dobby:
"""
This Dobby class holds only global state
All real state is held by the providers themselves
And transfered in snapshots
"""
def __init__(self):
... | 33.532841 | 146 | 0.55941 |
4ade5ea24d4dd4911343aa1618650880f3b71b2d | 5,816 | py | Python | vanir/storage/kernels.py | VanirLab/VOS | e6cb3e4e391e583e98d548292b5f272320d38cc4 | [
"MIT"
] | null | null | null | vanir/storage/kernels.py | VanirLab/VOS | e6cb3e4e391e583e98d548292b5f272320d38cc4 | [
"MIT"
] | null | null | null | vanir/storage/kernels.py | VanirLab/VOS | e6cb3e4e391e583e98d548292b5f272320d38cc4 | [
"MIT"
] | null | null | null | ''' This module contains different VOS kernels. '''
import os
import vanir.exc
import vanir.storage
from vanir.storage import Pool, StoragePoolException, Volume
class LinuxModules(Volume):
''' A volume representing a ro linux kernel '''
def __init__(self, target_dir, kernel_version, **kwargs):
... | 28.23301 | 81 | 0.57445 |
63d05c1b3e535bfe417a1a805527ae695c6e6f6e | 644 | py | Python | python/tests/test_integration.py | anyant/shopant-sdk | ee42ee6cf176a10ff964eb4d4973f4af86e63c6f | [
"MIT"
] | 2 | 2020-10-08T13:29:20.000Z | 2021-05-25T05:53:37.000Z | python/tests/test_integration.py | anyant/shopant-sdk | ee42ee6cf176a10ff964eb4d4973f4af86e63c6f | [
"MIT"
] | null | null | null | python/tests/test_integration.py | anyant/shopant-sdk | ee42ee6cf176a10ff964eb4d4973f4af86e63c6f | [
"MIT"
] | 1 | 2022-02-12T10:54:34.000Z | 2022-02-12T10:54:34.000Z | import pytest
from shopant_sdk import ShopAntServer, ShopAntServerError
LOCAL_URL = 'http://localhost:6887/api/v1/integration'
def _new_server():
return ShopAntServer(1, '8a0ae1973760bb4415a194453a701a05', url=LOCAL_URL)
def test_integration():
server = _new_server()
data = server.call('product.get')
... | 23.851852 | 78 | 0.709627 |
34d4d9957c1e551c821a5960720c437b49e0881d | 2,123 | py | Python | src/scs_dev/cmd/cmd_socket_sender.py | south-coast-science/scs_dev | b746adda020498b911cb92f28d4f07b14df996a2 | [
"MIT"
] | 2 | 2017-04-24T14:58:28.000Z | 2020-05-27T08:53:46.000Z | src/scs_dev/cmd/cmd_socket_sender.py | south-coast-science/scs_dev | b746adda020498b911cb92f28d4f07b14df996a2 | [
"MIT"
] | 1 | 2020-07-13T14:33:59.000Z | 2021-03-27T08:52:04.000Z | src/scs_dev/cmd/cmd_socket_sender.py | south-coast-science/scs_dev | b746adda020498b911cb92f28d4f07b14df996a2 | [
"MIT"
] | 1 | 2018-08-24T09:55:01.000Z | 2018-08-24T09:55:01.000Z | """
Created on 13 Jul 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import optparse
# --------------------------------------------------------------------------------------------------------------------
class CmdSocketSender(object):
"""unix command line handler"""
def __init__(self)... | 28.689189 | 118 | 0.447009 |
4dd284f9efc00b8bf8832f695f7e06df35267b8c | 1,024 | py | Python | SchemaCollaboration/comments/views.py | kant/schema-collaboration | 9233141dc14aa3dccf41dbdc17c8d25f55e5c640 | [
"MIT"
] | null | null | null | SchemaCollaboration/comments/views.py | kant/schema-collaboration | 9233141dc14aa3dccf41dbdc17c8d25f55e5c640 | [
"MIT"
] | null | null | null | SchemaCollaboration/comments/views.py | kant/schema-collaboration | 9233141dc14aa3dccf41dbdc17c8d25f55e5c640 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.shortcuts import redirect, render
from django.urls import reverse
from comments.forms import CommentForm
from core.models import Person
def process_post_add_comment(request, context,
datapackage, force_anonymous_user,
... | 34.133333 | 95 | 0.683594 |
fa1700c851a6c4298af0c0cc20d8dd45be7ff9e7 | 3,079 | py | Python | src/xilinx/tools/bittool/rle.py | viccro/andthebitches | f19624be074d2ab10c89786e75daef0ef4e48eb9 | [
"MIT"
] | 5 | 2016-02-01T06:43:17.000Z | 2020-03-04T02:16:16.000Z | src/xilinx/tools/bittool/rle.py | sixtwoseventy/joyos | 94593ddabf7e6b53b568b3b4a04ca9ed6df123f0 | [
"MIT"
] | null | null | null | src/xilinx/tools/bittool/rle.py | sixtwoseventy/joyos | 94593ddabf7e6b53b568b3b4a04ca9ed6df123f0 | [
"MIT"
] | 2 | 2016-01-20T04:29:35.000Z | 2020-10-12T23:20:02.000Z | def rleEncode(raw):
p = 0
enc = []
while (p<len(raw)):
j = p
curByte = raw[p]
while (raw[j]==curByte):
if ((j+1)==len(raw)):
j+=1
break;
if (j-p)>=63:
break;
j+=1
j-=p
... | 24.054688 | 55 | 0.388438 |
236ae1b01b38a370ca591186d98838b55166a0f0 | 54,620 | bzl | Python | third_party/gpus/cuda_configure.bzl | TomHeaven/tensorflow | 1b22e637af20dcf2c48c659c85b5f9e62a282cd6 | [
"Apache-2.0"
] | 5 | 2020-05-26T00:39:14.000Z | 2021-11-08T11:35:43.000Z | third_party/gpus/cuda_configure.bzl | TomHeaven/tensorflow | 1b22e637af20dcf2c48c659c85b5f9e62a282cd6 | [
"Apache-2.0"
] | null | null | null | third_party/gpus/cuda_configure.bzl | TomHeaven/tensorflow | 1b22e637af20dcf2c48c659c85b5f9e62a282cd6 | [
"Apache-2.0"
] | 1 | 2021-09-03T03:08:44.000Z | 2021-09-03T03:08:44.000Z | """Repository rule for CUDA autoconfiguration.
`cuda_configure` depends on the following environment variables:
* `TF_NEED_CUDA`: Whether to enable building with CUDA.
* `GCC_HOST_COMPILER_PATH`: The GCC host compiler path
* `TF_CUDA_CLANG`: Whether to use clang as a cuda compiler.
* `CLANG_CUDA_COMPILER_PATH... | 36.855601 | 125 | 0.637477 |
c49f291685b0312481e6349d438b73b36d5ed712 | 1,274 | py | Python | tests/test_characters.py | TheYahya/persiantools | e14d510d6d952e60d796a9bfbde71fa605bb659f | [
"MIT"
] | 1 | 2020-05-09T11:51:40.000Z | 2020-05-09T11:51:40.000Z | tests/test_characters.py | TheYahya/persiantools | e14d510d6d952e60d796a9bfbde71fa605bb659f | [
"MIT"
] | null | null | null | tests/test_characters.py | TheYahya/persiantools | e14d510d6d952e60d796a9bfbde71fa605bb659f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from unittest import TestCase
from nose import tools
from persiantools import characters
from persiantools import digits
class TestDigits(TestCase):
def test_ar_to_fa(self):
self.assertEqual(characters.ar_to_fa("السلام عليكم"), "السلام علیکم")
self.assertEqual(characters.... | 31.85 | 109 | 0.664835 |
5a498f833f79c855aa79914bb0b85a300cd30159 | 1,228 | py | Python | util/model.py | voschezang/Data-Mining | 0762df1d9a63f81d6f44d8a35cc61802baad4c37 | [
"MIT"
] | null | null | null | util/model.py | voschezang/Data-Mining | 0762df1d9a63f81d6f44d8a35cc61802baad4c37 | [
"MIT"
] | null | null | null | util/model.py | voschezang/Data-Mining | 0762df1d9a63f81d6f44d8a35cc61802baad4c37 | [
"MIT"
] | null | null | null | from sklearn.model_selection import cross_val_score
import numpy as np
from util.string import print_primary, print_secondary
np.random.seed(123)
def cross_validation(model_func, x_train, y_train, cv_folds, k=None,
results=None, scoring='explained_variance', v=1):
# scoring: neg_mean_squared_... | 36.117647 | 77 | 0.631922 |
875ec5ce3cae9334d94ddfed71316c5413305752 | 14,961 | py | Python | bigml/tests/test_06_batch_predictions.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:38.000Z | 2021-08-30T20:18:38.000Z | bigml/tests/test_06_batch_predictions.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | null | null | null | bigml/tests/test_06_batch_predictions.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:40.000Z | 2021-08-30T20:18:40.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015-2019 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 56.244361 | 189 | 0.63191 |
c86d059c4e235783d7c501e4444dbff3b452af75 | 5,042 | py | Python | examples/multi_pred/dti_dg/domainbed/datasets.py | Shicheng-Guo/TDC | 36e2863aca5abe3147e34f59d20fd77112945242 | [
"MIT"
] | 577 | 2020-11-17T01:09:15.000Z | 2022-03-31T22:45:34.000Z | examples/multi_pred/dti_dg/domainbed/datasets.py | Shicheng-Guo/TDC | 36e2863aca5abe3147e34f59d20fd77112945242 | [
"MIT"
] | 70 | 2020-11-18T09:35:33.000Z | 2022-03-25T11:28:38.000Z | examples/multi_pred/dti_dg/domainbed/datasets.py | Shicheng-Guo/TDC | 36e2863aca5abe3147e34f59d20fd77112945242 | [
"MIT"
] | 106 | 2020-11-17T01:47:02.000Z | 2022-03-25T03:34:46.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Adapted by TDC.
import os
import torch
import numpy as np
import pandas as pd
import pickle
def get_dataset_class(dataset_name):
"""Return the dataset class with the given name."""
if dataset_name not in globals():
raise NotImple... | 34.772414 | 92 | 0.592622 |
3cd10fcbff8acd9437e3180202c92c6d0f5b526f | 485 | py | Python | grappelli/urls.py | theatlantic/django-grappelli-old | f4a5f10a2e68024873556d4cc249cf0351eb1335 | [
"BSD-3-Clause"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | base/site-packages/grappelli/urls.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | null | null | null | base/site-packages/grappelli/urls.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z | # coding: utf-8
# DJANGO IMPORTS
from django.conf.urls.defaults import *
from django.conf import settings
urlpatterns = patterns('',
# FOREIGNKEY & GENERIC LOOKUP
url(r'^lookup/related/$', 'grappelli.views.related.related_lookup', name="grp_related_lookup"),
url(r'^lookup/m2m/$', 'grappelli.views.re... | 30.3125 | 114 | 0.721649 |
f7381597c07096508b011a0a810cce6703d381a9 | 7,724 | py | Python | main.py | TheArcher1958/GrubGuardianBot-XP | 8c3381919956a1060632847015ff8dc91f602dab | [
"MIT"
] | null | null | null | main.py | TheArcher1958/GrubGuardianBot-XP | 8c3381919956a1060632847015ff8dc91f602dab | [
"MIT"
] | null | null | null | main.py | TheArcher1958/GrubGuardianBot-XP | 8c3381919956a1060632847015ff8dc91f602dab | [
"MIT"
] | null | null | null | import tkinter as tk
import time
import threading
global autoXP, manualXP, roundTitle, button
from google.cloud import vision
import re
import pyautogui
global autoXPIsOn
autoXPIsOn = False
def getRoundsToPlay():
pyautogui.screenshot('energyCount.png', region=(x + 286, y + 430, 45, 32)) # Get a s... | 36.780952 | 181 | 0.631668 |
31591f10e9e21ef3dc56355e0ec34e520cae813f | 511 | py | Python | apps/medicalcontrol/migrations/0004_auto_20170816_0346.py | claudioDcv/Vetadmin | 2b5cf78bc7ad58000cedaf2474191d921e61745c | [
"MIT"
] | 1 | 2017-03-18T15:07:00.000Z | 2017-03-18T15:07:00.000Z | apps/medicalcontrol/migrations/0004_auto_20170816_0346.py | claudioDcv/Vetadmin | 2b5cf78bc7ad58000cedaf2474191d921e61745c | [
"MIT"
] | null | null | null | apps/medicalcontrol/migrations/0004_auto_20170816_0346.py | claudioDcv/Vetadmin | 2b5cf78bc7ad58000cedaf2474191d921e61745c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-16 03:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('medicalcontrol', '0003_medicalcontrol_supplies'),
]
operations = [
migratio... | 24.333333 | 88 | 0.649706 |
7dd0546775a3ed428b6374fbf8cf4eb9b2730de3 | 26,274 | py | Python | tensorflow/contrib/learn/python/learn/estimators/linear.py | yxiong/tensorflow | f71cc62282bf2e066f9ebd08cf3f605fc98c6e41 | [
"Apache-2.0"
] | 6 | 2016-09-07T18:38:41.000Z | 2020-01-12T23:01:03.000Z | tensorflow/contrib/learn/python/learn/estimators/linear.py | yxiong/tensorflow | f71cc62282bf2e066f9ebd08cf3f605fc98c6e41 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/linear.py | yxiong/tensorflow | f71cc62282bf2e066f9ebd08cf3f605fc98c6e41 | [
"Apache-2.0"
] | 8 | 2017-06-08T09:46:06.000Z | 2021-06-20T14:03:19.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.098214 | 82 | 0.698828 |
36a3f5895ab6f46975e4f7434cbc359f9f575042 | 96 | py | Python | data/studio21_generated/interview/0156/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0156/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0156/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | class Solution:
def shortestCommonSupersequence(self, str1: str, str2: str) -> str:
| 32 | 71 | 0.666667 |
024ace06034b472d0c169dc3dc5654ea316c09f3 | 2,151 | py | Python | api/integrations/basecamp/zulip_basecamp_config.py | enterstudio/zulip | f6f8f1fe36ac7d82bc0a5effc00a47e460f0b325 | [
"Apache-2.0"
] | null | null | null | api/integrations/basecamp/zulip_basecamp_config.py | enterstudio/zulip | f6f8f1fe36ac7d82bc0a5effc00a47e460f0b325 | [
"Apache-2.0"
] | null | null | null | api/integrations/basecamp/zulip_basecamp_config.py | enterstudio/zulip | f6f8f1fe36ac7d82bc0a5effc00a47e460f0b325 | [
"Apache-2.0"
] | 1 | 2017-03-19T14:40:16.000Z | 2017-03-19T14:40:16.000Z | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# 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 right... | 39.833333 | 79 | 0.773129 |
658abc0ca8b61837941f9b7a112055d192c950cb | 129 | py | Python | tests/test_s3.py | SimonHollands/crowdfactor3 | efc4721e7884c23d96f8004d3e0447a2d24d932a | [
"MIT"
] | 2 | 2019-10-31T22:17:57.000Z | 2021-09-19T20:11:25.000Z | tests/test_s3.py | SimonHollands/crowdfactor3 | efc4721e7884c23d96f8004d3e0447a2d24d932a | [
"MIT"
] | 6 | 2019-10-31T20:09:22.000Z | 2022-02-10T01:05:29.000Z | tests/test_s3.py | SimonHollands/crowdfactor3 | efc4721e7884c23d96f8004d3e0447a2d24d932a | [
"MIT"
] | 1 | 2022-01-28T21:24:30.000Z | 2022-01-28T21:24:30.000Z | import pytest
def test_s3():
from s3pushpull2 import s3pushpull
s3=s3pushpull()
s3.upload_aws('api.py','S3:/api.py') | 21.5 | 40 | 0.689922 |
3a878b26155fd8108bd5a091e36bd350b5197ba2 | 2,683 | py | Python | total.py | makino-makino/taiho-zentai-server | 2e71f6ab5b2cc154f91259465c003055d4ede3de | [
"MIT"
] | null | null | null | total.py | makino-makino/taiho-zentai-server | 2e71f6ab5b2cc154f91259465c003055d4ede3de | [
"MIT"
] | null | null | null | total.py | makino-makino/taiho-zentai-server | 2e71f6ab5b2cc154f91259465c003055d4ede3de | [
"MIT"
] | null | null | null | import os
import io
import time
import json
import numpy as np
import cv2
import base64
import hashlib
import glob
import keras
from keras.models import load_model
import numpy as np
import grpc
from keras.preprocessing.image import img_to_array, load_img
import pickle
from keras.utils import to_categorical, np_utils
... | 28.242105 | 98 | 0.741334 |
603c9940d12ad0e2c6c88ec01372c9828abce640 | 1,225 | py | Python | tests/test_iam_cli.py | hall-lab/cloud-polices | 85075d909e6450c5ae21efb566ab9075f8fe8b16 | [
"MIT"
] | null | null | null | tests/test_iam_cli.py | hall-lab/cloud-polices | 85075d909e6450c5ae21efb566ab9075f8fe8b16 | [
"MIT"
] | null | null | null | tests/test_iam_cli.py | hall-lab/cloud-polices | 85075d909e6450c5ae21efb566ab9075f8fe8b16 | [
"MIT"
] | null | null | null | import re, subprocess, unittest
from click.testing import CliRunner
from mock import patch
from hlcloud.iam_cli import cli, list_cmd
import hlcloud.iam
class IamCliTest(unittest.TestCase):
def test_cli(self):
runner = CliRunner()
result = runner.invoke(cli, [])
self.assertEqual(result.exi... | 27.222222 | 57 | 0.616327 |
a653ca4b91a5d242207c5713285d507b36db3a0e | 334 | py | Python | examples/charge.py | timvisher/stripe-python | ae953fd0aa531f5b500e5e86eee5859df95a255d | [
"MIT"
] | 2 | 2020-12-05T09:02:14.000Z | 2021-03-28T17:23:20.000Z | examples/charge.py | timvisher/stripe-python | ae953fd0aa531f5b500e5e86eee5859df95a255d | [
"MIT"
] | null | null | null | examples/charge.py | timvisher/stripe-python | ae953fd0aa531f5b500e5e86eee5859df95a255d | [
"MIT"
] | 2 | 2019-12-19T10:25:38.000Z | 2020-01-03T08:54:20.000Z | from __future__ import absolute_import, division, print_function
import os
import stripe
stripe.api_key = os.environ.get('STRIPE_SECRET_KEY')
print("Attempting charge...")
resp = stripe.Charge.create(
amount=200,
currency='usd',
card='tok_visa',
description='customer@gmail.com'
)
print('Success: ... | 16.7 | 64 | 0.712575 |
76df923bc05c85fdc186defd81a39191457ec7d5 | 4,399 | py | Python | config_manager/eucalyptus/topology/__init__.py | tbeckham/DeploymentManager | c1b2ba47d1732859ff458eb934da671fb0dad37f | [
"Apache-2.0"
] | null | null | null | config_manager/eucalyptus/topology/__init__.py | tbeckham/DeploymentManager | c1b2ba47d1732859ff458eb934da671fb0dad37f | [
"Apache-2.0"
] | null | null | null | config_manager/eucalyptus/topology/__init__.py | tbeckham/DeploymentManager | c1b2ba47d1732859ff458eb934da671fb0dad37f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus 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 ... | 44.434343 | 94 | 0.65424 |
22c73aef0a4123c02fffa0b89e0d1d41747b0180 | 2,793 | py | Python | cbev/data_process/kitti_dataloader.py | wangx1996/CenterBEV | 5c5f79bf4a14f545f6b5da2158af4fa93d676afc | [
"Apache-2.0"
] | null | null | null | cbev/data_process/kitti_dataloader.py | wangx1996/CenterBEV | 5c5f79bf4a14f545f6b5da2158af4fa93d676afc | [
"Apache-2.0"
] | null | null | null | cbev/data_process/kitti_dataloader.py | wangx1996/CenterBEV | 5c5f79bf4a14f545f6b5da2158af4fa93d676afc | [
"Apache-2.0"
] | null | null | null | """
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: Nguyen Mau Dung
# DoC: 2020.08.17
# email: nguyenmaudung93.kstn@gmail.com
-----------------------------------------------------------------------------------
# Description: This script for creating ... | 41.073529 | 120 | 0.689939 |
81d94f3afe334963527c319f159ec86934c3179c | 6,857 | py | Python | advanced_zoom.py | willplayforfun/MetricsViewer | 99534d3ec3e050f7f5e045e4a89e3ce4b75b9659 | [
"MIT"
] | null | null | null | advanced_zoom.py | willplayforfun/MetricsViewer | 99534d3ec3e050f7f5e045e4a89e3ce4b75b9659 | [
"MIT"
] | null | null | null | advanced_zoom.py | willplayforfun/MetricsViewer | 99534d3ec3e050f7f5e045e4a89e3ce4b75b9659 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Advanced zoom example. Like in Google Maps.
# It zooms only a tile, but not the whole image. So the zoomed tile occupies
# constant memory and not crams it with a huge resized image for the large zooms.
import random
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
... | 44.816993 | 89 | 0.674785 |
b8f23562de23dca5809eec4fe5f9760804d37d42 | 6,007 | py | Python | pysnmp/LANADPTER-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/LANADPTER-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/LANADPTER-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module LANADPTER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LANADPTER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:54:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 101.813559 | 622 | 0.7428 |
d45b33aa4ace9b0d416e9f1cf420674ee5100b44 | 7,613 | py | Python | tests/test_models/test_backbones/test_shufflenet_v1.py | QiangZiBro/mmclassification | 6a0a76af0c176f381c8534097333f37a9e65a6bf | [
"Apache-2.0"
] | 1 | 2021-08-23T06:54:43.000Z | 2021-08-23T06:54:43.000Z | tests/test_models/test_backbones/test_shufflenet_v1.py | QiangZiBro/mmclassification | 6a0a76af0c176f381c8534097333f37a9e65a6bf | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_backbones/test_shufflenet_v1.py | QiangZiBro/mmclassification | 6a0a76af0c176f381c8534097333f37a9e65a6bf | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from torch.nn.modules import GroupNorm
from torch.nn.modules.batchnorm import _BatchNorm
from mmcls.models.backbones import ShuffleNetV1
from mmcls.models.backbones.shufflenet_v1 import ShuffleUnit
def is_block(modules):
"""Check if is Re... | 30.947154 | 78 | 0.628136 |
7246bbfeb82ba260f66cb154f4e694b7fc076258 | 503 | py | Python | eyesore/decision_graph/nodes/read_eval_loop.py | twizmwazin/hacrs | 3c9386b0fa5f5ea6b93b2bc8b3c4eed6abceec6a | [
"BSD-2-Clause"
] | 2 | 2019-11-07T02:55:40.000Z | 2021-12-30T01:37:43.000Z | eyesore/decision_graph/nodes/read_eval_loop.py | twizmwazin/hacrs | 3c9386b0fa5f5ea6b93b2bc8b3c4eed6abceec6a | [
"BSD-2-Clause"
] | null | null | null | eyesore/decision_graph/nodes/read_eval_loop.py | twizmwazin/hacrs | 3c9386b0fa5f5ea6b93b2bc8b3c4eed6abceec6a | [
"BSD-2-Clause"
] | 2 | 2019-09-27T12:01:50.000Z | 2019-10-09T21:39:52.000Z | from .. import register_node_type
from .decision_base import DecisionBaseNode
class ReadEvalLoopNode(DecisionBaseNode):
def __init__(self, taken_succs=(), unsat_succs=(), actions_constraints_pairs=()):
super(ReadEvalLoopNode, self).__init__(taken_succs, unsat_succs,
... | 45.727273 | 99 | 0.737575 |
765087270d4c514ea9364185e3a60e6880040e8c | 4,509 | py | Python | huaweicloud-sdk-bcs/huaweicloudsdkbcs/v2/model/download_blockchain_cert_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-bcs/huaweicloudsdkbcs/v2/model/download_blockchain_cert_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-bcs/huaweicloudsdkbcs/v2/model/download_blockchain_cert_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 DownloadBlockchainCertRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dic... | 27.162651 | 86 | 0.586826 |
94a70627d861774b743e8f46dfe7055e1fb6d6ab | 17,249 | py | Python | pytype/tests/test_base.py | nikitt-code/pytype | fb6e87ca27fc2239799a8ea9e205d6e8efea49d2 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_base.py | nikitt-code/pytype | fb6e87ca27fc2239799a8ea9e205d6e8efea49d2 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_base.py | nikitt-code/pytype | fb6e87ca27fc2239799a8ea9e205d6e8efea49d2 | [
"Apache-2.0"
] | null | null | null | """Common methods for tests of analyze.py."""
import logging
import sys
import textwrap
from typing import Tuple
from pytype import analyze
from pytype import config
from pytype import directors
from pytype import load_pytd
from pytype.pyi import parser
from pytype.pytd import optimize
from pytype.pytd import pytd
fr... | 40.207459 | 80 | 0.662009 |
04bef496496127809de34139b335eb0a8022e0a4 | 3,848 | py | Python | asr/cmd/aps/asr/xfmr/encoder.py | DanBerrebbi/AISHELL-4 | 75ea24e547b671eae05aac365e32b3cd09bb3b3c | [
"Apache-2.0"
] | 77 | 2021-06-08T11:16:53.000Z | 2022-03-31T03:06:03.000Z | asr/cmd/aps/asr/xfmr/encoder.py | DanBerrebbi/AISHELL-4 | 75ea24e547b671eae05aac365e32b3cd09bb3b3c | [
"Apache-2.0"
] | 5 | 2021-07-19T09:36:31.000Z | 2022-01-21T13:27:34.000Z | asr/cmd/aps/asr/xfmr/encoder.py | DanBerrebbi/AISHELL-4 | 75ea24e547b671eae05aac365e32b3cd09bb3b3c | [
"Apache-2.0"
] | 15 | 2021-07-02T03:02:29.000Z | 2022-01-16T04:44:17.000Z | #!/usr/bin/env python
# Copyright 2020 Jian Wu
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import torch as th
import torch.nn as nn
from typing import Optional, Dict
from aps.asr.base.attention import padding_mask
from aps.asr.base.encoder import EncRetType
from aps.asr.xfmr.impl import get_xf... | 38.48 | 80 | 0.490904 |
4b1f2dcece5a257c2b9348b89711887b183a80fd | 1,397 | py | Python | texts/objects/authorized/object.py | nicolay-r/frame-based-attitude-extraction-workflow | f20e6d17a9eb6613028545b889c74626a8260ccd | [
"MIT"
] | null | null | null | texts/objects/authorized/object.py | nicolay-r/frame-based-attitude-extraction-workflow | f20e6d17a9eb6613028545b889c74626a8260ccd | [
"MIT"
] | 6 | 2020-10-03T13:45:38.000Z | 2021-07-13T18:31:57.000Z | texts/objects/authorized/object.py | nicolay-r/frame-based-attitude-extraction-workflow | f20e6d17a9eb6613028545b889c74626a8260ccd | [
"MIT"
] | null | null | null | from core.runtime.object import TextObject
class AuthTextObject(TextObject):
def __init__(self, terms, position, is_auth, obj_type, description, collection_ind):
assert(isinstance(description, str))
assert(isinstance(obj_type, str))
assert(isinstance(collection_ind, int) and collection_in... | 29.104167 | 93 | 0.623479 |
f668e53df525504def445055cfd0455cd93493b9 | 30,241 | py | Python | run_pretraining.py | gkebe/EventBERT | 63a77067629350c118b12d48884394c4b85416b9 | [
"Apache-2.0"
] | 1 | 2021-12-08T03:31:38.000Z | 2021-12-08T03:31:38.000Z | run_pretraining.py | gkebe/EventBERT | 63a77067629350c118b12d48884394c4b85416b9 | [
"Apache-2.0"
] | null | null | null | run_pretraining.py | gkebe/EventBERT | 63a77067629350c118b12d48884394c4b85416b9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
# Copyright 2018 The Google AI Language Team Authors and The HugginFace 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... | 48.618971 | 187 | 0.592242 |
21036d34a948d63994e43fff3e58b43b15fe65ea | 16,896 | py | Python | bpm/model/resnet_conv4_end.py | TingtingAlice/MPM-LTL | b822d1b27493272459d9198dfc438a16f4a18733 | [
"MIT"
] | null | null | null | bpm/model/resnet_conv4_end.py | TingtingAlice/MPM-LTL | b822d1b27493272459d9198dfc438a16f4a18733 | [
"MIT"
] | null | null | null | bpm/model/resnet_conv4_end.py | TingtingAlice/MPM-LTL | b822d1b27493272459d9198dfc438a16f4a18733 | [
"MIT"
] | 1 | 2018-11-27T03:10:40.000Z | 2018-11-27T03:10:40.000Z | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import numpy as np
import torch
from torch.nn.parameter import Parameter
from torch.autograd import Variable
from bpm.utils.utils import save_ckpt
from bpm.utils.utils import load_ckpt
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'r... | 33.590457 | 128 | 0.571733 |
236e8fde385deede2f00d19e7cfcaab27b9e8644 | 16,226 | py | Python | examples/classification/staged_quantization_worker.py | MGibsonint/nncf_pytorch | 1c1ee370460d2e4531c2bf353c7b89ccc659fa38 | [
"Apache-2.0"
] | null | null | null | examples/classification/staged_quantization_worker.py | MGibsonint/nncf_pytorch | 1c1ee370460d2e4531c2bf353c7b89ccc659fa38 | [
"Apache-2.0"
] | null | null | null | examples/classification/staged_quantization_worker.py | MGibsonint/nncf_pytorch | 1c1ee370460d2e4531c2bf353c7b89ccc659fa38 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 43.61828 | 120 | 0.678109 |
51c16b2c9c4faa582282276215288fb1f48eb2f0 | 2,765 | py | Python | mopidy_dleyna/backend.py | mczerski/mopidy-dleyna | 61e8a2a92392a9c275a47508874fd2102a9c16e6 | [
"Apache-2.0"
] | null | null | null | mopidy_dleyna/backend.py | mczerski/mopidy-dleyna | 61e8a2a92392a9c275a47508874fd2102a9c16e6 | [
"Apache-2.0"
] | null | null | null | mopidy_dleyna/backend.py | mczerski/mopidy-dleyna | 61e8a2a92392a9c275a47508874fd2102a9c16e6 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import errno
import logging
import os
import os.path
import re
import signal
import stat
import subprocess
from mopidy import backend, exceptions
import pykka
from . import Extension
from .client import dLeynaClient
from .library import dLeynaLibraryProvider
... | 32.529412 | 79 | 0.650633 |
d369b405d4cf8d801368e2c2599319210a5be40a | 91 | py | Python | 3. Comando Condicional/Lista 01/programa 01.py | enosteteo/Introducao-a-Programacao-P1 | bd8f90c96fd16c88e7dc7136942fe29a828f86fa | [
"MIT"
] | null | null | null | 3. Comando Condicional/Lista 01/programa 01.py | enosteteo/Introducao-a-Programacao-P1 | bd8f90c96fd16c88e7dc7136942fe29a828f86fa | [
"MIT"
] | null | null | null | 3. Comando Condicional/Lista 01/programa 01.py | enosteteo/Introducao-a-Programacao-P1 | bd8f90c96fd16c88e7dc7136942fe29a828f86fa | [
"MIT"
] | null | null | null | # Programa 01
a = 5
b = 2
if(a + b < 10):
c = a-b
else:
c = a+b
a = c*b
print(b-3) | 9.1 | 15 | 0.43956 |
f5e62ff3f899b4121aefff00052fb63d95d078ba | 12,840 | py | Python | openstack_dashboard/test/tests/quotas.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | 1 | 2017-12-07T05:21:58.000Z | 2017-12-07T05:21:58.000Z | openstack_dashboard/test/tests/quotas.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/tests/quotas.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... | 48.270677 | 78 | 0.578037 |
b80fe800990dff4e34a1b5168a5a0ecbc511a9cb | 7,610 | py | Python | server.py | not-surprised/pi-bluetooth-server | 427a11a0b0eff163805b88ff4967e432466696cd | [
"MIT"
] | null | null | null | server.py | not-surprised/pi-bluetooth-server | 427a11a0b0eff163805b88ff4967e432466696cd | [
"MIT"
] | null | null | null | server.py | not-surprised/pi-bluetooth-server | 427a11a0b0eff163805b88ff4967e432466696cd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from time import time
import sys
import dbus
from ble.advertisement import Advertisement
from ble.service import Application, Service, Characteristic, Descriptor
from sensors.brightness_sensor import BrightnessSensor
from sensors.volume_sensor import VolumeSensor
GATT_CHRC_IFACE = 'org.bluez.Ga... | 28.935361 | 87 | 0.621945 |
7a9cfc2d3daf9d3a38237b0dcddb3f650eb4e9cb | 1,474 | py | Python | CodeSignal/shapeArea.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 5 | 2019-09-07T17:31:17.000Z | 2022-03-05T09:59:46.000Z | CodeSignal/shapeArea.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | null | null | null | CodeSignal/shapeArea.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 2 | 2019-09-07T17:31:24.000Z | 2019-10-28T16:10:52.000Z | """
Below we will define an n-interesting polygon. Your task is to find the area of a polygon for a given n.
A 1-interesting polygon is just a square with a side of length 1.
An n-interesting polygon is obtained by taking the n - 1-interesting polygon and
appending 1-interesting polygons to its rim, side by side.
Y... | 21.057143 | 104 | 0.525102 |
58e1d46b2f2dd109c85d287273bcdd08b29e6ce1 | 7,072 | py | Python | src/zfr/dataobjects/plan.py | nathonfowlie/python.zfr | 3158fa41278e862341c2676df6a6b5924b1c27a1 | [
"MIT"
] | null | null | null | src/zfr/dataobjects/plan.py | nathonfowlie/python.zfr | 3158fa41278e862341c2676df6a6b5924b1c27a1 | [
"MIT"
] | null | null | null | src/zfr/dataobjects/plan.py | nathonfowlie/python.zfr | 3158fa41278e862341c2676df6a6b5924b1c27a1 | [
"MIT"
] | null | null | null | """Data objects used to manage test plans."""
import datetime
from dataclasses import dataclass, field
from typing import Dict, List, Optional
from zfr.dataobjects import Comment
from zfr.dataobjects.cycle import TestCycle
@dataclass(frozen=True)
class Attachment:
"""Represents a file attachment on ... | 32.440367 | 81 | 0.64918 |
f68f3644d2cf72849d15394f5834c2d30071b786 | 684 | py | Python | glory/urls.py | baixuexue123/glory | b164fc920832d122411b1976b89823dc42acc212 | [
"MIT"
] | null | null | null | glory/urls.py | baixuexue123/glory | b164fc920832d122411b1976b89823dc42acc212 | [
"MIT"
] | null | null | null | glory/urls.py | baixuexue123/glory | b164fc920832d122411b1976b89823dc42acc212 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from django.conf.urls.static import static
from django.contrib import admin
from django.conf import settings
from django.contrib.auth.views import LoginView
from blog.views import IndexView
urlpatterns = [
url(r'^$', IndexView.as_view()),
url(r'^login/$', LoginView.as... | 32.571429 | 80 | 0.714912 |
da32b59d7bdeaf7fa9aaa2089c5de90e781f2933 | 8,280 | py | Python | src/data_prep/wiki_vectorize.py | LaudateCorpus1/hermes-5 | d9b50452379fe636da96c2bad2d286afa15cd7b9 | [
"Apache-2.0"
] | 135 | 2015-11-17T09:04:37.000Z | 2022-01-14T07:00:34.000Z | src/data_prep/wiki_vectorize.py | cacan/hermes | d9b50452379fe636da96c2bad2d286afa15cd7b9 | [
"Apache-2.0"
] | 16 | 2015-11-19T18:04:13.000Z | 2016-11-19T00:30:12.000Z | src/data_prep/wiki_vectorize.py | cacan/hermes | d9b50452379fe636da96c2bad2d286afa15cd7b9 | [
"Apache-2.0"
] | 68 | 2015-11-13T22:51:57.000Z | 2022-01-26T01:51:09.000Z | from src.utils import article_to_category, glove, remove_templates, clean_categories, clean_links
import string
import numpy as np
class wiki_vectorize():
def __init__(self, user_interactions, content, user_vector_type, content_vector_type, sqlCtx, **support_files):
"""
Class initializer to load t... | 50.487805 | 175 | 0.641546 |
02d150ca595237247d9b3f357c2c501c2ba71525 | 1,894 | py | Python | venv/lib/python3.7/site-packages/diffoscope/presenters/restructuredtext.py | crazyzete/AppSecAssignment2 | a5520738e6c5924b94f69980eba49a565c2561d7 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/diffoscope/presenters/restructuredtext.py | crazyzete/AppSecAssignment2 | a5520738e6c5924b94f69980eba49a565c2561d7 | [
"MIT"
] | 1 | 2021-02-08T20:34:54.000Z | 2021-02-08T20:34:54.000Z | venv/lib/python3.7/site-packages/diffoscope/presenters/restructuredtext.py | crazyzete/AppSecAssignment2 | a5520738e6c5924b94f69980eba49a565c2561d7 | [
"MIT"
] | 1 | 2020-11-04T06:48:34.000Z | 2020-11-04T06:48:34.000Z | # -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2017 Chris Lamb <lamby@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation,... | 32.101695 | 73 | 0.640971 |
99751286cee502611b16b6925b41b74c90671e13 | 3,059 | py | Python | hypermax/cli.py | 00sapo/hypermax | 2cb6615cbd6801a7e2e9ad6463708380fffec6c8 | [
"BSD-3-Clause"
] | 107 | 2018-08-08T01:58:31.000Z | 2022-03-03T17:00:01.000Z | hypermax/cli.py | 00sapo/hypermax | 2cb6615cbd6801a7e2e9ad6463708380fffec6c8 | [
"BSD-3-Clause"
] | 8 | 2018-10-02T05:07:54.000Z | 2021-11-07T21:02:36.000Z | hypermax/cli.py | 00sapo/hypermax | 2cb6615cbd6801a7e2e9ad6463708380fffec6c8 | [
"BSD-3-Clause"
] | 17 | 2018-08-08T02:03:53.000Z | 2022-01-03T14:51:55.000Z | import argparse
import hypermax.cui
import json
import time
import os.path
import hyperopt
from pprint import pprint
from hypermax.optimizer import Optimizer
import csv
def parse_args():
parser = argparse.ArgumentParser(description='Provide configuration options for Hypermax')
parser.add_argument('configuratio... | 44.985294 | 212 | 0.67473 |
d7a8c8f5c155e9a080eb0a7a8ae2e5596bebec5d | 13,912 | py | Python | autoload/conque_term/conque_globals.py | anivek/vim | 41ff9486081394feaf1165e34fed744f4950d4d8 | [
"MIT"
] | 3 | 2016-02-20T03:52:03.000Z | 2019-06-10T20:55:36.000Z | autoload/conque_term/conque_globals.py | anivek/vim | 41ff9486081394feaf1165e34fed744f4950d4d8 | [
"MIT"
] | null | null | null | autoload/conque_term/conque_globals.py | anivek/vim | 41ff9486081394feaf1165e34fed744f4950d4d8 | [
"MIT"
] | 3 | 2015-02-10T17:43:24.000Z | 2019-03-05T11:28:30.000Z | # FILE: autoload/conque_term/conque_globals.py
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
# WEBSITE: http://conque.googlecode.com
# MODIFIED: 2011-08-12
# VERSION: 2.2, for Vim 7.0
# LICENSE:
# Conque - Vim terminal/console emulator
# Copyright (C) 2009-__YEAR__ Nico Raffo
#
# MIT License
#
# Permission is here... | 43.475 | 179 | 0.646205 |
14b2236532054d3165f70def9b5ae608a2572973 | 1,943 | py | Python | techminer2/dotted_gantt_chart.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/dotted_gantt_chart.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/dotted_gantt_chart.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | """
Dotted Gantt Chart
===============================================================================
>>> from techminer2 import *
>>> directory = "/workspaces/techminer2/data/"
>>> file_name = "/workspaces/techminer2/sphinx/images/dotted_gantt_chart.png"
>>> dotted_gantt_chart(
... column='author_keywords',
... ... | 24.594937 | 79 | 0.561503 |
fe61e188c9a4545ff6ebb501006fc53b319d85cc | 363 | py | Python | ssim.py | jeya-maria-jose/Performance_Metrics | 8261a5129b6494d5c613cfe7b0e280f4725605ce | [
"MIT"
] | 1 | 2021-02-18T22:27:26.000Z | 2021-02-18T22:27:26.000Z | ssim.py | jeya-maria-jose/Performance_Metrics | 8261a5129b6494d5c613cfe7b0e280f4725605ce | [
"MIT"
] | null | null | null | ssim.py | jeya-maria-jose/Performance_Metrics | 8261a5129b6494d5c613cfe7b0e280f4725605ce | [
"MIT"
] | null | null | null | from skimage.measure import compare_ssim
import glob
pred_loc = '/home/jeyamariajose/Projects/Self_Attention_Aux_Synthesis/checkpoints/brainus-base/web/images/*_real_image.jpg'
GT_loc = '/home/jeyamariajose/Projects/Self_Attention_Aux_Synthesis/checkpoints/brainus-base/web/*_synthesized_image.jpg'
for filename in gl... | 36.3 | 123 | 0.831956 |
8e85221e3efb07f7acbb4f2e8c1cae67184b7321 | 7,638 | py | Python | tests/conftest.py | wudwork/keymaster | 196d265d6375ea5fb46f915a7f4efdaab76bbfb0 | [
"MIT"
] | null | null | null | tests/conftest.py | wudwork/keymaster | 196d265d6375ea5fb46f915a7f4efdaab76bbfb0 | [
"MIT"
] | null | null | null | tests/conftest.py | wudwork/keymaster | 196d265d6375ea5fb46f915a7f4efdaab76bbfb0 | [
"MIT"
] | null | null | null | """ Fixtures for keymaster tests. """
import asyncio
import json
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from zwave_js_server.model.driver import Driver
from zwave_js_server.model.node import Node
from zwave_js_server.... | 29.264368 | 88 | 0.702278 |
229b4f1da05e36cf9e4ca610a286eaf14ec7d099 | 3,083 | py | Python | ddtrace/encoding.py | jhgg/dd-trace-py | 69cd010f37e392bd73e7a9040d0b2c1fee393bc1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-04-28T21:35:01.000Z | 2021-04-28T21:35:01.000Z | ddtrace/encoding.py | jhgg/dd-trace-py | 69cd010f37e392bd73e7a9040d0b2c1fee393bc1 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/encoding.py | jhgg/dd-trace-py | 69cd010f37e392bd73e7a9040d0b2c1fee393bc1 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import json
import struct
import msgpack
from .internal.logger import get_logger
log = get_logger(__name__)
class _EncoderBase(object):
"""
Encoder interface that provides the logic to encode traces and service.
"""
def encode_traces(self, traces):
"""
Encodes a list of traces, exp... | 29.361905 | 127 | 0.648394 |
dd6cca95f5e652257ac36c605ec041f9fce83831 | 872 | py | Python | corehq/apps/reports/migrations/0002_auto_20171121_1803.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/reports/migrations/0002_auto_20171121_1803.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/reports/migrations/0002_auto_20171121_1803.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | # Generated by Django 1.11.7 on 2017-11-21 18:03
from django.db import migrations
import jsonfield.fields
import corehq.apps.reports.models
class Migration(migrations.Migration):
dependencies = [
('reports', '0001_initial'),
]
operations = [
migrations.AlterField(
model_na... | 37.913043 | 478 | 0.71445 |
29445d9c4541a5994190997a33ebc461b694d7bd | 224 | py | Python | Scripted/CIP_/CIP/logic/__init__.py | hung-lab/SlicerCIP | eefe2ba10ea42da61fac621c9f77b69737c08b23 | [
"BSD-3-Clause"
] | 10 | 2016-04-13T10:13:49.000Z | 2021-11-11T18:05:45.000Z | Scripted/CIP_/CIP/logic/__init__.py | hung-lab/SlicerCIP | eefe2ba10ea42da61fac621c9f77b69737c08b23 | [
"BSD-3-Clause"
] | 33 | 2015-06-05T15:31:00.000Z | 2022-03-16T00:21:44.000Z | Scripted/CIP_/CIP/logic/__init__.py | hung-lab/SlicerCIP | eefe2ba10ea42da61fac621c9f77b69737c08b23 | [
"BSD-3-Clause"
] | 22 | 2015-06-04T20:23:39.000Z | 2022-03-17T03:40:48.000Z | from .Util import *
from .SlicerUtil import *
from .geometry_topology_data import *
from .EventsTrigger import *
from . import file_conventions
#from StructuresParameters import *
#from Colors import *
from .timer import *
| 22.4 | 37 | 0.785714 |
06dc812a600ebe6f55a6b0a0d25bcec0ac7aa2c0 | 1,350 | py | Python | textract-pipeline/lambda/s3processor/lambda_function.py | rounakpashine/amazon-textract-serverless-large-scale-document-processing | fac3b181bd5b5c6bf7c5017eefb27d9df1c62874 | [
"Apache-2.0"
] | 260 | 2019-05-16T22:39:14.000Z | 2022-03-27T11:33:31.000Z | textract-pipeline/lambda/s3processor/lambda_function.py | rounakpashine/amazon-textract-serverless-large-scale-document-processing | fac3b181bd5b5c6bf7c5017eefb27d9df1c62874 | [
"Apache-2.0"
] | 24 | 2019-05-18T07:22:49.000Z | 2022-02-09T15:23:35.000Z | textract-pipeline/lambda/s3processor/lambda_function.py | rounakpashine/amazon-textract-serverless-large-scale-document-processing | fac3b181bd5b5c6bf7c5017eefb27d9df1c62874 | [
"Apache-2.0"
] | 145 | 2019-05-16T21:56:53.000Z | 2022-03-17T14:17:00.000Z | import json
import os
import uuid
import urllib
import datastore
from helper import FileHelper
def processRequest(request):
output = ""
print("request: {}".format(request))
bucketName = request["bucketName"]
objectName = request["objectName"]
documentsTable = request["documentsTable"]
output... | 27.55102 | 97 | 0.657778 |
28ad6bea8b2c11b95d62457141ea3157f13486cb | 1,036 | py | Python | built-in/PyTorch/Official/cv/scene_text_detection/DB_ID0706_for_Pytorch/structure/representers/setup.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/PyTorch/Official/cv/scene_text_detection/DB_ID0706_for_Pytorch/structure/representers/setup.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/PyTorch/Official/cv/scene_text_detection/DB_ID0706_for_Pytorch/structure/representers/setup.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # Copyright [yyyy] [name of copyright owner]
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | 34.533333 | 78 | 0.707529 |
8945024cf0366140821473452c475cd662f6d250 | 7,008 | py | Python | data-science-2/main.py | marcellacafe/codenation_aceleradev_ds | 8b07defb3d63f5322e6425837a77f1d3e1fae9c0 | [
"MIT"
] | null | null | null | data-science-2/main.py | marcellacafe/codenation_aceleradev_ds | 8b07defb3d63f5322e6425837a77f1d3e1fae9c0 | [
"MIT"
] | null | null | null | data-science-2/main.py | marcellacafe/codenation_aceleradev_ds | 8b07defb3d63f5322e6425837a77f1d3e1fae9c0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Desafio 4
#
# Neste desafio, vamos praticar um pouco sobre testes de hipóteses. Utilizaremos o _data set_ [2016 Olympics in Rio de Janeiro](https://www.kaggle.com/rio2016/olympic-games/), que contém dados sobre os atletas das Olimpíadas de 2016 no Rio de Janeiro.
#
# Esse _d... | 25.299639 | 425 | 0.701341 |
79bd58b2bdc7624550d669744142a2e9ec8b1949 | 2,010 | py | Python | doomsday_fuel/tests.py | Bindernews/foobar | 381dca62122ca1153c00a1039187dec3874a1bc7 | [
"0BSD"
] | null | null | null | doomsday_fuel/tests.py | Bindernews/foobar | 381dca62122ca1153c00a1039187dec3874a1bc7 | [
"0BSD"
] | null | null | null | doomsday_fuel/tests.py | Bindernews/foobar | 381dca62122ca1153c00a1039187dec3874a1bc7 | [
"0BSD"
] | null | null | null | from solution import solution
def test(index, inp, expected, debug=False, disable=False):
if disable:
print("Test %d : DISABLED!!!" % (index))
return
r = solution(inp, debug)
if r == expected:
print("Test %d : OK" % index)
else:
print("Test %d : FAIL : %s" % (index, str(... | 24.512195 | 89 | 0.4 |
fe52b5199dfd9a5ee790ff6a78cf008a6a2dde47 | 1,382 | py | Python | vhoops/modules/settings/api/routes.py | yigitbasalma/vhoops | e55e841631aeaeace371218229e9323a9b4fa06d | [
"Unlicense",
"MIT"
] | 4 | 2021-02-26T11:14:15.000Z | 2021-12-26T13:11:17.000Z | vhoops/modules/settings/api/routes.py | yigitbasalma/vhoops | e55e841631aeaeace371218229e9323a9b4fa06d | [
"Unlicense",
"MIT"
] | 2 | 2021-02-26T10:16:03.000Z | 2021-02-26T10:16:19.000Z | vhoops/modules/settings/api/routes.py | yigitbasalma/vhoops | e55e841631aeaeace371218229e9323a9b4fa06d | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Blueprint, jsonify
from flask_login import login_required
from vhoops import authorize, api_version
from vhoops.modules.settings.forms.new_integration import NewIntegration
from vhoops.modules.settings.api.controllers import create_new_integration_func, upd... | 29.404255 | 104 | 0.716353 |
9148d383e1c202e768e1fad4f6932999b2669cf1 | 4,816 | py | Python | hiquant/data_source/yahoo.py | floatinghotpot/hiquant | a4a68c3ff88c35f1076e884861d365f7c5d6fae7 | [
"Apache-2.0"
] | 7 | 2021-06-16T14:21:49.000Z | 2021-09-30T14:34:57.000Z | hiquant/data_source/yahoo.py | webclinic017/hiquant | 3f5de4f61b6dded2f082dc5b9adf086de485bb7c | [
"Apache-2.0"
] | null | null | null | hiquant/data_source/yahoo.py | webclinic017/hiquant | 3f5de4f61b6dded2f082dc5b9adf086de485bb7c | [
"Apache-2.0"
] | 2 | 2021-09-24T16:13:04.000Z | 2021-11-29T01:10:50.000Z | # -*- coding: utf-8; py-indent-offset:4 -*-
import requests
import datetime
import time
import pandas as pd
import io
from ..utils import symbol_yahoo_style
# headers and params used to bypass NASDAQ's anti-scraping mechanism in function __exchange2df
yahoo_headers = {
'user-agent': 'Mozilla/5.0 (Macintosh; Inte... | 30.871795 | 196 | 0.645556 |
9004d9a6901ee528536ff836bfcc8a91310a8754 | 1,507 | py | Python | fastapi/app.py | scbrianti2022/fastapi | dae0c5308e71eb15d5228ee124ad8bcafbb6c742 | [
"Unlicense"
] | null | null | null | fastapi/app.py | scbrianti2022/fastapi | dae0c5308e71eb15d5228ee124ad8bcafbb6c742 | [
"Unlicense"
] | null | null | null | fastapi/app.py | scbrianti2022/fastapi | dae0c5308e71eb15d5228ee124ad8bcafbb6c742 | [
"Unlicense"
] | null | null | null | import io
import os
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from .config import settings
from .db import create_db_and_tables, engine
from .routes import main_router
def read(*paths, **kwargs):
"""Read the contents of a text file safely.
>>> read("VERSION")
"""
... | 25.116667 | 78 | 0.660252 |
a9b8a15c7d449116cdedb64d2aaac142a351461b | 530 | py | Python | day11/dogagecal.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | day11/dogagecal.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | day11/dogagecal.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | # human_year = int(input("Enter the year in humans"))
# dog_age = 0
# for i in range(human_year):
# if(i==1):
# dog_age = dog_age + 10.5
# elif(i==2):
# dog_age = dog_age + 10.5
# else:
# dog_age = dog_age + 4
# print("Dog age is",dog_age)
human_year = int(input("Enter the year in ... | 26.5 | 53 | 0.6 |
6c22562c3c447e0f7f75d4f37e4c3d7d7b15cf09 | 3,904 | py | Python | colombia/data/routing.py | jgp0000/atlas-subnational-api | 3a59d1310cd9ee0f405c58b859a8742b6fdf3847 | [
"BSD-3-Clause"
] | 3 | 2016-02-05T22:04:29.000Z | 2020-02-01T16:23:26.000Z | colombia/data/routing.py | jgp0000/atlas-subnational-api | 3a59d1310cd9ee0f405c58b859a8742b6fdf3847 | [
"BSD-3-Clause"
] | 2 | 2015-10-05T19:38:53.000Z | 2016-01-11T21:02:28.000Z | colombia/data/routing.py | jgp0000/atlas-subnational-api | 3a59d1310cd9ee0f405c58b859a8742b6fdf3847 | [
"BSD-3-Clause"
] | 7 | 2016-03-11T01:08:20.000Z | 2020-12-27T02:46:56.000Z | from ..entities import entities, metadata_apis
from .. import models
from collections import defaultdict
import re
from flask import request
RANGE_RE = r"^(from|to)_(.+)$"
def extract_route_params(request):
"""Given a flask request object, look at the query string and extract
entity name / id pairs and han... | 38.27451 | 108 | 0.661373 |
0799039e9e0e28cbbee1d88cf659487fc10a578b | 141 | py | Python | pydepend/tests/__init__.py | herczy/pydepend | ee64ba30efc3e19d643da2ed22e078ef4a06795d | [
"BSD-3-Clause"
] | 2 | 2019-04-21T06:10:09.000Z | 2020-04-24T23:12:02.000Z | pydepend/tests/__init__.py | herczy/pydepend | ee64ba30efc3e19d643da2ed22e078ef4a06795d | [
"BSD-3-Clause"
] | null | null | null | pydepend/tests/__init__.py | herczy/pydepend | ee64ba30efc3e19d643da2ed22e078ef4a06795d | [
"BSD-3-Clause"
] | null | null | null | import os.path
def get_asset_path(name):
return os.path.abspath(
os.path.join(os.path.dirname(__file__), 'assets', name)
)
| 17.625 | 63 | 0.659574 |
f5dff288670062f93b5fe15bab8c6a8fd256e623 | 321 | py | Python | consonant_cluster_gen.py | kaubu/python-scripts | 7dde9b96a85b26708bf777584c701d1e4595efcb | [
"MIT"
] | null | null | null | consonant_cluster_gen.py | kaubu/python-scripts | 7dde9b96a85b26708bf777584c701d1e4595efcb | [
"MIT"
] | null | null | null | consonant_cluster_gen.py | kaubu/python-scripts | 7dde9b96a85b26708bf777584c701d1e4595efcb | [
"MIT"
] | null | null | null | import itertools
letters = [
"p",
"b",
"t",
"d",
"k",
"g",
"s",
"z",
"c",
"cz",
"f",
"v",
"th",
"dh",
"m",
"n",
"hh",
"r",
"j",
"l",
"w",
]
for i, c in enumerate(list(itertools.combinations(letters, 2))):
print(f"{c[0]}{c[1]}")... | 11.068966 | 64 | 0.330218 |
328e562f7f228d65120e7181923b5b5c96184816 | 10,088 | py | Python | network.py | kblack373/mpls-pa5 | 35fd4877afd05d81179a61f85cd3c96ce460befb | [
"Apache-2.0"
] | null | null | null | network.py | kblack373/mpls-pa5 | 35fd4877afd05d81179a61f85cd3c96ce460befb | [
"Apache-2.0"
] | null | null | null | network.py | kblack373/mpls-pa5 | 35fd4877afd05d81179a61f85cd3c96ce460befb | [
"Apache-2.0"
] | null | null | null | import queue
import threading
from link import LinkFrame
## wrapper class for a queue of packets
class Interface:
## @param maxsize - the maximum size of the queue storing packets
# @param capacity - the capacity of the link in bps
def __init__(self, maxsize=0, capacity=500):
self.in_queue = queu... | 39.716535 | 113 | 0.60686 |
443855de31fad2ae3e5d6ad1d6a1dd37815d34da | 741 | py | Python | solutions/0301.remove-invalid-parentheses/remove-invalid-parentheses.py | cocobear/LeetCode-in-Python | b4ecd5cb7122467ee479f38497faaabb17e6025e | [
"MIT"
] | null | null | null | solutions/0301.remove-invalid-parentheses/remove-invalid-parentheses.py | cocobear/LeetCode-in-Python | b4ecd5cb7122467ee479f38497faaabb17e6025e | [
"MIT"
] | null | null | null | solutions/0301.remove-invalid-parentheses/remove-invalid-parentheses.py | cocobear/LeetCode-in-Python | b4ecd5cb7122467ee479f38497faaabb17e6025e | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=301 lang=python3
#
# [301] Remove Invalid Parentheses
#
# @lc code=start
class Solution:
def removeInvalidParentheses(self, s: str) -> List[str]:
# 暴力解法
# 找出删除各种字符的所有组合,并一一判断是否有效
# 容易超时
def isValid(s):
count = 0
for i in s:
... | 24.7 | 75 | 0.448043 |
1ba25e0c3c819ecc6cc931c89349c8b2cb4800c6 | 975 | py | Python | reader/manga/manga.py | dpsommer/manga-reader | ab9c60705347378ccbf16ea7e9075c093db19daa | [
"MIT"
] | null | null | null | reader/manga/manga.py | dpsommer/manga-reader | ab9c60705347378ccbf16ea7e9075c093db19daa | [
"MIT"
] | 2 | 2021-03-31T19:50:56.000Z | 2021-12-13T20:39:30.000Z | reader/manga/manga.py | dpsommer/manga-reader | ab9c60705347378ccbf16ea7e9075c093db19daa | [
"MIT"
] | null | null | null | from whoosh.fields import SchemaClass, TEXT, KEYWORD, BOOLEAN, ID
class MangaSchema(SchemaClass):
title = TEXT(stored=True)
author = TEXT
artist = TEXT
description = TEXT
tags = KEYWORD(lowercase=True, commas=True, scorable=True)
completed = BOOLEAN
url = ID(stored=True)
class Manga(obje... | 23.214286 | 74 | 0.643077 |
8a6c75c95997eaab8d3be8990657a007d8ac3ed6 | 26,155 | py | Python | python/setup.py | jgiannuzzi/ray | db5de9c35c5e189c83ececd5a432bb58faf6a1f5 | [
"Apache-2.0"
] | 1 | 2022-03-22T11:17:22.000Z | 2022-03-22T11:17:22.000Z | python/setup.py | jgiannuzzi/ray | db5de9c35c5e189c83ececd5a432bb58faf6a1f5 | [
"Apache-2.0"
] | 29 | 2019-02-13T11:31:32.000Z | 2022-03-19T07:15:24.000Z | python/setup.py | jgiannuzzi/ray | db5de9c35c5e189c83ececd5a432bb58faf6a1f5 | [
"Apache-2.0"
] | null | null | null | import argparse
import errno
import glob
import io
import logging
import os
import re
import shutil
import subprocess
import sys
import tarfile
import tempfile
import zipfile
from itertools import chain
from enum import Enum
import urllib.error
import urllib.parse
import urllib.request
logger = logging.getLogger(__n... | 34.826897 | 156 | 0.620455 |
e70842272fb0571a3ca194bd21fca462e2d6da50 | 3,923 | py | Python | lib/googlecloudsdk/command_lib/util/declarative/python_command_util.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/command_lib/util/declarative/python_command_util.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/util/declarative/python_command_util.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2021 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 requir... | 36.663551 | 90 | 0.68621 |
a206dbe5bba4d8aa97d42aa8ae2777d3c34c3aa0 | 7,062 | py | Python | post_latex.py | d2l-ai/utils | baaf871131faa426aa9dc3e248b97aad536038ed | [
"Apache-2.0"
] | 5 | 2018-12-27T19:57:27.000Z | 2020-01-15T11:38:56.000Z | post_latex.py | d2l-ai/utils | baaf871131faa426aa9dc3e248b97aad536038ed | [
"Apache-2.0"
] | 1 | 2022-02-11T18:15:18.000Z | 2022-02-11T22:57:10.000Z | post_latex.py | d2l-ai/utils | baaf871131faa426aa9dc3e248b97aad536038ed | [
"Apache-2.0"
] | 7 | 2019-01-09T19:37:41.000Z | 2022-02-11T17:57:50.000Z | import os
import re
import shutil
import sys
import tempfile
MANUAL_STY_FILE = 'build/_build/latex/sphinxmanual.cls'
TEX_FILE_EN = 'build/_build/latex/d2l-en.tex'
TEX_FILE_ZH = 'build/_build/latex/d2l-zh.tex'
UNNUMBERED_EN = {'\\section{Summary}',
'\\section{Reference}',
'\\section{... | 39.898305 | 118 | 0.512178 |
fbf52cd2ef7e9125627d40cf7ff4aa5afee7e419 | 1,601 | py | Python | FINAL_APP/flask_app.py | AgisKounelis/Actors-Matching---Face-Recognition | 072090e9ef29bff6aaed6aae21d539c089e4e962 | [
"MIT"
] | null | null | null | FINAL_APP/flask_app.py | AgisKounelis/Actors-Matching---Face-Recognition | 072090e9ef29bff6aaed6aae21d539c089e4e962 | [
"MIT"
] | null | null | null | FINAL_APP/flask_app.py | AgisKounelis/Actors-Matching---Face-Recognition | 072090e9ef29bff6aaed6aae21d539c089e4e962 | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify
from flask_cors import CORS
from io import BytesIO
import sqlite3
import face_recognition
import requests
import numpy
app = Flask(__name__)
CORS(app) # make it accessible for requests
@app.route('/actor', methods=['GET', 'POST'])
def get_new_actor():
img_id = request.a... | 25.015625 | 69 | 0.602748 |
da1cb7ba155ce26f4d47d6f78923a35522373d98 | 38,121 | py | Python | kapua-client/python-client/swagger_client/api/credentials_api.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | 5 | 2019-05-30T02:55:16.000Z | 2020-03-03T14:18:23.000Z | kapua-client/python-client/swagger_client/api/credentials_api.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | 3 | 2019-12-27T00:53:23.000Z | 2020-02-17T05:29:19.000Z | kapua-client/python-client/swagger_client/api/credentials_api.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | 4 | 2019-06-04T06:26:14.000Z | 2021-01-07T04:25:32.000Z | # coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
... | 43.17214 | 130 | 0.624616 |
0f6071163d70b4ab808a381799260e37e525baa8 | 407 | py | Python | djangoauthtrial/asgi.py | sankalpmukim/django-auth-trial | 40d2a0eabb91acf666fffdb9c6456228d55c0882 | [
"MIT"
] | null | null | null | djangoauthtrial/asgi.py | sankalpmukim/django-auth-trial | 40d2a0eabb91acf666fffdb9c6456228d55c0882 | [
"MIT"
] | null | null | null | djangoauthtrial/asgi.py | sankalpmukim/django-auth-trial | 40d2a0eabb91acf666fffdb9c6456228d55c0882 | [
"MIT"
] | null | null | null | """
ASGI config for djangoauthtrial project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJAN... | 23.941176 | 78 | 0.793612 |
b393a8030238f004f9c016be10e030de51a323c7 | 136 | py | Python | blueprints/screening_app/__init__.py | ajinkyabawaskar/mindmeld-blueprints | 84b866b21b34bdee6abac14fc77710496592dac7 | [
"Apache-2.0"
] | 12 | 2019-05-14T11:07:31.000Z | 2021-08-27T23:10:32.000Z | blueprints/screening_app/__init__.py | ajinkyabawaskar/mindmeld-blueprints | 84b866b21b34bdee6abac14fc77710496592dac7 | [
"Apache-2.0"
] | 8 | 2019-07-03T20:13:54.000Z | 2020-12-09T23:14:08.000Z | blueprints/screening_app/__init__.py | ajinkyabawaskar/mindmeld-blueprints | 84b866b21b34bdee6abac14fc77710496592dac7 | [
"Apache-2.0"
] | 13 | 2019-06-27T22:51:45.000Z | 2021-12-07T22:09:26.000Z | from screening_app.root import app
import screening_app.greeting
import screening_app.screening # noqa: ignore=F401
__all__ = ['app']
| 19.428571 | 50 | 0.801471 |
5b0cce047c52f68b59d60028cfcf10657ee9b8fa | 9,450 | py | Python | lib/luxi.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 396 | 2015-01-22T11:44:32.000Z | 2022-03-31T14:14:29.000Z | lib/luxi.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 1,550 | 2015-04-05T09:53:50.000Z | 2022-03-28T17:42:20.000Z | lib/luxi.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 119 | 2015-01-06T21:37:15.000Z | 2022-03-07T06:36:26.000Z | #
#
# Copyright (C) 2006, 2007, 2011, 2012, 2013, 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
... | 37.204724 | 80 | 0.74381 |
32b845e9a88413c2bd871ad7d5810a8c7dc43ea8 | 41 | py | Python | torchutils/metrics/__init__.py | tchaye59/torchutils | ca7b01bf63b6c3adaa36a4a66dfd87e927ef2460 | [
"MIT"
] | null | null | null | torchutils/metrics/__init__.py | tchaye59/torchutils | ca7b01bf63b6c3adaa36a4a66dfd87e927ef2460 | [
"MIT"
] | null | null | null | torchutils/metrics/__init__.py | tchaye59/torchutils | ca7b01bf63b6c3adaa36a4a66dfd87e927ef2460 | [
"MIT"
] | null | null | null | from torchutils.metrics.metrics import *
| 20.5 | 40 | 0.829268 |
261d1174d700a155e085ba5cad6567cdc2dcf97e | 66 | py | Python | OurTasks/02/02/02.py | nakov/Python-Course-SoftUni | b6036064c259adbdae4e2d87b67230b9cf9ddefc | [
"MIT"
] | 6 | 2017-06-09T17:45:28.000Z | 2020-03-31T11:59:39.000Z | OurTasks/02/02/02.py | nakov/Python-Course-SoftUni | b6036064c259adbdae4e2d87b67230b9cf9ddefc | [
"MIT"
] | null | null | null | OurTasks/02/02/02.py | nakov/Python-Course-SoftUni | b6036064c259adbdae4e2d87b67230b9cf9ddefc | [
"MIT"
] | 1 | 2019-07-02T11:26:00.000Z | 2019-07-02T11:26:00.000Z | num = float (input ())
print ("{0:.3f}".format (num * 17 / 100))
| 16.5 | 41 | 0.530303 |
33d69fa88febf16195a3eeaa714165fa002876f2 | 233 | py | Python | myapp/__init__.py | amintahmasbi/personal_website | a0cbb7464aef0b004d5bc8e2a2b066b21842f13c | [
"MIT"
] | null | null | null | myapp/__init__.py | amintahmasbi/personal_website | a0cbb7464aef0b004d5bc8e2a2b066b21842f13c | [
"MIT"
] | 2 | 2020-02-11T23:33:15.000Z | 2021-06-10T21:04:40.000Z | myapp/__init__.py | amintahmasbi/personal_website | a0cbb7464aef0b004d5bc8e2a2b066b21842f13c | [
"MIT"
] | null | null | null | """
This application runs the back-end of the data project in my portfolio.
"""
from flask import Flask
app = Flask(__name__)
app.config['publishDir'] = 'templates/'
app.config['root_html'] = 'index.html'
from myapp import routes
| 19.416667 | 71 | 0.729614 |
436207d278f44c295192e3e0020cd7c295213ff8 | 1,004 | py | Python | um/signals.py | BobbyKarabinakis/feedsubs | 363dea74eeaf85e37f062deddd4a5d3e26c4b3eb | [
"MIT"
] | 78 | 2018-09-03T11:52:33.000Z | 2022-02-04T11:56:09.000Z | um/signals.py | BobbyKarabinakis/feedsubs | 363dea74eeaf85e37f062deddd4a5d3e26c4b3eb | [
"MIT"
] | 252 | 2018-08-24T13:10:09.000Z | 2022-02-26T09:04:34.000Z | um/signals.py | BobbyKarabinakis/feedsubs | 363dea74eeaf85e37f062deddd4a5d3e26c4b3eb | [
"MIT"
] | 12 | 2018-12-18T16:41:09.000Z | 2021-06-22T11:34:52.000Z | from allauth.account.signals import user_logged_in
from django.contrib import messages
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils.translation import gettext as _, get_language
from . import models, utils
@receiver(post_save, sender=models.User)
def create_us... | 31.375 | 79 | 0.75 |
4fba746737b6a786e4bbbc3d4f04d3b40766b9a8 | 409 | py | Python | app/backend/core/dataset/__init__.py | SummaLabs/DLS | 2adba47430b456ad0f324e4c8883a896a23b3fbf | [
"MIT"
] | 32 | 2017-09-04T17:40:39.000Z | 2021-02-16T23:08:34.000Z | app/backend/core/dataset/__init__.py | AymanNabih/DLS | 2adba47430b456ad0f324e4c8883a896a23b3fbf | [
"MIT"
] | 3 | 2017-10-09T12:52:54.000Z | 2020-06-29T02:48:38.000Z | app/backend/core/dataset/__init__.py | AymanNabih/DLS | 2adba47430b456ad0f324e4c8883a896a23b3fbf | [
"MIT"
] | 20 | 2017-10-07T17:29:50.000Z | 2021-01-23T22:01:54.000Z | __all__ = ["dataset", "input", "reader", "transform"]
# __all__ = []
#
# import pkgutil
# import inspect
#
# for loader, name, is_pkg in pkgutil.walk_packages(__path__):
# module = loader.find_module(name).load_module(name)
#
# for name, value in inspect.getmembers(module):
# if name.startswith('__'):
... | 25.5625 | 62 | 0.621027 |
c55db14a5f9aa80cac05c1663dc901ce5484c821 | 6,464 | py | Python | tests/triple_quotes.py | Skydler/blockpy | dfbddc30bba1f10b53d6bddc87af119ae010254c | [
"Apache-2.0"
] | 184 | 2015-02-14T03:26:32.000Z | 2019-08-11T13:53:23.000Z | tests/triple_quotes.py | ki-macht-schule/blockpy | befb98ce24cb67ab0e2f9a90135b429a4a7da2c8 | [
"Apache-2.0"
] | 87 | 2019-08-20T20:39:48.000Z | 2021-09-17T08:26:53.000Z | tests/triple_quotes.py | ki-macht-schule/blockpy | befb98ce24cb67ab0e2f9a90135b429a4a7da2c8 | [
"Apache-2.0"
] | 69 | 2016-02-26T00:04:22.000Z | 2019-08-10T00:51:38.000Z | """
Created on Tue Apr 5 09:40:10 2016
This code creates a line graph that compares the violent crime rates
in Washington and Texas from 1960 to 2012, and also a map that shows
the number of violent crimes per state in 2012.
@author: Shane Aubain
Ryan Buzzard
Cassidy Deerin
Tara King
... | 59.851852 | 105 | 0.580755 |
87c6debe27a7d9e1ce7110f6046319db1d277240 | 16,033 | py | Python | src/manhattan_world_with_range/Environment.py | MarineRoboticsGroup/NF-iSAM | 52a09c72deda1043a2e8a2c93c34eb8e01f40ea4 | [
"MIT"
] | 10 | 2021-09-27T16:29:12.000Z | 2022-03-23T23:03:20.000Z | src/manhattan_world_with_range/Environment.py | MarineRoboticsGroup/NF-iSAM | 52a09c72deda1043a2e8a2c93c34eb8e01f40ea4 | [
"MIT"
] | 1 | 2022-03-26T15:35:33.000Z | 2022-03-28T04:36:42.000Z | src/manhattan_world_with_range/Environment.py | MarineRoboticsGroup/NF-iSAM | 52a09c72deda1043a2e8a2c93c34eb8e01f40ea4 | [
"MIT"
] | 1 | 2022-03-23T23:10:34.000Z | 2022-03-23T23:10:34.000Z | from copy import deepcopy
import numpy as np
from typing import Tuple, List, Union, Dict
from manhattan_world_with_range.Agent import GridRobot, GridBeacon
from geometry.TwoDimension import SE2Pose, Point2
def find_nearest(array, value):
array = np.asarray(array)
distances = np.abs(array - value)
idx = d... | 39.883085 | 112 | 0.584045 |
72211adbc4570cf80b4719f97e375c60f52d6b1a | 2,149 | py | Python | networks/alexnet.py | Aveturi13/cmri_planning | 8bc9b01fcf10d9a0eacd7e8b17597c5ed028d8f8 | [
"MIT"
] | null | null | null | networks/alexnet.py | Aveturi13/cmri_planning | 8bc9b01fcf10d9a0eacd7e8b17597c5ed028d8f8 | [
"MIT"
] | null | null | null | networks/alexnet.py | Aveturi13/cmri_planning | 8bc9b01fcf10d9a0eacd7e8b17597c5ed028d8f8 | [
"MIT"
] | null | null | null | #Import modules and packages
import keras
from keras.models import Model
from keras.layers import Conv2D, Activation, MaxPooling2D, Cropping2D, Input, Concatenate, BatchNormalization, Dropout, Dense, Flatten, AveragePooling2D, Add
from keras.initializers import glorot_uniform
from keras.optimizers import Adam, SGD
from... | 34.66129 | 157 | 0.711959 |
e7145c77f1712bc6dee68bff3112f5248e5665e0 | 915 | py | Python | tests/test_reffinder.py | lucawellmeier/mmd | 36e78f42d9083069e25d0a8d11cac04d02f96f56 | [
"MIT"
] | null | null | null | tests/test_reffinder.py | lucawellmeier/mmd | 36e78f42d9083069e25d0a8d11cac04d02f96f56 | [
"MIT"
] | null | null | null | tests/test_reffinder.py | lucawellmeier/mmd | 36e78f42d9083069e25d0a8d11cac04d02f96f56 | [
"MIT"
] | null | null | null | from mmd import RefFinder
def ref_replacer_1(ref, name):
return '<a href="#{}">Hallo</a>'.format(ref)
testblocks1 = [{'content': '<@hallo>'}]
def test_1():
finder = RefFinder(ref_replacer_1)
finder.replace_in(testblocks1[0])
assert testblocks1[0]['content'] == '<a href="#hallo">Hallo</a>'
testbloc... | 27.727273 | 68 | 0.64153 |
800ecc9a29329dfb0b2e102e62f11fea5191809c | 17,784 | py | Python | ddns.py | thonra/NameSilo-DDNS | 40fa1e06f53fd2a220025c177df3518d4602fc9c | [
"MIT"
] | null | null | null | ddns.py | thonra/NameSilo-DDNS | 40fa1e06f53fd2a220025c177df3518d4602fc9c | [
"MIT"
] | null | null | null | ddns.py | thonra/NameSilo-DDNS | 40fa1e06f53fd2a220025c177df3518d4602fc9c | [
"MIT"
] | null | null | null | import json
import logging
import os
import sys
import time
import smtplib
import re
from datetime import datetime
from email.mime.text import MIMEText
from platform import system as pl_system
from subprocess import Popen, PIPE, STDOUT
from xml.etree.ElementTree import PI
import httpx
# https://gist.github.com/dfee/... | 40.418182 | 190 | 0.526035 |
754c1a874d2d7a8e887becf8b1d30d0e78ec4ffc | 428 | py | Python | mmselfsup/models/heads/__init__.py | XingzhiZhou/mmselfsup | fc69e380095a7eda7632beada5611db527b57672 | [
"Apache-2.0"
] | null | null | null | mmselfsup/models/heads/__init__.py | XingzhiZhou/mmselfsup | fc69e380095a7eda7632beada5611db527b57672 | [
"Apache-2.0"
] | null | null | null | mmselfsup/models/heads/__init__.py | XingzhiZhou/mmselfsup | fc69e380095a7eda7632beada5611db527b57672 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .cls_head import ClsHead
from .contrastive_head import ContrastiveHead
from .latent_pred_head import LatentClsHead, LatentPredictHead
from .mocov3_head import MoCoV3Head
from .multi_cls_head import MultiClsHead
from .swav_head import SwAVHead
__all__ = [
'Contra... | 32.923077 | 71 | 0.796729 |
8004952a726ce3ef0cff1a3ac5e92385592960f6 | 1,865 | py | Python | setup.py | thanakijwanavit/ecommerceThinClient | 1fb260ec50060f1e096b821b26caa86d3c02e3f3 | [
"Apache-2.0"
] | 2 | 2020-10-19T07:58:48.000Z | 2020-10-29T02:30:07.000Z | setup.py | thanakijwanavit/ecommerceThinClient | 1fb260ec50060f1e096b821b26caa86d3c02e3f3 | [
"Apache-2.0"
] | 1 | 2020-10-22T11:10:14.000Z | 2020-10-22T11:10:14.000Z | setup.py | thanakijwanavit/villa-product-sdk | d30074daa08c4f9b0175df7578193bb802bd5dc3 | [
"Apache-2.0"
] | null | null | null | from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
# note: all settings are in settings.ini; edit there, not here
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
... | 38.854167 | 102 | 0.67185 |
27ba27cf84d746d358b3129b6f05f4b6c983945d | 3,945 | py | Python | airflow/providers/elasticsearch/backport_provider_setup.py | aindrila2412/airflow | ded3dbbff0c8e4fabcee62a677394dec0db1aa45 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/elasticsearch/backport_provider_setup.py | aindrila2412/airflow | ded3dbbff0c8e4fabcee62a677394dec0db1aa45 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/elasticsearch/backport_provider_setup.py | aindrila2412/airflow | ded3dbbff0c8e4fabcee62a677394dec0db1aa45 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# 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... | 37.571429 | 109 | 0.677567 |
f565beaaded9d3c58ba23fd545ba898322a4523a | 11,203 | py | Python | setup.py | saketsuman07/amazon-kinesis-client-python | 65a035d3626e5bfc8f98a3769a481e7edc61d374 | [
"Apache-2.0"
] | 1 | 2021-06-13T09:34:41.000Z | 2021-06-13T09:34:41.000Z | setup.py | saketsuman07/amazon-kinesis-client-python | 65a035d3626e5bfc8f98a3769a481e7edc61d374 | [
"Apache-2.0"
] | null | null | null | setup.py | saketsuman07/amazon-kinesis-client-python | 65a035d3626e5bfc8f98a3769a481e7edc61d374 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function
import glob
import sys
import os
import shutil
from setuptools import Command
from setuptools import setup
from setuptools.command.install import install
if sys.v... | 38.498282 | 119 | 0.630545 |
b244bf123c11bbd63e2214cfc2e060562f562f69 | 2,624 | py | Python | facerecognition/real_time_video.py | Kareem-negm/simple-projects-and-programming-taskes | 331d248abeff43a190b4ab3391af22a1633d9e65 | [
"MIT"
] | 3 | 2021-05-29T00:43:28.000Z | 2021-06-02T23:37:47.000Z | facerecognition/real_time_video.py | Kareem-negm/simple-projects-and-programming-taskes | 331d248abeff43a190b4ab3391af22a1633d9e65 | [
"MIT"
] | null | null | null | facerecognition/real_time_video.py | Kareem-negm/simple-projects-and-programming-taskes | 331d248abeff43a190b4ab3391af22a1633d9e65 | [
"MIT"
] | 2 | 2021-06-02T23:52:22.000Z | 2021-06-03T15:02:21.000Z | from tensorflow.keras.preprocessing.image import img_to_array
import imutils
import cv2
from tensorflow.keras.models import load_model
import numpy as np
# parameters for loading data and images
detection_model_path = 'haarcascade_frontalface_default.xml'
emotion_model_path = '_mini_XCEPTION.106-0.65.hdf5'
# hyper-pa... | 36.957746 | 127 | 0.605945 |
b0b0e3de0e0feffb51c1653a5c3547c231525f46 | 413 | py | Python | core/migrations/0051_auto_20190327_1220.py | mark-barrett/RESTBroker | d9b0a3574d2970443fdf40c70ab9ceb8d72614f4 | [
"MIT"
] | null | null | null | core/migrations/0051_auto_20190327_1220.py | mark-barrett/RESTBroker | d9b0a3574d2970443fdf40c70ab9ceb8d72614f4 | [
"MIT"
] | null | null | null | core/migrations/0051_auto_20190327_1220.py | mark-barrett/RESTBroker | d9b0a3574d2970443fdf40c70ab9ceb8d72614f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2019-03-27 12:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0050_auto_20190327_1216'),
]
operations = [
migrations.AlterUniqueTogether(... | 20.65 | 48 | 0.627119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.