hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7154188c1409f7ad80c6acf7c69384da06e644f | 4,384 | py | Python | jobChomper/graph.py | bhautikj/jobChomper | 09b50b3e14ab580a93376e4882214c18a8da34d5 | [
"MIT"
] | 1 | 2018-03-16T03:16:49.000Z | 2018-03-16T03:16:49.000Z | jobChomper/graph.py | bhautikj/jobChomper | 09b50b3e14ab580a93376e4882214c18a8da34d5 | [
"MIT"
] | null | null | null | jobChomper/graph.py | bhautikj/jobChomper | 09b50b3e14ab580a93376e4882214c18a8da34d5 | [
"MIT"
] | null | null | null | ##
## Weirdo Tree Graph that powers jobChomper
## --
##
## Assertions:
## * DAG is made up of named edges
## * Each edge is a triple (A, B, NEEDSPREVIOUSTOPASS)
## A, B are the named nodes
## B will execute after A has evaluated
## NEEDSPREVIOUSTOPASS is True or False; if it is True then A _must_ eval... | 28.842105 | 107 | 0.580748 | [-1]
for node in graph[top]:
if node in stack:
return stack[stack.index(node):]
if node in todo:
stack.append(node)
todo.remove(node)
break
else:
node = stack.pop()
return None
class Graph(object):
def __init__(self):
self.init = T... | true | true |
f715418cf642bd95568448dcaef9e2cf8c16dcc4 | 1,446 | py | Python | tests/00_unit/test_base.py | wolcomm/eos-prefix-list-agent | a1ec37494048f0f0524ca5ff985838d844c84e4e | [
"MIT"
] | 8 | 2019-06-02T23:47:38.000Z | 2021-08-24T07:30:08.000Z | tests/00_unit/test_base.py | wolcomm/eos-prefix-list-agent | a1ec37494048f0f0524ca5ff985838d844c84e4e | [
"MIT"
] | 39 | 2019-04-09T06:21:56.000Z | 2022-01-29T10:00:37.000Z | tests/00_unit/test_base.py | wolcomm/eos-prefix-list-agent | a1ec37494048f0f0524ca5ff985838d844c84e4e | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the MIT License
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | 37.076923 | 79 | 0.69018 |
from __future__ import print_function
import pytest
from prefix_list_agent.base import PrefixListBase
class TestPrefixListAgent(object):
def test_init(self, sdk, mocker):
mocker.patch("eossdk.Tracer", autospec=True)
base = PrefixListBase()
assert isinstance(base, PrefixListB... | true | true |
f71541e82fcb35f2b0c32b4abe7a90cb5afb6096 | 4,982 | py | Python | homeassistant/components/august/gateway.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | 1 | 2021-03-20T12:25:26.000Z | 2021-03-20T12:25:26.000Z | homeassistant/components/august/gateway.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | 51 | 2020-08-03T07:30:44.000Z | 2022-03-22T06:02:42.000Z | homeassistant/components/august/gateway.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | null | null | null | """Handle August connection setup and authentication."""
import asyncio
import logging
import os
from aiohttp import ClientError, ClientResponseError
from august.api_async import ApiAsync
from august.authenticator_async import AuthenticationState, AuthenticatorAsync
from homeassistant.const import (
CONF_PASSWOR... | 34.839161 | 110 | 0.66399 |
import asyncio
import logging
import os
from aiohttp import ClientError, ClientResponseError
from august.api_async import ApiAsync
from august.authenticator_async import AuthenticationState, AuthenticatorAsync
from homeassistant.const import (
CONF_PASSWORD,
CONF_TIMEOUT,
CONF_USERNAME,
HTTP_UNAUTHOR... | true | true |
f715431153040fc9d72aca7e7a4ab69f64467305 | 8,101 | py | Python | mv_gaussian/low_dim_w_summary_stats/run_script_snpla.py | SamuelWiqvist/snpla | 9d586c5d09de3eecd2536485af6fc28a915443e4 | [
"MIT"
] | 2 | 2021-02-17T14:13:54.000Z | 2021-06-01T08:29:35.000Z | mv_gaussian/low_dim_w_summary_stats/run_script_snpla.py | SamuelWiqvist/snpla | 9d586c5d09de3eecd2536485af6fc28a915443e4 | [
"MIT"
] | null | null | null | mv_gaussian/low_dim_w_summary_stats/run_script_snpla.py | SamuelWiqvist/snpla | 9d586c5d09de3eecd2536485af6fc28a915443e4 | [
"MIT"
] | null | null | null | # Imports
import sys
import torch
import os
import time
import numpy as np
from torch.distributions.multivariate_normal import MultivariateNormal
# Initial set up
lunarc = int(sys.argv[1])
dim = int(sys.argv[2])
seed = int(sys.argv[3])
seed_data = int(sys.argv[4])
hp_tuning = int(sys.argv[5]) # if hp_tuning = 0, no h... | 33.754167 | 125 | 0.627453 |
import sys
import torch
import os
import time
import numpy as np
from torch.distributions.multivariate_normal import MultivariateNormal
lunarc = int(sys.argv[1])
dim = int(sys.argv[2])
seed = int(sys.argv[3])
seed_data = int(sys.argv[4])
hp_tuning = int(sys.argv[5])
lambda_val = float(sys.argv[6])
print("Input ... | true | true |
f715435ca91863f52909480c8b9b5ef1a9fa028f | 3,048 | py | Python | alipay/aop/api/domain/AlipayUserCertDocIDCard.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserCertDocIDCard.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserCertDocIDCard.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserCertDocIDCard(object):
def __init__(self):
self._encoded_img_emblem = None
self._encoded_img_identity = None
self._expire_date = None
self.... | 30.178218 | 91 | 0.607612 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserCertDocIDCard(object):
def __init__(self):
self._encoded_img_emblem = None
self._encoded_img_identity = None
self._expire_date = None
self._name = None
self._number = None
... | true | true |
f71543f1283b285219a186f659bb0b4f1109d5be | 387 | py | Python | boost/inception/migrations/0006_auto_20190723_1445.py | igorMIA/bus_com_parser | 07de65f3106c302d96b5fd9dad89562de44ec63f | [
"MIT"
] | null | null | null | boost/inception/migrations/0006_auto_20190723_1445.py | igorMIA/bus_com_parser | 07de65f3106c302d96b5fd9dad89562de44ec63f | [
"MIT"
] | 12 | 2020-02-12T01:09:12.000Z | 2022-03-11T23:54:05.000Z | boost/inception/migrations/0006_auto_20190723_1445.py | igorMIA/bus_com_parser | 07de65f3106c302d96b5fd9dad89562de44ec63f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-23 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inception', '0005_auto_20190723_0810'),
]
operations = [
migrations.AlterField(
model_name='busstation',
name='cost'... | 20.368421 | 49 | 0.599483 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inception', '0005_auto_20190723_0810'),
]
operations = [
migrations.AlterField(
model_name='busstation',
name='cost',
field=models.FloatField(null=True... | true | true |
f715452e7dcf6d35a6ee975f8b79b14024d1e44c | 1,053 | py | Python | ProjectEulerPython/problems/problem_039.py | geo-desic/project-euler | 8065ee082a6948447ef961c9aa960c90a815a3ab | [
"MIT"
] | null | null | null | ProjectEulerPython/problems/problem_039.py | geo-desic/project-euler | 8065ee082a6948447ef961c9aa960c90a815a3ab | [
"MIT"
] | null | null | null | ProjectEulerPython/problems/problem_039.py | geo-desic/project-euler | 8065ee082a6948447ef961c9aa960c90a815a3ab | [
"MIT"
] | null | null | null | from problems.problem import Problem
def generate_pythagorean_triples(ub: int) -> []:
# https://en.wikipedia.org/wiki/Pythagorean_triple
result = []
for a in range(1, ub):
aa = a * a
b = a + 1
c = b + 1
while c <= ub:
cc = aa + b * b
while c * c < cc:
c += 1
if c * c == ... | 27 | 69 | 0.576448 | from problems.problem import Problem
def generate_pythagorean_triples(ub: int) -> []:
result = []
for a in range(1, ub):
aa = a * a
b = a + 1
c = b + 1
while c <= ub:
cc = aa + b * b
while c * c < cc:
c += 1
if c * c == cc and c <= ub:
result.append([a + b + c, ... | true | true |
f7154628c62314b11aa471a6abfc977dd15376a2 | 1,130 | py | Python | scripts/install_nightly.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 62 | 2018-03-30T15:46:56.000Z | 2021-12-08T23:30:24.000Z | scripts/install_nightly.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 114 | 2018-03-21T01:12:43.000Z | 2021-07-05T12:29:54.000Z | scripts/install_nightly.py | CDAT/uvcdat | 5133560c0c049b5c93ee321ba0af494253b44f91 | [
"BSD-3-Clause"
] | 14 | 2018-06-06T02:42:47.000Z | 2021-11-26T03:27:00.000Z | import sys
import os
import argparse
this_dir = os.path.abspath(os.path.dirname(__file__))
modules_dir = os.path.join(this_dir, '..', 'modules')
sys.path.append(modules_dir)
from Const import *
from Util import *
from CondaUtils import *
from CDATSetupUtils import *
valid_py_vers = PYTHON_VERSIONS
parser = argparse... | 23.061224 | 88 | 0.7 | import sys
import os
import argparse
this_dir = os.path.abspath(os.path.dirname(__file__))
modules_dir = os.path.join(this_dir, '..', 'modules')
sys.path.append(modules_dir)
from Const import *
from Util import *
from CondaUtils import *
from CDATSetupUtils import *
valid_py_vers = PYTHON_VERSIONS
parser = argparse... | true | true |
f715466767fcc3856809b3d312d0e597406be25b | 1,717 | py | Python | model/summaries.py | victor-estrade/SystGradDescent | 822e7094290301ec47a99433381a8d6406798aff | [
"MIT"
] | 2 | 2019-03-20T09:05:02.000Z | 2019-03-20T15:23:44.000Z | model/summaries.py | victor-estrade/SystGradDescent | 822e7094290301ec47a99433381a8d6406798aff | [
"MIT"
] | null | null | null | model/summaries.py | victor-estrade/SystGradDescent | 822e7094290301ec47a99433381a8d6406798aff | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
DEFAULT_N_BINS = 10
def compute_summaries(clf, X, W, n_bins=DEFAULT_N_BINS):
proba = clf.predict_proba(X)
count, _ = np.histo... | 30.122807 | 90 | 0.610367 |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
DEFAULT_N_BINS = 10
def compute_summaries(clf, X, W, n_bins=DEFAULT_N_BINS):
proba = clf.predict_proba(X)
count, _ = np.histogram(proba[:, 1... | true | true |
f71546b9ddaa47e3907f339c6e8a2f21aac12fe0 | 1,566 | py | Python | 14_Modulos_e_pacotes/ex110/moeda.py | TheCarvalho/Curso-Em-Video-Python | 8bd5128023ddf8b0f59eab46463c95e47569da73 | [
"Unlicense"
] | null | null | null | 14_Modulos_e_pacotes/ex110/moeda.py | TheCarvalho/Curso-Em-Video-Python | 8bd5128023ddf8b0f59eab46463c95e47569da73 | [
"Unlicense"
] | null | null | null | 14_Modulos_e_pacotes/ex110/moeda.py | TheCarvalho/Curso-Em-Video-Python | 8bd5128023ddf8b0f59eab46463c95e47569da73 | [
"Unlicense"
] | null | null | null | def metade(valor=0, formato=False):
res = valor/2
return res if formato is False else moeda(res)
def dobro(valor=0, formato=False):
res = valor*2
return res if formato is False else moeda(res)
def aumentar(valor=0, porcentagem=0, formato=False):
res = valor+(valor * porcentagem/100)
return r... | 31.32 | 101 | 0.650064 | def metade(valor=0, formato=False):
res = valor/2
return res if formato is False else moeda(res)
def dobro(valor=0, formato=False):
res = valor*2
return res if formato is False else moeda(res)
def aumentar(valor=0, porcentagem=0, formato=False):
res = valor+(valor * porcentagem/100)
return r... | true | true |
f71548f4a246b57a8868bfef6d1910128b7621d9 | 4,245 | py | Python | tools/ci_build/op_registration_validator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 669 | 2018-12-03T22:00:31.000Z | 2019-05-06T19:42:49.000Z | tools/ci_build/op_registration_validator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 440 | 2018-12-03T21:09:56.000Z | 2019-05-06T20:47:23.000Z | tools/ci_build/op_registration_validator.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 140 | 2018-12-03T21:15:28.000Z | 2019-05-06T18:02:36.000Z | # !/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
Validate ORT kernel registrations.
"""
import argparse
import os
import sys
import typing
import op_registration_utils
from logger import get_logger
log = get_logger("op_registration_validator")
... | 36.594828 | 117 | 0.659128 |
import argparse
import os
import sys
import typing
import op_registration_utils
from logger import get_logger
log = get_logger("op_registration_validator")
deprecated_ops = {
"kOnnxDomain:Scatter": 11,
"kOnnxDomain:Upsample": 10,
"kOnnxDomain:MeanVarianceNormalization": 9,
"... | true | true |
f7154930de7d5ffc6f439d636c13d83d490d8d16 | 1,853 | py | Python | src/users/models/microsoftgraphcalendar_permission.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/microsoftgraphcalendar_permission.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | src/users/models/microsoftgraphcalendar_permission.py | peombwa/Sample-Graph-Python-Client | 3396f531fbe6bb40a740767c4e31aee95a3b932e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 39.425532 | 131 | 0.622774 |
from msrest.serialization import Model
class MicrosoftgraphcalendarPermission(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'email_address': {'key': 'emailAddress', 'type': 'MicrosoftgraphemailAddress'},
'is_removable': {'key': 'isRemovable', 'type': 'bool'},
... | true | true |
f7154c78addf3f568945d3b47a10b93101d1a781 | 4,877 | py | Python | xadmin/plugins/passwords.py | jneight/django-xadmin | d5fca423e3ae10e3ca086e5ae9ea7068872f0a29 | [
"BSD-3-Clause"
] | null | null | null | xadmin/plugins/passwords.py | jneight/django-xadmin | d5fca423e3ae10e3ca086e5ae9ea7068872f0a29 | [
"BSD-3-Clause"
] | null | null | null | xadmin/plugins/passwords.py | jneight/django-xadmin | d5fca423e3ae10e3ca086e5ae9ea7068872f0a29 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.views import password_reset_confirm
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
fr... | 42.408696 | 183 | 0.710478 |
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.views import password_reset_confirm
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
from xadmin.site... | true | true |
f7154e6ded9574e14e9389f664090a3155de4514 | 18,588 | py | Python | Lib/idlelib/idle_test/test_pyparse.py | fongchinghinunsw/cpython | 19926d058dc33856631c6c6b3fcb45b04fcab666 | [
"CNRI-Python-GPL-Compatible"
] | 120 | 2019-11-12T19:22:44.000Z | 2020-05-17T12:17:25.000Z | Lib/idlelib/idle_test/test_pyparse.py | fongchinghinunsw/cpython | 19926d058dc33856631c6c6b3fcb45b04fcab666 | [
"CNRI-Python-GPL-Compatible"
] | 19 | 2021-02-18T05:59:03.000Z | 2022-01-13T01:00:52.000Z | Lib/idlelib/idle_test/test_pyparse.py | fongchinghinunsw/cpython | 19926d058dc33856631c6c6b3fcb45b04fcab666 | [
"CNRI-Python-GPL-Compatible"
] | 18 | 2021-02-22T13:32:56.000Z | 2022-01-22T12:38:29.000Z | "Test pyparse, coverage 96%."
from idlelib import pyparse
import unittest
from collections import namedtuple
class ParseMapTest(unittest.TestCase):
def test_parsemap(self):
keepwhite = {ord(c): ord(c) for c in ' \t\n\r'}
mapping = pyparse.ParseMap(keepwhite)
self.assertEqual(mapping[ord(... | 39.802998 | 84 | 0.48074 |
from idlelib import pyparse
import unittest
from collections import namedtuple
class ParseMapTest(unittest.TestCase):
def test_parsemap(self):
keepwhite = {ord(c): ord(c) for c in ' \t\n\r'}
mapping = pyparse.ParseMap(keepwhite)
self.assertEqual(mapping[ord('\t')], ord('\t'))
sel... | true | true |
f715502ca425f6aa72c39448be881ca66c5df2be | 1,703 | py | Python | game.py | zty111/tonghua | 71b0ecc857f72ab9bb7882358c15587117cdcd6a | [
"MIT"
] | null | null | null | game.py | zty111/tonghua | 71b0ecc857f72ab9bb7882358c15587117cdcd6a | [
"MIT"
] | null | null | null | game.py | zty111/tonghua | 71b0ecc857f72ab9bb7882358c15587117cdcd6a | [
"MIT"
] | null | null | null | from keras.saving.save import load_model
from board import GameState, Player
from encoder import Encoder
from agent import Agent
import scoring
from board import Move, Point
from tiaocan import bot_name
class My():
def select_move(self, game_state):
print("请输入点坐标和方向(或弃权):")
x, y, d = input().split(... | 28.864407 | 99 | 0.664709 | from keras.saving.save import load_model
from board import GameState, Player
from encoder import Encoder
from agent import Agent
import scoring
from board import Move, Point
from tiaocan import bot_name
class My():
def select_move(self, game_state):
print("请输入点坐标和方向(或弃权):")
x, y, d = input().split(... | true | true |
f715517d413224bd0e232c087a3dc3de8fac5148 | 2,409 | py | Python | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | DATA/10_64_64_64_1E7/analy.py | Aieener/SUS_3D | 8fc5a768a2339238939522baf96bce98bf61902e | [
"MIT"
] | null | null | null | # analy.py
# A python program to analyze the SUS weighting function in order to reach the following goals:
# 1. plot the weight function
# 2. generate the normalized distribution for Z=1
# 3. extrapolate the N distribution for different Zs given by the user.
# Author: Yuding Ai
# Date: 2015 Oct 23
import math
import n... | 23.38835 | 95 | 0.632213 |
import math
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib import rc
Palatino']})
rc('text', usetex=True)
def PN():
WF = []
PN = []
with open("SUSWeight_function.txt","r") as file:
for line in file:
words = line.split()
n = float(words[0])
W... | true | true |
f71552f33127dfdd46d5834de303cbaed5612835 | 1,326 | py | Python | asset/lambda/index.py | jialechan/cdk-elasticache-monitor | 584d1f583e934e32d80f1abea7fdc100c226b348 | [
"Apache-2.0"
] | 1 | 2020-07-27T09:15:41.000Z | 2020-07-27T09:15:41.000Z | asset/lambda/index.py | jialechan/cdk-elasticache-monitor | 584d1f583e934e32d80f1abea7fdc100c226b348 | [
"Apache-2.0"
] | 509 | 2020-08-04T07:02:41.000Z | 2022-03-28T15:05:51.000Z | asset/lambda/index.py | jialechan/cdk-elasticache-monitor | 584d1f583e934e32d80f1abea7fdc100c226b348 | [
"Apache-2.0"
] | 1 | 2020-08-28T01:13:15.000Z | 2020-08-28T01:13:15.000Z | import os
import json
import time
import urllib.parse
import urllib.request
def handler(event, context):
"""
alarm to slack
"""
print(json.dumps(event))
slack_webhook_url = os.environ['SLACK_WEBHOOK_URL']
channel = os.environ['CHANNEL']
username = os.environ['USERNAME']
icon_emoji = ... | 28.826087 | 100 | 0.585973 | import os
import json
import time
import urllib.parse
import urllib.request
def handler(event, context):
print(json.dumps(event))
slack_webhook_url = os.environ['SLACK_WEBHOOK_URL']
channel = os.environ['CHANNEL']
username = os.environ['USERNAME']
icon_emoji = os.environ['ICON_EMOJI']
for r... | true | true |
f715530ab61caacad8fa0ce7435869a1c5c114aa | 417 | py | Python | codestorm_e_learning/asgi.py | Sahiladiv/PSST_CSHTN-08 | 0cd4a5b27f16d17a410b1e7cd2596038925f7070 | [
"MIT"
] | null | null | null | codestorm_e_learning/asgi.py | Sahiladiv/PSST_CSHTN-08 | 0cd4a5b27f16d17a410b1e7cd2596038925f7070 | [
"MIT"
] | null | null | null | codestorm_e_learning/asgi.py | Sahiladiv/PSST_CSHTN-08 | 0cd4a5b27f16d17a410b1e7cd2596038925f7070 | [
"MIT"
] | null | null | null | """
ASGI config for codestorm_e_learning 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(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'codestorm_e_learning.settings')
application = get_asgi_application()
| true | true |
f71553a353729b9fcc5938672ff20758e7d08a89 | 1,886 | py | Python | ramjet/data_interface/tess_eclipsing_binary_metadata_manager.py | golmschenk/ramjet | 77fb4481a15088923308fda09804d80455d1a9cf | [
"Apache-2.0"
] | 3 | 2020-11-23T18:47:37.000Z | 2021-08-05T17:45:51.000Z | ramjet/data_interface/tess_eclipsing_binary_metadata_manager.py | golmschenk/ramjet | 77fb4481a15088923308fda09804d80455d1a9cf | [
"Apache-2.0"
] | 5 | 2021-08-19T00:54:57.000Z | 2022-02-10T00:15:40.000Z | ramjet/data_interface/tess_eclipsing_binary_metadata_manager.py | golmschenk/ramjet | 77fb4481a15088923308fda09804d80455d1a9cf | [
"Apache-2.0"
] | 3 | 2019-07-12T21:00:57.000Z | 2020-06-03T22:18:13.000Z | """
Code for managing the TESS eclipsing binary metadata.
"""
import pandas as pd
from pathlib import Path
from peewee import IntegerField, SchemaManager
from ramjet.data_interface.metadatabase import MetadatabaseModel, metadatabase
brian_powell_eclipsing_binary_csv_path = Path('data/tess_eclipsing_binaries/TESS_EB_... | 34.925926 | 105 | 0.696713 | import pandas as pd
from pathlib import Path
from peewee import IntegerField, SchemaManager
from ramjet.data_interface.metadatabase import MetadatabaseModel, metadatabase
brian_powell_eclipsing_binary_csv_path = Path('data/tess_eclipsing_binaries/TESS_EB_catalog_23Jun.csv')
class TessEclipsingBinaryMetadata(Metada... | true | true |
f715544b39ad2bd0403cdd0c656584e7498e39cb | 508 | py | Python | instagram_profile/settings.py | barseghyanartur/django-instagram-profile | 1bb36551114d26e7c75f0ddf8f79db68fc02101e | [
"BSD-3-Clause"
] | 1 | 2020-12-03T22:01:27.000Z | 2020-12-03T22:01:27.000Z | instagram_profile/settings.py | barseghyanartur/django-instagram-profile | 1bb36551114d26e7c75f0ddf8f79db68fc02101e | [
"BSD-3-Clause"
] | null | null | null | instagram_profile/settings.py | barseghyanartur/django-instagram-profile | 1bb36551114d26e7c75f0ddf8f79db68fc02101e | [
"BSD-3-Clause"
] | null | null | null | from configparser import RawConfigParser
from django.conf import settings
env = RawConfigParser()
env.read(settings.BASE_DIR + '/env.ini')
INSTAGRAM_ACCOUNT = env['instagram']['account']
INSTAGRAM_AUTH_URL = env['instagram']['auth_url']
INSTAGRAM_ACCESS_TOKEN_URL = env['instagram']['access_token_url']
INSTAGRAM_APP_... | 33.866667 | 65 | 0.775591 | from configparser import RawConfigParser
from django.conf import settings
env = RawConfigParser()
env.read(settings.BASE_DIR + '/env.ini')
INSTAGRAM_ACCOUNT = env['instagram']['account']
INSTAGRAM_AUTH_URL = env['instagram']['auth_url']
INSTAGRAM_ACCESS_TOKEN_URL = env['instagram']['access_token_url']
INSTAGRAM_APP_... | true | true |
f715555b72413c60a579b8d7d74d37a54ae765af | 1,832 | py | Python | sorting/merge-sort-recursive.py | thehimalayanleo/Algorithm-Practice | aa63d90de7a3a72910ead1017574e2cca485009f | [
"MIT"
] | null | null | null | sorting/merge-sort-recursive.py | thehimalayanleo/Algorithm-Practice | aa63d90de7a3a72910ead1017574e2cca485009f | [
"MIT"
] | null | null | null | sorting/merge-sort-recursive.py | thehimalayanleo/Algorithm-Practice | aa63d90de7a3a72910ead1017574e2cca485009f | [
"MIT"
] | null | null | null | ## A recursive implementation of merge sort.
## Author: AJ
## test case 1 45 849 904 79 48942 7
class sorting:
def __init__(self):
self.arr = []
def get_data(self):
self.arr = list(map(int, input().split()))
return self.arr
def merge_sort(self, array):
if len(array) == 1:
... | 29.548387 | 74 | 0.554039 | self.arr = list(map(int, input().split()))
return self.arr
def merge_sort(self, array):
if len(array) == 1:
return array
mid = len(array)//2
left = self.merge_sort(array[:mid])
right = self.merge_sort(array[mid:])
left_indx = 0
... | true | true |
f71555608a70f602ee61e7b668ed75d79fe49531 | 2,393 | py | Python | pynmodl/tests/parsing/test_scoping.py | tjbanks/pynmodl | b7d6bb378711ce19cd651561c08146e3571d986a | [
"MIT"
] | 9 | 2017-06-03T19:33:46.000Z | 2019-10-27T22:19:37.000Z | pynmodl/tests/parsing/test_scoping.py | tjbanks/pynmodl | b7d6bb378711ce19cd651561c08146e3571d986a | [
"MIT"
] | 11 | 2017-10-13T16:09:10.000Z | 2019-05-08T16:37:11.000Z | pynmodl/tests/parsing/test_scoping.py | tjbanks/pynmodl | b7d6bb378711ce19cd651561c08146e3571d986a | [
"MIT"
] | 2 | 2017-08-29T14:29:45.000Z | 2019-12-31T19:45:02.000Z | import os
from textx.metamodel import metamodel_from_file
from textx.model import children_of_type
from pynmodl.nmodl import NModlCompiler
mm = metamodel_from_file(
os.path.join(os.path.dirname(__file__), '../../grammar/nmodl.tx'))
mm.register_obj_processors({'VarRef': NModlCompiler().handle_varref})
def refs_in... | 26.588889 | 70 | 0.55328 | import os
from textx.metamodel import metamodel_from_file
from textx.model import children_of_type
from pynmodl.nmodl import NModlCompiler
mm = metamodel_from_file(
os.path.join(os.path.dirname(__file__), '../../grammar/nmodl.tx'))
mm.register_obj_processors({'VarRef': NModlCompiler().handle_varref})
def refs_in... | true | true |
f715558281aaabbc79dcce8d745a1065f13cec44 | 27,919 | py | Python | chalice/cli/__init__.py | sw33tr0ll/chalice | 8c48771ef0fe2ae97a00e337ca5828e709b132d3 | [
"Apache-2.0"
] | 1 | 2020-12-19T07:34:28.000Z | 2020-12-19T07:34:28.000Z | chalice/cli/__init__.py | sw33tr0ll/chalice | 8c48771ef0fe2ae97a00e337ca5828e709b132d3 | [
"Apache-2.0"
] | 1 | 2020-12-20T21:08:52.000Z | 2020-12-20T21:08:52.000Z | chalice/cli/__init__.py | sw33tr0ll/chalice | 8c48771ef0fe2ae97a00e337ca5828e709b132d3 | [
"Apache-2.0"
] | null | null | null | """Command line interface for chalice.
Contains commands for deploying chalice.
"""
import logging
import os
import platform
import sys
import tempfile
import shutil
import traceback
import functools
import json
import botocore.exceptions
import click
from typing import Dict, Any, Optional, cast # noqa
from chalic... | 41.732436 | 79 | 0.647767 | import logging
import os
import platform
import sys
import tempfile
import shutil
import traceback
import functools
import json
import botocore.exceptions
import click
from typing import Dict, Any, Optional, cast
from chalice import __version__ as chalice_version
from chalice.app import Chalice
from chalice.awscl... | true | true |
f715566e418c809bc95f0d6c57bc79a0f14a15b4 | 1,920 | py | Python | nanobox_libcloud/tasks/azure_arm.py | mu-box/nanobox-adapter-libcloud | a8606799a4899c3e771f24467b61cc09a49f0d55 | [
"MIT"
] | 4 | 2017-08-26T16:26:02.000Z | 2017-11-10T02:20:32.000Z | nanobox_libcloud/tasks/azure_arm.py | mu-box/nanobox-adapter-libcloud | a8606799a4899c3e771f24467b61cc09a49f0d55 | [
"MIT"
] | 9 | 2017-09-12T20:26:07.000Z | 2019-04-01T18:08:28.000Z | nanobox_libcloud/tasks/azure_arm.py | mu-box/nanobox-adapter-libcloud | a8606799a4899c3e771f24467b61cc09a49f0d55 | [
"MIT"
] | 7 | 2017-09-16T09:00:48.000Z | 2021-03-01T04:28:39.000Z | from nanobox_libcloud import celery
from nanobox_libcloud import adapters
from time import sleep
import logging
@celery.task
def azure_destroy_arm(creds, name):
logger = logging.getLogger(__name__)
self = adapters.azure_arm.AzureARM()
driver = self._get_user_driver(**creds)
logger.info('Destroying se... | 36.226415 | 80 | 0.519792 | from nanobox_libcloud import celery
from nanobox_libcloud import adapters
from time import sleep
import logging
@celery.task
def azure_destroy_arm(creds, name):
logger = logging.getLogger(__name__)
self = adapters.azure_arm.AzureARM()
driver = self._get_user_driver(**creds)
logger.info('Destroying se... | true | true |
f715567b1c04fc53d84059088a5b453d461d55e7 | 1,293 | py | Python | airbyte-integrations/connectors/source-hubspot/main_dev.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-03-02T09:17:41.000Z | 2021-03-02T11:02:23.000Z | airbyte-integrations/connectors/source-hubspot/main_dev.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 52 | 2021-06-11T12:39:05.000Z | 2022-03-30T04:59:35.000Z | airbyte-integrations/connectors/source-hubspot/main_dev.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-12-14T17:15:40.000Z | 2021-12-14T17:18:03.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, merge, pu... | 38.029412 | 80 | 0.771075 |
import sys
from base_python.entrypoint import launch
from source_hubspot import SourceHubspot
if __name__ == "__main__":
source = SourceHubspot()
launch(source, sys.argv[1:])
| true | true |
f7155888da8319908c50672d71d366b286e97a8a | 8,907 | py | Python | apis/nb/clients/inventory_manager_client/models/LicenseInfoDTO.py | CiscoDevNet/APIC-EM-Generic-Scripts- | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 45 | 2016-06-09T15:41:25.000Z | 2019-08-06T17:13:11.000Z | apis/nb/clients/inventory_manager_client/models/LicenseInfoDTO.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2016-06-12T03:03:56.000Z | 2017-03-13T18:20:11.000Z | apis/nb/clients/inventory_manager_client/models/LicenseInfoDTO.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-06-22T03:51:37.000Z | 2019-07-10T10:06:02.000Z | #!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class LicenseInfoDTO(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the v... | 27.072948 | 145 | 0.461659 |
class LicenseInfoDTO(object):
def __init__(self):
self.swaggerTypes = {
'name': 'str',
'priority': 'str',
'type': 'str',
'description': 'str',
... | true | true |
f715593dca93c7ea7889b286ec0ff7c88525f4e6 | 6,383 | py | Python | flowvision/models/style_transfer/stylenet.py | Oneflow-Inc/vision | 352e9240f63118112ea174bb2d0b502fa54be16f | [
"BSD-3-Clause"
] | 40 | 2021-10-19T02:34:56.000Z | 2022-03-25T07:49:44.000Z | flowvision/models/style_transfer/stylenet.py | Oneflow-Inc/vision | 352e9240f63118112ea174bb2d0b502fa54be16f | [
"BSD-3-Clause"
] | 53 | 2021-10-22T02:24:44.000Z | 2022-03-31T04:20:47.000Z | flowvision/models/style_transfer/stylenet.py | Oneflow-Inc/vision | 352e9240f63118112ea174bb2d0b502fa54be16f | [
"BSD-3-Clause"
] | 11 | 2022-01-06T02:57:07.000Z | 2022-03-23T15:19:51.000Z | """
Modified from https://github.com/Oneflow-Inc/models/blob/main/Vision/style_transform/fast_neural_style/neural_style/transformer_net.py
"""
from typing import Any
import oneflow as flow
from ..registry import ModelCreator
from ..utils import load_state_dict_from_url
__all__ = ["FastNeuralStyle", "fast_neural_sty... | 39.159509 | 186 | 0.675858 | from typing import Any
import oneflow as flow
from ..registry import ModelCreator
from ..utils import load_state_dict_from_url
__all__ = ["FastNeuralStyle", "fast_neural_style"]
style_model_urls = {
"sketch": "https://oneflow-public.oss-cn-beijing.aliyuncs.com/model_zoo/flowvision/neural_style_transfer/sketch... | true | true |
f71559ccbf89d77b0fb702498ba29b015dc7c215 | 3,597 | py | Python | examples/pytorch/nlp/huggingface_models/common/tests/test_tokenization_small_blenderbot.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | examples/pytorch/nlp/huggingface_models/common/tests/test_tokenization_small_blenderbot.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | examples/pytorch/nlp/huggingface_models/common/tests/test_tokenization_small_blenderbot.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | #!/usr/bin/env python3
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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/LICENS... | 41.344828 | 108 | 0.687517 |
import json
import os
import unittest
from transformers.models.blenderbot_small.tokenization_blenderbot_small import (
VOCAB_FILES_NAMES,
BlenderbotSmallTokenizer,
)
from .test_tokenization_common import TokenizerTesterMixin
class BlenderbotSmallTokenizerTest(TokenizerTesterMixin, unittest.Te... | true | true |
f71559da0abd1737aa33927ca6ae4d82a909ed60 | 1,426 | py | Python | enable-s3-encryption.py | thilinajayanath/s3-server-side-encryption | b1de6cc2785825df0c6f6769ff0693edd5d2e5f6 | [
"MIT"
] | null | null | null | enable-s3-encryption.py | thilinajayanath/s3-server-side-encryption | b1de6cc2785825df0c6f6769ff0693edd5d2e5f6 | [
"MIT"
] | null | null | null | enable-s3-encryption.py | thilinajayanath/s3-server-side-encryption | b1de6cc2785825df0c6f6769ff0693edd5d2e5f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import boto3
from botocore.exceptions import ClientError
parser = argparse.ArgumentParser(description='Check all S3 buckets in the AWS account and enables default encryption with AES256')
parser.add_argument('aws_account_name', type=str, help='Named AWS user account')
args = pa... | 36.564103 | 170 | 0.718093 |
import argparse
import boto3
from botocore.exceptions import ClientError
parser = argparse.ArgumentParser(description='Check all S3 buckets in the AWS account and enables default encryption with AES256')
parser.add_argument('aws_account_name', type=str, help='Named AWS user account')
args = parser.parse_args()
ses... | true | true |
f7155a0bc67e529b57bf0704543609089406c58a | 1,557 | py | Python | a1/__init__.py | o-ran-sc/ric-plt-a1 | 902771612ffcf0541ea27dce35eb6f20bf885cf3 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | a1/__init__.py | o-ran-sc/ric-plt-a1 | 902771612ffcf0541ea27dce35eb6f20bf885cf3 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | a1/__init__.py | o-ran-sc/ric-plt-a1 | 902771612ffcf0541ea27dce35eb6f20bf885cf3 | [
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2020-05-24T05:51:03.000Z | 2021-08-23T07:21:49.000Z | # ==================================================================================
# Copyright (c) 2019 Nokia
# Copyright (c) 2018-2019 AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 42.081081 | 84 | 0.659602 |
import connexion
from prometheus_client import CollectorRegistry, generate_latest, multiprocess
app = connexion.App(__name__, specification_dir=".")
app.add_api("openapi.yaml", arguments={"title": "My Title"})
@app.app.route('/a1-p/metrics', methods=['GET'])
def metrics():
# hence it's a... | true | true |
f7155a5748b43f2a16ce87a6c062feb7b20551ab | 234 | py | Python | cieloApi3/__init__.py | thiagosm/API-3.0-Python | 2fab59d5e0ce7191d3c458e8fab9b1d3c6298748 | [
"MIT"
] | null | null | null | cieloApi3/__init__.py | thiagosm/API-3.0-Python | 2fab59d5e0ce7191d3c458e8fab9b1d3c6298748 | [
"MIT"
] | null | null | null | cieloApi3/__init__.py | thiagosm/API-3.0-Python | 2fab59d5e0ce7191d3c458e8fab9b1d3c6298748 | [
"MIT"
] | null | null | null | from .environment import *
from .merchant import *
from .sale import *
from .customer import *
from .creditCard import *
from .debitCard import *
from .payment import *
from .recurrentPayment import *
from .cieloEcommerce import *
| 18 | 31 | 0.75641 | from .environment import *
from .merchant import *
from .sale import *
from .customer import *
from .creditCard import *
from .debitCard import *
from .payment import *
from .recurrentPayment import *
from .cieloEcommerce import *
| true | true |
f7155a7ee909d8a5c4d0f88e8722b5abeabb44e3 | 13,929 | py | Python | google/ads/google_ads/v3/proto/services/asset_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v3/proto/services/asset_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/proto/services/asset_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v3/proto/services/asset_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 41.332344 | 1,840 | 0.77414 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f7155b122a1e35ce2adb4b96a2aadaade4b5777f | 567 | py | Python | center/app/playback/parsers/ip_parser.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | null | null | null | center/app/playback/parsers/ip_parser.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | 3 | 2021-05-10T13:50:55.000Z | 2022-03-02T08:12:46.000Z | center/app/playback/parsers/ip_parser.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | null | null | null | import dpkt
from parsers.utils import *
name = 'ip_parser'
def parseFunc(ts, eth):
if getMACString(eth.dst) == 'FF:FF:FF:FF:FF:FF':
return None
if isinstance(eth.data, dpkt.ip.IP):
return parseIPPacket(ts, eth)
def parseIPPacket(ts, eth):
ip = eth.data
tpa = getIPString(ip.dst)
t... | 21.807692 | 59 | 0.527337 | import dpkt
from parsers.utils import *
name = 'ip_parser'
def parseFunc(ts, eth):
if getMACString(eth.dst) == 'FF:FF:FF:FF:FF:FF':
return None
if isinstance(eth.data, dpkt.ip.IP):
return parseIPPacket(ts, eth)
def parseIPPacket(ts, eth):
ip = eth.data
tpa = getIPString(ip.dst)
t... | true | true |
f7155c6b7863bc6529f4f6f16e61fb8e883beed8 | 6,035 | py | Python | pandas_study/PandasTest.py | BreezeDawn/numpy-pandas-matplotlib- | e55dccb2442e57c2fccb2081966a7c19e731083a | [
"MIT"
] | null | null | null | pandas_study/PandasTest.py | BreezeDawn/numpy-pandas-matplotlib- | e55dccb2442e57c2fccb2081966a7c19e731083a | [
"MIT"
] | null | null | null | pandas_study/PandasTest.py | BreezeDawn/numpy-pandas-matplotlib- | e55dccb2442e57c2fccb2081966a7c19e731083a | [
"MIT"
] | 1 | 2018-10-24T07:33:51.000Z | 2018-10-24T07:33:51.000Z | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def base():
index = pd.date_range('20181023', periods=9) # 生成9个行索引
column = ['a', 'b', 'c', 'd'] # 生成4个列索引
a = np.random.randn(9, 4) # 随便生成的9行4列的数据
df = pd.DataFrame(a, index=index, columns=column)
print(df)
print(pd.Dat... | 35.922619 | 136 | 0.566031 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def base():
index = pd.date_range('20181023', periods=9)
column = ['a', 'b', 'c', 'd']
a = np.random.randn(9, 4)
df = pd.DataFrame(a, index=index, columns=column)
print(df)
print(pd.DataFrame(np.arange(9).reshape((3, ... | true | true |
f7155cefed90acb6d45f43fe242cbb9b2848c3cd | 5,649 | py | Python | recognition/ArcFace/sample_config.py | santapo/insightface | d61b09938bce244c4f775cee1d9d76ff641b7b0c | [
"MIT"
] | null | null | null | recognition/ArcFace/sample_config.py | santapo/insightface | d61b09938bce244c4f775cee1d9d76ff641b7b0c | [
"MIT"
] | null | null | null | recognition/ArcFace/sample_config.py | santapo/insightface | d61b09938bce244c4f775cee1d9d76ff641b7b0c | [
"MIT"
] | null | null | null | import numpy as np
import os
from easydict import EasyDict as edict
config = edict()
config.bn_mom = 0.9
config.workspace = 256
config.emb_size = 512
config.ckpt_embedding = True
config.net_se = 0
config.net_act = 'prelu'
config.net_unit = 3
config.net_input = 1
config.net_blocks = [1, 4, 6, 2]
config.net_output = 'E... | 25.561086 | 63 | 0.738007 | import numpy as np
import os
from easydict import EasyDict as edict
config = edict()
config.bn_mom = 0.9
config.workspace = 256
config.emb_size = 512
config.ckpt_embedding = True
config.net_se = 0
config.net_act = 'prelu'
config.net_unit = 3
config.net_input = 1
config.net_blocks = [1, 4, 6, 2]
config.net_output = 'E... | true | true |
f7155df326b76283c65218da1b03afe376a21473 | 540 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/wonderworks-33344 | 42cb504b280e4ad33598ae0d5ac64f8654e28205 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/wonderworks-33344 | 42cb504b280e4ad33598ae0d5ac64f8654e28205 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/wonderworks-33344 | 42cb504b280e4ad33598ae0d5ac64f8654e28205 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "wonderworks-33344.botics.co"
site_params = {
"name": "Wonderworks",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_... | 20.769231 | 61 | 0.659259 | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "wonderworks-33344.botics.co"
site_params = {
"name": "Wonderworks",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_... | true | true |
f7155e52ae7e7e0208d80c721374978ecf74f3d8 | 6,483 | py | Python | src/HCTool-sg-1.py | iShog/huaweicloudTool | 56b231d4707570e7690b68d31b3bfd8920e995bc | [
"MIT"
] | null | null | null | src/HCTool-sg-1.py | iShog/huaweicloudTool | 56b231d4707570e7690b68d31b3bfd8920e995bc | [
"MIT"
] | null | null | null | src/HCTool-sg-1.py | iShog/huaweicloudTool | 56b231d4707570e7690b68d31b3bfd8920e995bc | [
"MIT"
] | null | null | null | # coding: utf-8
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.http.http_config import HttpConfig
"""
# 导入指定云服务的库 huaweicloudsdk{service}
"""
from huaweicloudsdkvpc.v2 import *
from huaweicloudsdkvpc.v2.region.vpc_region imp... | 29.334842 | 114 | 0.637051 |
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.http.http_config import HttpConfig
from huaweicloudsdkvpc.v2 import *
from huaweicloudsdkvpc.v2.region.vpc_region import VpcRegion
from urllib.request import urlopen
from json... | true | true |
f7155f2dc872416bc9d84bdcf46fa337e5c2a7ff | 2,567 | py | Python | aiida/orm/nodes/data/base.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | aiida/orm/nodes/data/base.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | aiida/orm/nodes/data/base.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 32.910256 | 106 | 0.586287 | true | true | |
f7155fab8edcad4a0881545f1487a35076b0b70c | 1,983 | py | Python | matchms/exporting/save_as_json.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | matchms/exporting/save_as_json.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | matchms/exporting/save_as_json.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | import json
from typing import List
import numpy
from ..Spectrum import Spectrum
def save_as_json(spectrums: List[Spectrum], filename: str):
"""Save spectrum(s) as json file.
:py:attr:`~matchms.Spectrum.losses` of spectrum will not be saved.
Example:
.. code-block:: python
import numpy
... | 33.610169 | 91 | 0.606657 | import json
from typing import List
import numpy
from ..Spectrum import Spectrum
def save_as_json(spectrums: List[Spectrum], filename: str):
if not isinstance(spectrums, list):
spectrums = [spectrums]
with open(filename, 'w', encoding="utf-8") as fout:
json.dump(spectrums, fout,... | true | true |
f7156064ea7c64a030e87c3aff9f1fc1fc6f9c9f | 455 | py | Python | cvat/apps/git/migrations/0002_auto_20190123_1305.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 2 | 2020-03-16T03:41:27.000Z | 2020-03-16T03:53:01.000Z | cvat/apps/git/migrations/0002_auto_20190123_1305.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 29 | 2020-01-28T23:08:18.000Z | 2022-03-12T00:05:33.000Z | cvat/apps/git/migrations/0002_auto_20190123_1305.py | raunilillemets/cvat | c083b5d3a60270121abc3f3fe596ff94ae0eb60f | [
"MIT"
] | 7 | 2021-07-27T09:15:22.000Z | 2022-03-29T21:20:00.000Z | # Generated by Django 2.1.3 on 2019-01-23 10:05
import cvat.apps.git.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('git', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='gitdata',
nam... | 22.75 | 105 | 0.621978 |
import cvat.apps.git.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('git', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='gitdata',
name='status',
field=models.CharField(... | true | true |
f71560690c6142fd8314899effc45720b4df6fdb | 1,016 | py | Python | Instagram/urls.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | Instagram/urls.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | Instagram/urls.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | """instagram URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 37.62963 | 79 | 0.687992 | from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('clone.urls')),
url(r'^', include('registration.backends.simple.urls')),
url(r'^logout/$', views.logout, {"next_page": '/'}... | true | true |
f7156125912203ecb4aa0ec75b8a4e46334dc991 | 7,299 | py | Python | setuper desktop app/gui/mainwindow/menubar.py | dragondjf/CloudSetuper | 31aefe629f7f2d59d287981eda3e4e618ace9e9f | [
"MIT"
] | 22 | 2015-01-08T12:54:20.000Z | 2021-05-16T04:15:45.000Z | setuper desktop app/gui/mainwindow/menubar.py | dragondjf/CloudSetuper | 31aefe629f7f2d59d287981eda3e4e618ace9e9f | [
"MIT"
] | null | null | null | setuper desktop app/gui/mainwindow/menubar.py | dragondjf/CloudSetuper | 31aefe629f7f2d59d287981eda3e4e618ace9e9f | [
"MIT"
] | 11 | 2015-01-25T01:26:45.000Z | 2021-08-18T01:40:40.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from .guiconfig import collectView
class MenuBar(QtWidgets.QMenuBar):
viewID = "MenuBar"
@collectView
def __init__(self, parent):
super(MenuBar, self).__init__()
self.p... | 35.779412 | 76 | 0.307028 |
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from .guiconfig import collectView
class MenuBar(QtWidgets.QMenuBar):
viewID = "MenuBar"
@collectView
def __init__(self, parent):
super(MenuBar, self).__init__()
self.parent = parent
self.actionlists ... | true | true |
f715614c9c22bf521a77e23832bea7384f69ed20 | 729 | py | Python | var/spack/repos/builtin/packages/smartmontools/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/smartmontools/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/smartmontools/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Smartmontools(AutotoolsPackage):
"""S.M.A.R.T. utility toolset."""
homepage =... | 36.45 | 113 | 0.742112 |
from spack.package import *
class Smartmontools(AutotoolsPackage):
homepage = "https://smartmontools.sourceforge.net"
url = "https://nchc.dl.sourceforge.net/project/smartmontools/smartmontools/6.6/smartmontools-6.6.tar.gz"
version('6.6', sha256='51f43d0fb064fccaf823bbe68cf0d317d0895ff895aa353b... | true | true |
f71563894bd2d01be507073cac15fd01a629492a | 201,289 | py | Python | pyfakefs/fake_filesystem.py | jcwilson/pyfakefs | 95f15b7de426f6f6c75181f6d06abb6a75bba668 | [
"Apache-2.0"
] | null | null | null | pyfakefs/fake_filesystem.py | jcwilson/pyfakefs | 95f15b7de426f6f6c75181f6d06abb6a75bba668 | [
"Apache-2.0"
] | null | null | null | pyfakefs/fake_filesystem.py | jcwilson/pyfakefs | 95f15b7de426f6f6c75181f6d06abb6a75bba668 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009 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 ... | 39.383487 | 80 | 0.605801 |
import errno
import heapq
import io
import locale
import os
import sys
import time
import uuid
from collections import namedtuple
from stat import (
S_IFREG, S_IFDIR, S_ISLNK, S_IFMT, S_ISDIR, S_IFLNK, S_ISREG, S_IFSOCK
)
from pyfakefs.deprecator import Deprecator
from pyfakefs.extra_packages import ... | true | true |
f71563a5ae0890e106de48a27661337660c13119 | 5,139 | py | Python | Lib/wsgiref/simple_server.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 11,058 | 2018-05-29T07:40:06.000Z | 2022-03-31T11:38:42.000Z | Lib/wsgiref/simple_server.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 2,105 | 2018-06-01T10:07:16.000Z | 2022-03-31T14:56:42.000Z | Lib/wsgiref/simple_server.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 914 | 2018-07-27T09:36:14.000Z | 2022-03-31T19:56:34.000Z | """BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
however, and w... | 31.145455 | 79 | 0.627359 |
from http.server import BaseHTTPRequestHandler, HTTPServer
import sys
import urllib.parse
from wsgiref.handlers import SimpleHandler
from platform import python_implementation
__version__ = "0.2"
__all__ = ['WSGIServer', 'WSGIRequestHandler', 'demo_app', 'make_server']
server_version = "WSGIServer/" + __version__
s... | true | true |
f71563a970e54d91f082ae73af7abad4a8b23fdf | 205 | py | Python | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | exe.curso em video/def 20.py | Lorenzo-Lopes/Python-Estudo | 7ee623ce29b6a0e9fac48189fbd9c641be84d418 | [
"MIT"
] | null | null | null | import random
n1 = str(input('nome 1='))
n2 = str(input('nome 2='))
n3 = str(input('nome 3='))
n4 = str(input('nome 4='))
lista = [n1, n2, n3, n4]
random.shuffle(lista)
print('nova ordem{}'.format(lista))
| 22.777778 | 35 | 0.62439 | import random
n1 = str(input('nome 1='))
n2 = str(input('nome 2='))
n3 = str(input('nome 3='))
n4 = str(input('nome 4='))
lista = [n1, n2, n3, n4]
random.shuffle(lista)
print('nova ordem{}'.format(lista))
| true | true |
f715643f43f6a40626ee3423dc028f67fe0c8522 | 113 | py | Python | mass/views.py | lsapan/channels-mass-broadcast | 4f60e059ea9e3a861cc47250347900a4d0b8bd7f | [
"MIT"
] | null | null | null | mass/views.py | lsapan/channels-mass-broadcast | 4f60e059ea9e3a861cc47250347900a4d0b8bd7f | [
"MIT"
] | null | null | null | mass/views.py | lsapan/channels-mass-broadcast | 4f60e059ea9e3a861cc47250347900a4d0b8bd7f | [
"MIT"
] | null | null | null | from django.views.generic.base import TemplateView
class AppView(TemplateView):
template_name = 'app.html'
| 18.833333 | 50 | 0.778761 | from django.views.generic.base import TemplateView
class AppView(TemplateView):
template_name = 'app.html'
| true | true |
f71565b7be10bec97c68c9837cc952d9b34744fe | 886 | py | Python | s5/local/extract_text.py | cadia-lvl/althingi-asr | 8830f40b8302834fc8176727a36ca8136cd9eedc | [
"Apache-2.0"
] | 4 | 2017-11-10T19:43:43.000Z | 2019-07-03T12:12:09.000Z | egs/althingi/s5/local/extract_text.py | ingarun/kaldi | 362ad3235c9740c0dfb0481cfbff81ca4604222d | [
"Apache-2.0"
] | null | null | null | egs/althingi/s5/local/extract_text.py | ingarun/kaldi | 362ad3235c9740c0dfb0481cfbff81ca4604222d | [
"Apache-2.0"
] | 1 | 2017-11-06T18:28:53.000Z | 2017-11-06T18:28:53.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import glob
import os
import codecs
import re
#from bs4 import BeautifulSoup
with codecs.open(sys.argv[2],'w',encoding='utf-8') as fout:
xmlpaths = glob.glob(os.path.join(sys.argv[1],'*.xml'))
for file in xmlpaths:
file_base = os.path.split... | 35.44 | 81 | 0.565463 |
import sys
import glob
import os
import codecs
import re
with codecs.open(sys.argv[2],'w',encoding='utf-8') as fout:
xmlpaths = glob.glob(os.path.join(sys.argv[1],'*.xml'))
for file in xmlpaths:
file_base = os.path.splitext(os.path.basename(file))[0]
with codecs.open(file,'r',encoding='... | true | true |
f715670072d1d78f8599fbbeeae887a4a8b445cc | 2,970 | py | Python | news/views.py | serg1ua/today-ua | 6a3ad99c924884db81ecbdb5d3dc2255dd927b4e | [
"MIT"
] | null | null | null | news/views.py | serg1ua/today-ua | 6a3ad99c924884db81ecbdb5d3dc2255dd927b4e | [
"MIT"
] | null | null | null | news/views.py | serg1ua/today-ua | 6a3ad99c924884db81ecbdb5d3dc2255dd927b4e | [
"MIT"
] | null | null | null | import json
from django.http import HttpResponse, Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
from django.urls import reverse
from .models import Article
get_articles = 10
# Create your views here.
def index(request):
# print(dir(request))
return HttpResponseRedirect(revers... | 27.757009 | 90 | 0.653535 | import json
from django.http import HttpResponse, Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
from django.urls import reverse
from .models import Article
get_articles = 10
def index(request):
return HttpResponseRedirect(reverse("main"))
def main(request):
try:
... | true | true |
f715672884f4a836d1e1572dda38ea12b14cfb27 | 8,758 | py | Python | lib/rucio/tests/conftest.py | chrisburr/rucio | 735f628231cd9fae64adc31c9f548b14d5ca01d3 | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/conftest.py | chrisburr/rucio | 735f628231cd9fae64adc31c9f548b14d5ca01d3 | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/conftest.py | chrisburr/rucio | 735f628231cd9fae64adc31c9f548b14d5ca01d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020-2021 CERN
#
# 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... | 33.945736 | 125 | 0.716716 |
from __future__ import print_function
import traceback
import pytest
@pytest.fixture(scope='session')
def vo():
from rucio.common.config import config_get_bool, config_get
if config_get_bool('common', 'multi_vo', raise_exception=False, default=False):
return config_get('client'... | true | true |
f71567dd29ec05db09822d985693d9e42b0f36ec | 394 | py | Python | src/param.py | xiajing10/akec | 239fdda923c8a0743f56dbf0a009fa2235b85451 | [
"MIT"
] | 14 | 2021-01-28T07:13:25.000Z | 2022-02-10T06:41:32.000Z | src/param.py | xiajing10/akec | 239fdda923c8a0743f56dbf0a009fa2235b85451 | [
"MIT"
] | 2 | 2021-04-14T15:24:30.000Z | 2021-05-06T07:02:08.000Z | src/param.py | xiajing10/akec | 239fdda923c8a0743f56dbf0a009fa2235b85451 | [
"MIT"
] | 1 | 2021-07-09T02:52:59.000Z | 2021-07-09T02:52:59.000Z | # -*- coding: utf-8 -*-
"""
@author: eilxaix
"""
param = {
'data_path': '../dataset/ieee_xai.csv',
'terms_path': '../dataset/domain_terms.txt',
'conceptnet_emb': './embed_data/numberbatch-en-19.08.txt',
'elmo_options':'./embed_data/elmo_2x4096_512_2048cnn_2xhighway_5.5B_options.json',
'elmo_weight... | 32.833333 | 87 | 0.690355 |
param = {
'data_path': '../dataset/ieee_xai.csv',
'terms_path': '../dataset/domain_terms.txt',
'conceptnet_emb': './embed_data/numberbatch-en-19.08.txt',
'elmo_options':'./embed_data/elmo_2x4096_512_2048cnn_2xhighway_5.5B_options.json',
'elmo_weight':'./embed_data/elmo_2x4096_512_2048cnn_2xhighwa... | true | true |
f71568ebb68f9faa9d28c57f4a9204630dfb7a43 | 18,797 | py | Python | transfer_subnet/xiaoketransfer2.py | LenKerr/Colorization-1 | bcfcdb24fc8ab107d34644d5a63b018f86784e21 | [
"MIT"
] | 30 | 2020-06-21T09:29:51.000Z | 2022-03-26T07:32:52.000Z | transfer_subnet/xiaoketransfer2.py | LenKerr/Colorization-1 | bcfcdb24fc8ab107d34644d5a63b018f86784e21 | [
"MIT"
] | 5 | 2020-09-27T09:45:44.000Z | 2021-10-20T11:45:04.000Z | transfer_subnet/xiaoketransfer2.py | xuzhongyou/Colorization | bcfcdb24fc8ab107d34644d5a63b018f86784e21 | [
"MIT"
] | 7 | 2020-07-03T02:55:25.000Z | 2021-12-18T10:38:41.000Z | """
Copyright (c) 2019 NAVER Corp.
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, merge, publish, distribute, su... | 42.623583 | 297 | 0.665638 | import os
os.environ['CUDA_VISIBLE_DEVICES']='1'
import sys
sys.path.append('./segmentation')
import os
import tqdm
import argparse
import torch
from torchvision.utils import save_image
import torch.nn as nn
from utils.core import feature_wct
from utils.core import feature_adin
from utils.core import feature_adin_wi... | true | true |
f7156985db791f120b85f1fb241fe315d40a1d08 | 16,415 | py | Python | retrain_yolo.py | mukulbhave/YAD2K | a6174285e036f95df83783b7b4d951094cbb08c8 | [
"MIT"
] | null | null | null | retrain_yolo.py | mukulbhave/YAD2K | a6174285e036f95df83783b7b4d951094cbb08c8 | [
"MIT"
] | null | null | null | retrain_yolo.py | mukulbhave/YAD2K | a6174285e036f95df83783b7b4d951094cbb08c8 | [
"MIT"
] | null | null | null | """
This is a script that can be used to retrain the YOLOv2 model for your own dataset.
"""
import argparse
import os
from PIL import ImageOps
import matplotlib.pyplot as plt
import numpy as np
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.m... | 39.176611 | 157 | 0.648005 | import argparse
import os
from PIL import ImageOps
import matplotlib.pyplot as plt
import numpy as np
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.models import load_model, Model
from keras import regularizers
from keras.callbacks import Te... | true | true |
f7156a419031a548f8c6765c306917d7d0a579d2 | 399 | py | Python | chilled-vibes.py | bcgreen24/ten-lines-or-less | 7a34ff7d7222fd3946e9cbb418afc992bc84e5e5 | [
"MIT"
] | 44 | 2018-08-15T08:32:43.000Z | 2022-02-15T20:25:03.000Z | chilled-vibes.py | bcgreen24/ten-lines-or-less | 7a34ff7d7222fd3946e9cbb418afc992bc84e5e5 | [
"MIT"
] | null | null | null | chilled-vibes.py | bcgreen24/ten-lines-or-less | 7a34ff7d7222fd3946e9cbb418afc992bc84e5e5 | [
"MIT"
] | 7 | 2018-09-08T20:05:58.000Z | 2021-11-22T12:46:15.000Z | Clock.bpm=100; Scale.default="minor"
p1 >> pulse([0,-1,-2,-3], dur=8, lpf=600, lpr=0.2, crush=8) + (0,2,4,const(6))
p3 >> blip(p1.pitch, dur=8, sus=4, room=1, oct=6) + [0,0,0,P*(2,4,3,-1)]
p2 >> saw(P[:5][:9][:16], dur=1/4, oct=var([3,4],[12,4])).penta()
d1 >> play("(x )( x)o{ vx[xx]}", crush=16, rate=.8).every([24,5,3... | 57 | 88 | 0.526316 | Clock.bpm=100; Scale.default="minor"
p1 >> pulse([0,-1,-2,-3], dur=8, lpf=600, lpr=0.2, crush=8) + (0,2,4,const(6))
p3 >> blip(p1.pitch, dur=8, sus=4, room=1, oct=6) + [0,0,0,P*(2,4,3,-1)]
p2 >> saw(P[:5][:9][:16], dur=1/4, oct=var([3,4],[12,4])).penta()
d1 >> play("(x )( x)o{ vx[xx]}", crush=16, rate=.8).every([24,5,3... | true | true |
f7156ae46165bfa283ef31892e3fde5d02b6eeab | 166 | py | Python | StarAcmSpider/StarAcmSpider/items.py | MeiK-h/StarACM | 54654bdc19c8eff02c67ba77784d08368570d4e7 | [
"MIT"
] | null | null | null | StarAcmSpider/StarAcmSpider/items.py | MeiK-h/StarACM | 54654bdc19c8eff02c67ba77784d08368570d4e7 | [
"MIT"
] | null | null | null | StarAcmSpider/StarAcmSpider/items.py | MeiK-h/StarACM | 54654bdc19c8eff02c67ba77784d08368570d4e7 | [
"MIT"
] | null | null | null | import scrapy
class StarAcmSpiderItem(scrapy.Item):
username = scrapy.Field()
source = scrapy.Field()
run_id = scrapy.Field()
data = scrapy.Field()
| 18.444444 | 37 | 0.674699 | import scrapy
class StarAcmSpiderItem(scrapy.Item):
username = scrapy.Field()
source = scrapy.Field()
run_id = scrapy.Field()
data = scrapy.Field()
| true | true |
f7156b5c602c9fa2552e9ba98cbbe35c20310e78 | 15,637 | py | Python | MomentumProject/mtInitialize_004.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | MomentumProject/mtInitialize_004.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | MomentumProject/mtInitialize_004.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | import copy
import sys
#if '../PyCommon/modules' not in sys.path:
# sys.path.append('../PyCommon/modules')
if './modules' not in sys.path:
sys.path.append('./modules')
import Resource.ysMotionLoader as yf
import Simulator.ysPhysConfig as ypc
import Math.mmMath as mm
import Motion.ysHierarchyEdit as ... | 34.904018 | 387 | 0.592249 | import copy
import sys
if './modules' not in sys.path:
sys.path.append('./modules')
import Resource.ysMotionLoader as yf
import Simulator.ysPhysConfig as ypc
import Math.mmMath as mm
import Motion.ysHierarchyEdit as yme
import Motion.ysMotion as ym
s'
RIGHT_UP_LEG = 'RightUpLeg'
RIGHT_LEG = 'Righ... | true | true |
f7156c17c1c2dac9f185a10f4aef638483c87e61 | 976 | py | Python | core/forms.py | donnellan0007/blog | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | [
"MIT"
] | null | null | null | core/forms.py | donnellan0007/blog | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | [
"MIT"
] | null | null | null | core/forms.py | donnellan0007/blog | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class ProfileForm(UserCreationForm):
email = forms.EmailField(widget=forms.TextInput(
attrs = {
'type' : 'email',
'placeholder' : ('Email')
}
))
... | 36.148148 | 79 | 0.609631 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class ProfileForm(UserCreationForm):
email = forms.EmailField(widget=forms.TextInput(
attrs = {
'type' : 'email',
'placeholder' : ('Email')
}
))
... | true | true |
f7156c4bf5fa7bbe5bdf31d0caf7e0a157cf1469 | 4,015 | py | Python | tests/parser/functions/test_concat.py | Solexplorer/vyper | 135edd6a91d47c72de105066d6e6c1bdfe9ea66e | [
"MIT"
] | 1 | 2021-04-23T21:48:20.000Z | 2021-04-23T21:48:20.000Z | tests/parser/functions/test_concat.py | Solexplorer/vyper | 135edd6a91d47c72de105066d6e6c1bdfe9ea66e | [
"MIT"
] | null | null | null | tests/parser/functions/test_concat.py | Solexplorer/vyper | 135edd6a91d47c72de105066d6e6c1bdfe9ea66e | [
"MIT"
] | 1 | 2020-01-27T05:21:46.000Z | 2020-01-27T05:21:46.000Z | from vyper.exceptions import (
TypeMismatchException,
)
def test_concat(get_contract_with_gas_estimation):
test_concat = """
@public
def foo2(input1: bytes[50], input2: bytes[50]) -> bytes[1000]:
return concat(input1, input2)
@public
def foo3(input1: bytes[50], input2: bytes[50], input3: bytes[50]) -> by... | 30.18797 | 131 | 0.62142 | from vyper.exceptions import (
TypeMismatchException,
)
def test_concat(get_contract_with_gas_estimation):
test_concat = """
@public
def foo2(input1: bytes[50], input2: bytes[50]) -> bytes[1000]:
return concat(input1, input2)
@public
def foo3(input1: bytes[50], input2: bytes[50], input3: bytes[50]) -> by... | true | true |
f7156ce7fd453c52f14385b72fc6a38950f75874 | 5,307 | py | Python | nicos_mlz/biodiff/setups/motor.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/biodiff/setups/motor.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/biodiff/setups/motor.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
description = 'Axes setup'
group = 'lowlevel'
tango_base = 'tango://phys.biodiff.frm2:10000/biodiff/'
devices = dict(
omega_samplestepper = device('nicos.devices.tango.Motor',
description = 'Sample stepper omega variant',
tangodevice = tango_base + 'fzjs7/omega_samplestepp... | 36.349315 | 85 | 0.606181 |
description = 'Axes setup'
group = 'lowlevel'
tango_base = 'tango://phys.biodiff.frm2:10000/biodiff/'
devices = dict(
omega_samplestepper = device('nicos.devices.tango.Motor',
description = 'Sample stepper omega variant',
tangodevice = tango_base + 'fzjs7/omega_samplestepper',
unit = 'de... | true | true |
f7156edb72ba4944c07e754e6e68e17a3a4c0c87 | 648 | py | Python | trade_remedies_api/organisations/migrations/0011_organisation_merged_from.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 1 | 2020-08-13T10:37:15.000Z | 2020-08-13T10:37:15.000Z | trade_remedies_api/organisations/migrations/0011_organisation_merged_from.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 4 | 2020-09-10T13:41:52.000Z | 2020-12-16T09:00:21.000Z | trade_remedies_api/organisations/migrations/0011_organisation_merged_from.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-11-06 15:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("organisations", "0010_auto_20191024_1353"),
]
operations = [
migrations.AddField(
model_name="o... | 24.923077 | 60 | 0.574074 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("organisations", "0010_auto_20191024_1353"),
]
operations = [
migrations.AddField(
model_name="organisation",
name="merged_from",
... | true | true |
f7156f2a19e53f51807d2c9be830a384fe50f7d0 | 4,368 | py | Python | tests/unit/test_clearmot.py | traffic-ai/EvalDeT | 3b52698e1b03fb9066e3203c2f36aebfa0030aba | [
"Apache-2.0"
] | 2 | 2021-12-19T21:55:12.000Z | 2021-12-19T21:55:19.000Z | tests/unit/test_clearmot.py | sasp-ai/EvalDeT | 3b52698e1b03fb9066e3203c2f36aebfa0030aba | [
"Apache-2.0"
] | 10 | 2021-08-07T09:51:27.000Z | 2021-08-29T07:26:07.000Z | tests/unit/test_clearmot.py | traffic-ai/EvalDeT | 3b52698e1b03fb9066e3203c2f36aebfa0030aba | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pytest
from evaldet import Tracks
from evaldet.mot_metrics.clearmot import calculate_clearmot_metrics
def test_missing_frame_hyp():
gt = Tracks()
gt.add_frame(0, [0], np.array([[0, 0, 1, 1]]))
gt.add_frame(1, [0], np.array([[0, 0, 1, 1]]))
hyp = Tracks()
hyp.add_frame(0... | 30.545455 | 83 | 0.565476 | import numpy as np
import pytest
from evaldet import Tracks
from evaldet.mot_metrics.clearmot import calculate_clearmot_metrics
def test_missing_frame_hyp():
gt = Tracks()
gt.add_frame(0, [0], np.array([[0, 0, 1, 1]]))
gt.add_frame(1, [0], np.array([[0, 0, 1, 1]]))
hyp = Tracks()
hyp.add_frame(0... | true | true |
f7157086f3990ba862350c2dc2e8610185bd0247 | 1,377 | py | Python | transcript/transcript/urls.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | 1 | 2019-02-25T23:17:18.000Z | 2019-02-25T23:17:18.000Z | transcript/transcript/urls.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | null | null | null | transcript/transcript/urls.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | null | null | null | """transcript URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 43.03125 | 121 | 0.718228 | from django.contrib import admin
from django.urls import path
import xadmin
from django.views.generic import TemplateView
from trans_sys.views import user_login, user_info, user_course, user_GPA, user_transcript, changeProfile, change_password
urlpatterns = [
path('xadmin/', xadmin.site.urls),
path('index/',Te... | true | true |
f7157154f136fad7994d2221db333cf67ad7e9d1 | 6,774 | py | Python | samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py | jonnii/openapi-generator | b828860614df0b5207761c2a34c6a002fb56419b | [
"Apache-2.0"
] | 1 | 2021-01-26T15:23:10.000Z | 2021-01-26T15:23:10.000Z | samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py | jonnii/openapi-generator | b828860614df0b5207761c2a34c6a002fb56419b | [
"Apache-2.0"
] | 5 | 2021-03-10T19:39:24.000Z | 2022-02-27T05:24:35.000Z | samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py | jonnii/openapi-generator | b828860614df0b5207761c2a34c6a002fb56419b | [
"Apache-2.0"
] | 2 | 2020-08-06T08:52:02.000Z | 2021-05-06T09:22:11.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 36.815217 | 174 | 0.602303 |
from __future__ import absolute_import
import re
import sys
import six
import nulltype
from petstore_api.model_utils import (
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,... | true | true |
f715723718b976ccc5b5a3dc7091ae07ddbd3d22 | 3,657 | py | Python | plex/utils/datasource/thetvdb.py | spuriousdata/plex-cli | f2561d1a68917edbc9bbcce39a9548da86d2d7ef | [
"MIT"
] | 1 | 2018-03-26T20:06:57.000Z | 2018-03-26T20:06:57.000Z | plex/utils/datasource/thetvdb.py | spuriousdata/plex-cli | f2561d1a68917edbc9bbcce39a9548da86d2d7ef | [
"MIT"
] | null | null | null | plex/utils/datasource/thetvdb.py | spuriousdata/plex-cli | f2561d1a68917edbc9bbcce39a9548da86d2d7ef | [
"MIT"
] | null | null | null | import json
import requests
class TVDBHttpException(Exception):
pass
class TVDB(object):
base = 'https://api.thetvdb.com'
def __init__(self, apikey=None, username=None, userkey=None):
self.username = username
self.userkey = userkey
self.apikey = apikey
self.authenticate(... | 38.904255 | 106 | 0.508067 | import json
import requests
class TVDBHttpException(Exception):
pass
class TVDB(object):
base = 'https://api.thetvdb.com'
def __init__(self, apikey=None, username=None, userkey=None):
self.username = username
self.userkey = userkey
self.apikey = apikey
self.authenticate(... | true | true |
f71572afcd687fc4a51638572448889091aac7fe | 615 | py | Python | wework/migrations/0001_initial.py | edsion1107/pytest_backend | 59caf69226b821497ee19673630226df24d34391 | [
"BSD-3-Clause"
] | null | null | null | wework/migrations/0001_initial.py | edsion1107/pytest_backend | 59caf69226b821497ee19673630226df24d34391 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T23:52:19.000Z | 2021-06-10T21:19:50.000Z | wework/migrations/0001_initial.py | edsion1107/pytest_backend | 59caf69226b821497ee19673630226df24d34391 | [
"BSD-3-Clause"
] | 1 | 2020-11-28T15:25:03.000Z | 2020-11-28T15:25:03.000Z | # Generated by Django 2.1.7 on 2019-02-26 03:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AccessToken',
fields=[
('id', models.AutoFi... | 25.625 | 114 | 0.573984 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AccessToken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serial... | true | true |
f71573d18019e66119ed0720c4b4edddc4c1a5eb | 987 | py | Python | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 24.073171 | 109 | 0.733536 |
from __future__ import absolute_import
import unittest
import nucleus_api
from nucleus_api.models.order_reconcile_return_object import OrderReconcileReturnObject
from nucleus_api.rest import ApiException
class TestOrderReconcileReturnObject(unittest.TestCase):
def setUp(self):
pass
def tearD... | true | true |
f71573ed4848e9b29e823af2889eea2f2d9b5fc1 | 822 | py | Python | inventory/home/view.py | Rohitkuru/Smart-Linux-Box | 0cc1b0c4ebc9edb35b2ba64b51f451d36af87304 | [
"MIT"
] | null | null | null | inventory/home/view.py | Rohitkuru/Smart-Linux-Box | 0cc1b0c4ebc9edb35b2ba64b51f451d36af87304 | [
"MIT"
] | 1 | 2021-03-07T07:59:47.000Z | 2021-03-07T07:59:47.000Z | inventory/home/view.py | Rohitkuru/dynamic-linux-inventory | 0cc1b0c4ebc9edb35b2ba64b51f451d36af87304 | [
"MIT"
] | null | null | null | from flask import Blueprint,render_template,request,flash
from inventory.backend.scripts import scan
from inventory.Crud.operation import add_record
from inventory.models import *
home = Blueprint("home_view",__name__)
@home.route("/",methods = ['GET','POST'])
def home_view():
if request.method == "POST":
... | 37.363636 | 87 | 0.70073 | from flask import Blueprint,render_template,request,flash
from inventory.backend.scripts import scan
from inventory.Crud.operation import add_record
from inventory.models import *
home = Blueprint("home_view",__name__)
@home.route("/",methods = ['GET','POST'])
def home_view():
if request.method == "POST":
... | true | true |
f7157414e7e3ec2bdef8398e48beb4165dba07b9 | 16,669 | py | Python | MAML-ADML/meta.py | robustmetalearning/robust-meta-learning | 08fc3e9302c9fbd1fcfc3e001e0b080a3c783c81 | [
"MIT"
] | null | null | null | MAML-ADML/meta.py | robustmetalearning/robust-meta-learning | 08fc3e9302c9fbd1fcfc3e001e0b080a3c783c81 | [
"MIT"
] | null | null | null | MAML-ADML/meta.py | robustmetalearning/robust-meta-learning | 08fc3e9302c9fbd1fcfc3e001e0b080a3c783c81 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
import numpy as np
from learner import Learner
from copy import deepcopy
def zero_nontrainable_grads(grads, trainable_lay... | 43.183938 | 141 | 0.599736 | import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
import numpy as np
from learner import Learner
from copy import deepcopy
def zero_nontrainable_grads(grads, trainable_lay... | true | true |
f715745078d64aff302f2395177ab959a49111ab | 3,310 | py | Python | steps/nnet3/train.py | ondrejklejch/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 18 | 2019-10-24T04:42:16.000Z | 2021-11-24T03:07:59.000Z | steps/nnet3/train.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | null | null | null | steps/nnet3/train.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 4 | 2018-08-31T01:08:50.000Z | 2019-05-10T12:12:57.000Z | import sys
import numpy as np
from keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler
from keras.models import Model
from keras.layers import Input, Activation, Conv1D, BatchNormalization
from keras.optimizers import Adam
from learning_to_adapt.model import LHUC, Renorm
from learning_to_adapt.ut... | 37.613636 | 161 | 0.710876 | import sys
import numpy as np
from keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler
from keras.models import Model
from keras.layers import Input, Activation, Conv1D, BatchNormalization
from keras.optimizers import Adam
from learning_to_adapt.model import LHUC, Renorm
from learning_to_adapt.ut... | true | true |
f71574ae5ca34081f8ffb4a0fb83b14cf338b46f | 2,364 | py | Python | tests/test_euromil.py | rse01/pyeuromil | 17f7c800f6f10289d3211bd9d783d1f516594f6c | [
"MIT"
] | null | null | null | tests/test_euromil.py | rse01/pyeuromil | 17f7c800f6f10289d3211bd9d783d1f516594f6c | [
"MIT"
] | null | null | null | tests/test_euromil.py | rse01/pyeuromil | 17f7c800f6f10289d3211bd9d783d1f516594f6c | [
"MIT"
] | null | null | null | """ Unit tests for euromil.py """
from datetime import date
import pytest
from pyeuromil import euro_results, euro_draw_dates, euro_stats
def test_euromil_results_year_not_exist():
""" results of year test (year does not exists) """
with pytest.raises(ValueError):
results = euro_results("abcd")
... | 29.924051 | 88 | 0.661168 | from datetime import date
import pytest
from pyeuromil import euro_results, euro_draw_dates, euro_stats
def test_euromil_results_year_not_exist():
with pytest.raises(ValueError):
results = euro_results("abcd")
assert results is None
results = euro_results(1920)
assert results is No... | true | true |
f71575f5748372d7306937a1f31ad94c872397b7 | 16,014 | py | Python | nemo/collections/nlp/data/data_utils/data_preprocessing.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | nemo/collections/nlp/data/data_utils/data_preprocessing.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | nemo/collections/nlp/data/data_utils/data_preprocessing.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # Copyright (c) 2020, 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 29.710575 | 132 | 0.604783 |
import csv
import json
import os
import pickle
import random
import re
import string
from collections import Counter
import numpy as np
import torch
from tqdm.auto import tqdm
from nemo.utils import logging
from nemo.utils.env_var_parsing import get_envint
__all__ = [
'DataProcessor',
'get_labe... | true | true |
f7157672a7aaadbb0f7dae37f20ea58ef3e5d0da | 12,933 | py | Python | lib/model/config.py | Kenneth-Wong/tf-faster-rcnn | a6bd798df1b9075ebdfeb7744fffc13226c3a65e | [
"MIT"
] | null | null | null | lib/model/config.py | Kenneth-Wong/tf-faster-rcnn | a6bd798df1b9075ebdfeb7744fffc13226c3a65e | [
"MIT"
] | null | null | null | lib/model/config.py | Kenneth-Wong/tf-faster-rcnn | a6bd798df1b9075ebdfeb7744fffc13226c3a65e | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
# `pip install easydict` if you don't have it
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config im... | 27 | 91 | 0.710044 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config import cfg
cfg = __C
#
# Memory options
#
__C.... | true | true |
f715773b79dedecb2423d1c8a82ee28a03b25ac1 | 2,009 | py | Python | tools.py | VieVie31/face_detection | fea010faedcad038f908bdab559eeb0f18ee5063 | [
"MIT"
] | 4 | 2017-10-19T07:41:25.000Z | 2018-11-03T16:10:16.000Z | tools.py | VieVie31/face_detection | fea010faedcad038f908bdab559eeb0f18ee5063 | [
"MIT"
] | null | null | null | tools.py | VieVie31/face_detection | fea010faedcad038f908bdab559eeb0f18ee5063 | [
"MIT"
] | null | null | null | import os
import re
import cv2
import random
import numpy as np
import matplotlib.pyplot as plt
def read_pgm(filename, byteorder='>'):
"""Return image data from a raw PGM file as numpy array.
Format specification: http://netpbm.sourceforge.net/doc/pgm.html
"""
with open(filename, 'rb') as f:
... | 28.295775 | 77 | 0.558487 | import os
import re
import cv2
import random
import numpy as np
import matplotlib.pyplot as plt
def read_pgm(filename, byteorder='>'):
with open(filename, 'rb') as f:
buffer = f.read()
try:
header, width, height, maxval = re.search(
b"(^P5\s(?:\s*#.*[\r\n])*"
b"(\d+)\s(?... | true | true |
f71578c338458c847d71d9fa063b9ac9dfebe6cd | 5,541 | py | Python | Sporter/test_leeftijdsklassen.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-22T13:11:12.000Z | 2021-12-22T13:11:12.000Z | Sporter/test_leeftijdsklassen.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 9 | 2020-10-28T07:07:05.000Z | 2021-06-28T20:05:37.000Z | Sporter/test_leeftijdsklassen.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019-2021 Ramon van der Winkel.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.test import TestCase
from django.utils import timezone
from NhbStructuur.models import NhbRegio, NhbVereniging
from .leeftijdsklassen import ... | 41.044444 | 151 | 0.562714 |
from django.test import TestCase
from django.utils import timezone
from NhbStructuur.models import NhbRegio, NhbVereniging
from .leeftijdsklassen import bereken_leeftijdsklassen
from .models import Sporter
from TestHelpers.e2ehelpers import E2EHelpers
import datetime
class TestSporterLeeftijdsklassen(E2EHelpers... | true | true |
f71579a7221e41b1b3740a7e825aa1b7bae7267b | 6,193 | py | Python | test/test_addressspace.py | dendisuhubdy/coriander | 7df182981e5c4a8e043fea25d272d025a953f06d | [
"Apache-2.0"
] | 644 | 2017-05-21T05:25:20.000Z | 2022-03-25T04:18:14.000Z | test/test_addressspace.py | hughperkins/cuda-ir-to-opencl | 7c6b65bc08a25a6bce21efe7b86be8fa985597af | [
"Apache-2.0"
] | 82 | 2017-05-21T15:19:24.000Z | 2022-01-30T01:41:44.000Z | test/test_addressspace.py | hughperkins/cuda-ir-to-opencl | 7c6b65bc08a25a6bce21efe7b86be8fa985597af | [
"Apache-2.0"
] | 88 | 2017-05-21T01:31:16.000Z | 2022-01-31T09:28:17.000Z | # Copyright Hugh Perkins 2016
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | 32.088083 | 103 | 0.676893 |
import numpy as np
import pyopencl as cl
import os
import subprocess
from test import test_common
from test.test_common import offset_type
def test_getelementptr_struct_local(context, q, float_data, float_data_gpu):
cu_source = """
struct MyStruct {
float* f0;
float* f1;
};
__global__ void foo(float... | true | true |
f7157a1710b2e208b523118567fc8e95d752447c | 16,786 | py | Python | RL_TD3/src/pe_model.py | Crazy-Jack/RL4GRN | e683e17758eb468bd42e0ea0020e2246051c258c | [
"MIT"
] | null | null | null | RL_TD3/src/pe_model.py | Crazy-Jack/RL4GRN | e683e17758eb468bd42e0ea0020e2246051c258c | [
"MIT"
] | null | null | null | RL_TD3/src/pe_model.py | Crazy-Jack/RL4GRN | e683e17758eb468bd42e0ea0020e2246051c258c | [
"MIT"
] | 1 | 2020-12-14T09:32:36.000Z | 2020-12-14T09:32:36.000Z | '''
The probabilistic ensemble dynamics model
'''
# pylint: disable=C0103, R0902, R0913, W0201, E0401, E1120
import time
import itertools
import numpy as np
import tensorflow as tf
from tensorflow import keras
from collections import defaultdict
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
class PEModel(ke... | 43.041026 | 143 | 0.614083 |
import time
import itertools
import numpy as np
import tensorflow as tf
from tensorflow import keras
from collections import defaultdict
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
class PEModel(keras.Model):
def __init__(self, state_dim, action_dim):
super().__init__()
self.l1 = keras.l... | true | true |
f7157a7507148ed0eab64630453d5382f6fcb0e0 | 264 | py | Python | project/api/migrations/0052_merge_0051_catalog_content_0051_video_resource_group.py | hlystovea/BBBS | 7164ef67615e45d750e965bf958af229b56d49e3 | [
"BSD-3-Clause"
] | null | null | null | project/api/migrations/0052_merge_0051_catalog_content_0051_video_resource_group.py | hlystovea/BBBS | 7164ef67615e45d750e965bf958af229b56d49e3 | [
"BSD-3-Clause"
] | 2 | 2021-06-07T14:06:05.000Z | 2021-06-18T16:27:29.000Z | project/api/migrations/0052_merge_0051_catalog_content_0051_video_resource_group.py | hlystovea/BBBS | 7164ef67615e45d750e965bf958af229b56d49e3 | [
"BSD-3-Clause"
] | 2 | 2021-07-27T20:40:18.000Z | 2021-09-12T16:48:19.000Z | # Generated by Django 3.2.3 on 2021-07-13 14:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0051_catalog_content'),
('api', '0051_video_resource_group'),
]
operations = [
]
| 17.6 | 47 | 0.636364 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0051_catalog_content'),
('api', '0051_video_resource_group'),
]
operations = [
]
| true | true |
f7157aa07d402c4517f82d9775f1feb82ec86069 | 1,855 | py | Python | repos/system_upgrade/el7toel8/actors/checkbootavailspace/tests/unit_test.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/checkbootavailspace/tests/unit_test.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/checkbootavailspace/tests/unit_test.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | from __future__ import division
from leapp.libraries.actor.library import (MIN_AVAIL_BYTES_FOR_BOOT,
check_avail_space_on_boot,
inhibit_upgrade)
from leapp import reporting
from leapp.libraries.common.testutils import create_report_m... | 35.673077 | 108 | 0.750404 | from __future__ import division
from leapp.libraries.actor.library import (MIN_AVAIL_BYTES_FOR_BOOT,
check_avail_space_on_boot,
inhibit_upgrade)
from leapp import reporting
from leapp.libraries.common.testutils import create_report_m... | true | true |
f7157bf8af638e897f07970e2094a05bd644cb21 | 162 | py | Python | boa3_test/test_sc/native_test/contractmanagement/DestroyContractTooManyArguments.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/native_test/contractmanagement/DestroyContractTooManyArguments.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/native_test/contractmanagement/DestroyContractTooManyArguments.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Any
from boa3.builtin.nativecontract.contractmanagement import ContractManagement
def Main(arg0: Any):
ContractManagement.destroy(arg0)
| 20.25 | 77 | 0.820988 | from typing import Any
from boa3.builtin.nativecontract.contractmanagement import ContractManagement
def Main(arg0: Any):
ContractManagement.destroy(arg0)
| true | true |
f7157c2e2f6a53fa18f4f1a00dcbb3a3da29ecfd | 15,984 | py | Python | conta/main/views.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | null | null | null | conta/main/views.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | 23 | 2021-12-29T21:41:37.000Z | 2022-03-31T10:01:54.000Z | conta/main/views.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | 1 | 2022-02-18T19:58:52.000Z | 2022-02-18T19:58:52.000Z | import datetime
from django.shortcuts import render
from django.views import View
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.db.models.deletion import ProtectedError
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequi... | 34.081023 | 126 | 0.611424 | import datetime
from django.shortcuts import render
from django.views import View
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.db.models.deletion import ProtectedError
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequi... | true | true |
f7157cc2826df7834aa60b3fb11396d26a4e5f5b | 2,465 | py | Python | day_15/second.py | Mizux/adventofcode | 8bca6b5db1b9f2e64b4038d32680d07766d14e2d | [
"Apache-2.0"
] | 1 | 2021-12-11T19:41:25.000Z | 2021-12-11T19:41:25.000Z | day_15/second.py | Mizux/adventofcode | 8bca6b5db1b9f2e64b4038d32680d07766d14e2d | [
"Apache-2.0"
] | null | null | null | day_15/second.py | Mizux/adventofcode | 8bca6b5db1b9f2e64b4038d32680d07766d14e2d | [
"Apache-2.0"
] | 1 | 2021-12-06T12:09:44.000Z | 2021-12-06T12:09:44.000Z | #!/usr/bin/env python3
from collections import deque
FILE='test.txt' # sol: 40
FILE='input.txt' # sol: 824
def print_board(board):
for row in board:
print(''.join([str(i) for i in row]))
def parse_input(file, repeat):
board = []
for i in range(repeat):
with open(file, 'r') as f:
... | 31.602564 | 135 | 0.55213 |
from collections import deque
FILE='test.txt'
FILE='input.txt'
def print_board(board):
for row in board:
print(''.join([str(i) for i in row]))
def parse_input(file, repeat):
board = []
for i in range(repeat):
with open(file, 'r') as f:
for line in f:
board.append... | true | true |
f7157d354d86263b22ff896993d75bae3d71e43b | 21,644 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.747748 | 220 | 0.660968 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
f7157de80611bef9e79b6363562de1eb0d53d409 | 14,816 | py | Python | assignment-01/assignment-01.py | ehumss/itu-blu537e-data-analysis-and-visualisation | a401b0d8580d2021a9f634607339d074327276cd | [
"MIT"
] | 1 | 2020-01-28T12:48:53.000Z | 2020-01-28T12:48:53.000Z | assignment-01/assignment-01.py | ehumss/itu-blu537e-data-analysis-and-visualisation | a401b0d8580d2021a9f634607339d074327276cd | [
"MIT"
] | null | null | null | assignment-01/assignment-01.py | ehumss/itu-blu537e-data-analysis-and-visualisation | a401b0d8580d2021a9f634607339d074327276cd | [
"MIT"
] | null | null | null | ####################################################################################################
#
# ISTANBUL TECHNICAL UNIVERSITY
# BLU 537E - Data Analysis & Visualization
# Assignment 01
#
####################################################################################################
#
# ... | 43.83432 | 189 | 0.532667 | true | true | |
f7157fcc233e7ad5174d2ffad33f0e7b24b80a15 | 1,120 | py | Python | sagemaker_studio/containers/dashboard/src/app.py | NihalHarish/sagemaker-explaining-credit-decisions | e5965902d8901819a60f8c56517a82ddd17c1f95 | [
"Apache-2.0"
] | 80 | 2020-04-15T09:35:11.000Z | 2022-03-23T01:56:12.000Z | sagemaker_studio/containers/dashboard/src/app.py | IronOnet/sagemaker-explaining-credit-decisions | dbb8ea1a685412033c774c2a79cc1e5794438cf9 | [
"Apache-2.0"
] | 8 | 2020-04-16T16:53:09.000Z | 2022-02-06T17:07:02.000Z | sagemaker_studio/containers/dashboard/src/app.py | IronOnet/sagemaker-explaining-credit-decisions | dbb8ea1a685412033c774c2a79cc1e5794438cf9 | [
"Apache-2.0"
] | 28 | 2020-05-25T09:26:41.000Z | 2022-01-25T22:23:54.000Z | from pathlib import Path
import streamlit as st
from package import utils
from pages import local_page, global_page
from shared import list_explanation_groups
def explanation_group_selectbox():
paths = list_explanation_groups()
path = st.sidebar.selectbox(
label='Select explanation group:',
... | 28.717949 | 75 | 0.707143 | from pathlib import Path
import streamlit as st
from package import utils
from pages import local_page, global_page
from shared import list_explanation_groups
def explanation_group_selectbox():
paths = list_explanation_groups()
path = st.sidebar.selectbox(
label='Select explanation group:',
... | true | true |
f715800c50b2c0c85b8363141732d1ea4e6cedf4 | 11,896 | py | Python | opflexagent/rpc.py | shyam81295/python-opflex-agent | 3b564c93d62734354eea059afec7dce713225872 | [
"Apache-2.0"
] | null | null | null | opflexagent/rpc.py | shyam81295/python-opflex-agent | 3b564c93d62734354eea059afec7dce713225872 | [
"Apache-2.0"
] | null | null | null | opflexagent/rpc.py | shyam81295/python-opflex-agent | 3b564c93d62734354eea059afec7dce713225872 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 40.879725 | 79 | 0.634247 |
from neutron.common import rpc as n_rpc
from neutron.common import topics
from oslo_log import helpers as log
from oslo_log import log as logging
import oslo_messaging
LOG = logging.getLogger(__name__)
TOPIC_OPFLEX = 'opflex'
ENDPOINT = 'endpoint'
VRF = 'vrf'
NOTIFY_VRF = 'notify-vrf'
class AgentNotifie... | true | true |
f715802eeda042cbb9bf7a01b8eb94abfede69c2 | 2,706 | py | Python | modules/cmderr.py | patataofcourse/styleventer-archive | dc4b82f2903f91990fa9236cb67a9dd92e3e1a2f | [
"MIT"
] | 1 | 2021-01-28T16:22:32.000Z | 2021-01-28T16:22:32.000Z | modules/cmderr.py | alexdevteam/styleventer-archive | 303f280049d480b21c6e804e236c90fe3475a074 | [
"MIT"
] | 1 | 2021-01-16T22:14:36.000Z | 2021-01-16T22:14:36.000Z | modules/cmderr.py | patataofcourse/styleventer-archive | dc4b82f2903f91990fa9236cb67a9dd92e3e1a2f | [
"MIT"
] | 1 | 2021-01-16T22:01:59.000Z | 2021-01-16T22:01:59.000Z | from discord.ext import commands
import discord, sys, os
import traceback
import datetime
from libs import settings
async def oncmderror(ctx: discord.ext.commands.Context, error):
if type(error) == commands.CommandOnCooldown:
if int(error.retry_after) == 0:
await ctx.send("Wait a few seconds be... | 52.038462 | 126 | 0.65558 | from discord.ext import commands
import discord, sys, os
import traceback
import datetime
from libs import settings
async def oncmderror(ctx: discord.ext.commands.Context, error):
if type(error) == commands.CommandOnCooldown:
if int(error.retry_after) == 0:
await ctx.send("Wait a few seconds be... | true | true |
f71581382f809688e495e7651dfc11918e82e216 | 884 | py | Python | awwardsApp/urls.py | umunadine/Awwards | 1a862ef64c195e6ab9b38c8e1faf35f224354dbb | [
"MIT"
] | null | null | null | awwardsApp/urls.py | umunadine/Awwards | 1a862ef64c195e6ab9b38c8e1faf35f224354dbb | [
"MIT"
] | null | null | null | awwardsApp/urls.py | umunadine/Awwards | 1a862ef64c195e6ab9b38c8e1faf35f224354dbb | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from django.conf import settings
from . import views
from django.conf.urls.static import static
urlpatterns = [
url(r'^$',views.index,name='index'),
url(r'^accounts/profile/', views.my_profile, name='my_profile'),
url(r'register/',views.register, name='register'),
... | 38.434783 | 81 | 0.707014 | from django.conf.urls import url,include
from django.conf import settings
from . import views
from django.conf.urls.static import static
urlpatterns = [
url(r'^$',views.index,name='index'),
url(r'^accounts/profile/', views.my_profile, name='my_profile'),
url(r'register/',views.register, name='register'),
... | true | true |
f71581754c1df790c4b96c28981d61f8e5506370 | 89 | py | Python | samples/helloworld.py | neumond/minpiler | 2e37a9e0854383d3974af38e1cb2da0ecb8e2108 | [
"MIT"
] | 23 | 2020-12-20T03:39:30.000Z | 2022-03-23T15:47:10.000Z | samples/helloworld.py | neumond/minpiler | 2e37a9e0854383d3974af38e1cb2da0ecb8e2108 | [
"MIT"
] | 15 | 2020-12-21T01:12:22.000Z | 2021-04-19T10:40:11.000Z | samples/helloworld.py | neumond/minpiler | 2e37a9e0854383d3974af38e1cb2da0ecb8e2108 | [
"MIT"
] | 2 | 2022-02-12T19:19:50.000Z | 2022-02-12T21:33:35.000Z | from minpiler.typeshed import M, message1
M.print('Hello world!')
message1.printFlush()
| 17.8 | 41 | 0.775281 | from minpiler.typeshed import M, message1
M.print('Hello world!')
message1.printFlush()
| true | true |
f715818477d40bfbaf00925d174a3b2a99345b43 | 853 | py | Python | reviewboard/reviews/evolutions/file_attachments.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 921 | 2015-01-01T15:26:28.000Z | 2022-03-29T11:30:38.000Z | reviewboard/reviews/evolutions/file_attachments.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 5 | 2015-03-17T18:57:47.000Z | 2020-10-02T13:24:31.000Z | reviewboard/reviews/evolutions/file_attachments.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 285 | 2015-01-12T06:24:36.000Z | 2022-03-29T11:03:50.000Z | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ReviewRequest', 'file_attachments', models.ManyToManyField,
related_model='attachments.FileAttachment'),
AddField('ReviewRequest', 'inactive_file_attachmen... | 40.619048 | 78 | 0.731536 | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ReviewRequest', 'file_attachments', models.ManyToManyField,
related_model='attachments.FileAttachment'),
AddField('ReviewRequest', 'inactive_file_attachmen... | true | true |
f71581f934458fc27232e1abba28dfc2d9fb50c7 | 2,639 | py | Python | trustpayments/models/transaction_comment_create.py | TrustPayments/python-sdk | 6fde6eb8cfce270c3612a2903a845c13018c3bb9 | [
"Apache-2.0"
] | 2 | 2020-01-16T13:24:06.000Z | 2020-11-21T17:40:17.000Z | postfinancecheckout/models/transaction_comment_create.py | pfpayments/python-sdk | b8ef159ea3c843a8d0361d1e0b122a9958adbcb4 | [
"Apache-2.0"
] | 4 | 2019-10-14T17:33:23.000Z | 2021-10-01T14:49:11.000Z | postfinancecheckout/models/transaction_comment_create.py | pfpayments/python-sdk | b8ef159ea3c843a8d0361d1e0b122a9958adbcb4 | [
"Apache-2.0"
] | 2 | 2019-10-15T14:17:10.000Z | 2021-09-17T13:07:09.000Z | # coding: utf-8
import pprint
import six
from enum import Enum
from . import AbstractTransactionCommentActive
class TransactionCommentCreate(AbstractTransactionCommentActive):
swagger_types = {
'transaction': 'int',
}
attribute_map = {
'transaction': 'transaction',
}
_... | 26.39 | 83 | 0.56726 |
import pprint
import six
from enum import Enum
from . import AbstractTransactionCommentActive
class TransactionCommentCreate(AbstractTransactionCommentActive):
swagger_types = {
'transaction': 'int',
}
attribute_map = {
'transaction': 'transaction',
}
_transaction = N... | true | true |
f715842fcaf7266d175e63d68638aed9f2e32e69 | 7,994 | py | Python | tagger_ui/ui_model/annotated_images_manager.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | tagger_ui/ui_model/annotated_images_manager.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | tagger_ui/ui_model/annotated_images_manager.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | """
The business model core of the application.
"""
from typing import List, Union
from PIL import Image
from .annotated_image import AnnotatedImage
from .scaled_region2d import ScaledRegion2d
from .timer import Timer
from src.model import Size2d, Region2d
def clearImagesOutsideRange(
annotatedImages: List[Ann... | 37.35514 | 102 | 0.621091 | from typing import List, Union
from PIL import Image
from .annotated_image import AnnotatedImage
from .scaled_region2d import ScaledRegion2d
from .timer import Timer
from src.model import Size2d, Region2d
def clearImagesOutsideRange(
annotatedImages: List[AnnotatedImage],
currentIndex: int,
keepPreviou... | true | true |
f715861adc117fbbd75adf3f5e6a1228542c06dc | 97,810 | py | Python | src/sos/step_executor.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | null | null | null | src/sos/step_executor.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | null | null | null | src/sos/step_executor.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import ast
import copy
import os
import subprocess
import sys
import time
from collections import defaultdict
from collections.abc import Mapping, Sequence
f... | 42.433839 | 193 | 0.486893 |
import ast
import copy
import os
import subprocess
import sys
import time
from collections import defaultdict
from collections.abc import Mapping, Sequence
from typing import List
import zmq
from .controller import close_socket, create_socket, send_message_to_controller
from .messages import encode_msg, decode_m... | true | true |
f715866e13eb002c14554c06f9cadbe3ff57a70a | 322 | py | Python | generator/framework/util/fs.py | sinsay/ds_generator | 9365e22e8730418caf29b8ed6ada1f30f936a297 | [
"Apache-2.0"
] | null | null | null | generator/framework/util/fs.py | sinsay/ds_generator | 9365e22e8730418caf29b8ed6ada1f30f936a297 | [
"Apache-2.0"
] | null | null | null | generator/framework/util/fs.py | sinsay/ds_generator | 9365e22e8730418caf29b8ed6ada1f30f936a297 | [
"Apache-2.0"
] | null | null | null | import os
def mkdir_without_exception(target):
try:
# subprocess.call([
# "mkdir",
# "-p",
# target
# ])
os.makedirs(target, exist_ok=True)
except FileExistsError:
print("the directory %s already exists. continue the next gen phase." % target... | 23 | 87 | 0.552795 | import os
def mkdir_without_exception(target):
try:
os.makedirs(target, exist_ok=True)
except FileExistsError:
print("the directory %s already exists. continue the next gen phase." % target)
| true | true |
f71586bd484ad9828fd3d9ba20d058a77b29f8ff | 91 | py | Python | app/handlers/__init__.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | null | null | null | app/handlers/__init__.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | 5 | 2020-12-22T17:53:05.000Z | 2021-04-07T20:00:47.000Z | app/handlers/__init__.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | null | null | null | from .errors import *
from .private import *
from .callback import *
from .states import *
| 18.2 | 23 | 0.736264 | from .errors import *
from .private import *
from .callback import *
from .states import *
| true | true |
f71586c2e3611f2c07d319406a22e6a386a06e89 | 695 | py | Python | app/core/management/commands/wait_for_db.py | martinramirezboggio/recipe-app-api | 8f576ae036ba9a55e75a76465e97e0340378572e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | martinramirezboggio/recipe-app-api | 8f576ae036ba9a55e75a76465e97e0340378572e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | martinramirezboggio/recipe-app-api | 8f576ae036ba9a55e75a76465e97e0340378572e | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""django command to pause execution until db is ready"""
def handle(self, *args, **options):
"""handle the command"""
se... | 30.217391 | 78 | 0.638849 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while not db_conn:
... | true | true |
f71587d10ef1d1aed4af3fd809bfa4096755e581 | 7,494 | py | Python | e2e/tests/selenium/page_objects.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 10 | 2016-05-03T20:41:25.000Z | 2021-09-17T18:42:01.000Z | e2e/tests/selenium/page_objects.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 655 | 2016-05-04T19:00:35.000Z | 2022-03-28T13:09:20.000Z | e2e/tests/selenium/page_objects.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 8 | 2016-05-06T10:24:27.000Z | 2020-10-21T00:56:59.000Z | from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from e2e.tests.selenium.locators import LearningCircleCreationPageLocators
from e2e.tests.selenium.locators import RegistrationModalLocators
import datetime
import tim... | 49.96 | 154 | 0.777022 | from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from e2e.tests.selenium.locators import LearningCircleCreationPageLocators
from e2e.tests.selenium.locators import RegistrationModalLocators
import datetime
import tim... | true | true |
f71589db678f6272d81bf39a0e17b2bd21472491 | 8,808 | py | Python | postman/forms.py | StriveForBest/django-postman | 25f5fcf5a6d54dbb22b393432701652c21e49552 | [
"BSD-3-Clause"
] | null | null | null | postman/forms.py | StriveForBest/django-postman | 25f5fcf5a6d54dbb22b393432701652c21e49552 | [
"BSD-3-Clause"
] | null | null | null | postman/forms.py | StriveForBest/django-postman | 25f5fcf5a6d54dbb22b393432701652c21e49552 | [
"BSD-3-Clause"
] | 2 | 2015-04-30T13:46:16.000Z | 2019-09-16T06:55:14.000Z | """
You may define your own custom forms, based or inspired by the following ones.
Examples of customization:
recipients = CommaSeparatedUserField(label=("Recipients", "Recipient"),
min=2,
max=5,
user_filter=my_user_filter,
channel='my_channel',
)
can_overwrite_limits = Fals... | 40.036364 | 129 | 0.63431 | from __future__ import unicode_literals
from django import forms
from django.conf import settings
try:
from django.contrib.auth import get_user_model
except ImportError:
from postman.future_1_5 import get_user_model
from django.db import transaction
from django.utils.translation import ugettext, ugettext_laz... | true | true |
f7158ab6ed278e6df18c8b2e6bfd09087bd18ae7 | 426 | py | Python | Util/EnvUtil.py | xrkk/proxy_pool | 7e4f732041f51fa6aa9a2e906ad9e7cab880f2b6 | [
"MIT"
] | null | null | null | Util/EnvUtil.py | xrkk/proxy_pool | 7e4f732041f51fa6aa9a2e906ad9e7cab880f2b6 | [
"MIT"
] | null | null | null | Util/EnvUtil.py | xrkk/proxy_pool | 7e4f732041f51fa6aa9a2e906ad9e7cab880f2b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: EnvUtil
Description : 环境相关
Author : J_hao
date: 2017/9/18
-------------------------------------------------
Change Activity:
2017/9/18: 区分Python版本
------------------... | 25.058824 | 50 | 0.319249 |
__author__ = 'J_hao'
import sys
PY3 = sys.version_info >= (3,) | true | true |
f7158afa9cbb6416fad2e41340029a8fbbd333f2 | 12,471 | py | Python | tfx/orchestration/kubeflow/kubeflow_dag_runner_test.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/kubeflow_dag_runner_test.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/kubeflow_dag_runner_test.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.790909 | 106 | 0.667228 |
import json
import os
import tarfile
from typing import List
from kfp import onprem
import tensorflow as tf
from tfx.components.statistics_gen import component as statistics_gen_component
from tfx.dsl.component.experimental import executor_specs
from tfx.dsl.component.experimental.annotations import Para... | true | true |
f7158c0d4644817021a89da48a6f1e663928ae91 | 2,766 | py | Python | catalyst/dl/utils/trace.py | 162/catalyst | b4ba36be52c51160e0fabecdcb084a8d5cd96cb7 | [
"MIT"
] | null | null | null | catalyst/dl/utils/trace.py | 162/catalyst | b4ba36be52c51160e0fabecdcb084a8d5cd96cb7 | [
"MIT"
] | null | null | null | catalyst/dl/utils/trace.py | 162/catalyst | b4ba36be52c51160e0fabecdcb084a8d5cd96cb7 | [
"MIT"
] | null | null | null | from typing import Type
import torch
from torch import nn
from torch.jit import ScriptModule
from catalyst.dl.core import Experiment, Runner
class _ForwardOverrideModel(nn.Module):
"""
Model that calls specified method instead of forward
(Workaround, single method tracing is not supported)
"""
... | 25.850467 | 73 | 0.656905 | from typing import Type
import torch
from torch import nn
from torch.jit import ScriptModule
from catalyst.dl.core import Experiment, Runner
class _ForwardOverrideModel(nn.Module):
def __init__(self, model, method_name):
super().__init__()
self.model = model
self.method = method_name
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.