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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f732e6cdeddc94f79176604dc26000aa1254bbb5 | 7,038 | py | Python | data_collection/script.py | sukumargv/hurricane | 98e792f94f6924e0b3fcfb8aef32a6638a551cd2 | [
"MIT"
] | null | null | null | data_collection/script.py | sukumargv/hurricane | 98e792f94f6924e0b3fcfb8aef32a6638a551cd2 | [
"MIT"
] | 2 | 2016-09-26T16:45:53.000Z | 2016-09-26T17:11:35.000Z | data_collection/script.py | sukumargv/hurricane | 98e792f94f6924e0b3fcfb8aef32a6638a551cd2 | [
"MIT"
] | null | null | null | import threading
from bs4 import BeautifulSoup
import re
import math
import json
import urllib2
from datetime import datetime
import pytz
start_time = datetime.utcnow()
# convert pixels to coordinates
'''
def pixels_to_coordinates(route_no, center_x, center_y):
ds = gdal.Open(route_no)
# unravel GDAL affine... | 39.1 | 119 | 0.593208 | import threading
from bs4 import BeautifulSoup
import re
import math
import json
import urllib2
from datetime import datetime
import pytz
start_time = datetime.utcnow()
def html_json(url, fname, rid):
soup = BeautifulSoup(urllib2.urlopen(url).read(),
'html.parser')
local_format = ... | true | true |
f732e6f588f5855f7f3ca7d4824dee056ed66fae | 813 | py | Python | configs/scratch/mask_rcnn_r50_fpn_gn-all_scratch_6x_coco.py | SeanZhang777/mmdetection | 14d250f9575198a8d0f2001903e4eed908e4461f | [
"Apache-2.0"
] | 4 | 2021-06-01T08:33:56.000Z | 2022-02-12T14:54:09.000Z | configs/scratch/mask_rcnn_r50_fpn_gn-all_scratch_6x_coco.py | SeanZhang777/mmdetection | 14d250f9575198a8d0f2001903e4eed908e4461f | [
"Apache-2.0"
] | null | null | null | configs/scratch/mask_rcnn_r50_fpn_gn-all_scratch_6x_coco.py | SeanZhang777/mmdetection | 14d250f9575198a8d0f2001903e4eed908e4461f | [
"Apache-2.0"
] | 1 | 2021-06-01T08:34:00.000Z | 2021-06-01T08:34:00.000Z | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
pretrained=None,
backbone=dict(
frozen_stages=-1, zero... | 33.875 | 72 | 0.692497 | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
pretrained=None,
backbone=dict(
frozen_stages=-1, zero... | true | true |
f732e886bb6651ccc0f8d71e8ddd18c7c6dbccb9 | 266 | py | Python | Workshop/Part3/part3_sol.py | ibenemerito88/openBF_workshop | a63a6fbd1ef8528890fb1072730124e054875008 | [
"Zlib",
"Apache-2.0"
] | null | null | null | Workshop/Part3/part3_sol.py | ibenemerito88/openBF_workshop | a63a6fbd1ef8528890fb1072730124e054875008 | [
"Zlib",
"Apache-2.0"
] | null | null | null | Workshop/Part3/part3_sol.py | ibenemerito88/openBF_workshop | a63a6fbd1ef8528890fb1072730124e054875008 | [
"Zlib",
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
import reslast
plt.close("all")
# Symmetric network
q,a,p,u,c,n,s = reslast.resu("network")
# Non-symmetric network
qn,an,pn,un,cn,nn,sn = reslast.resu("networknonsym")
plt.show() | 14.777778 | 52 | 0.733083 | import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
import reslast
plt.close("all")
q,a,p,u,c,n,s = reslast.resu("network")
qn,an,pn,un,cn,nn,sn = reslast.resu("networknonsym")
plt.show() | true | true |
f732e8b734c2a496b973cb2688cadd10beb54d63 | 1,044 | py | Python | users/users.py | TRUFA-rnaseq/trufa-users-sqlite | 7213481786037414952deb419014627c42cc79ac | [
"BSD-3-Clause"
] | null | null | null | users/users.py | TRUFA-rnaseq/trufa-users-sqlite | 7213481786037414952deb419014627c42cc79ac | [
"BSD-3-Clause"
] | null | null | null | users/users.py | TRUFA-rnaseq/trufa-users-sqlite | 7213481786037414952deb419014627c42cc79ac | [
"BSD-3-Clause"
] | null | null | null | # ------------------------------------------------------------------------------
from . import database as db
# ------------------------------------------------------------------------------
def checkUser(username, passwd):
return db.checkUser(username, passwd)
# ------------------------------------------------... | 32.625 | 80 | 0.344828 |
from . import database as db
def checkUser(username, passwd):
return db.checkUser(username, passwd)
def checkIfUserAvailable(username):
return db.checkIfUserAvailable(username)
def getUserEmail(username):
return db.getUserEmail(username)
def allowPasswordChange(username):
return True
def... | true | true |
f732e8e89e99d78486d786aaa8642acc5b624676 | 184 | py | Python | spotify_dl/constants.py | opiumozor/spotify-dl | 2e5b42727f6d05123e8f05c0b8da547585b6a9d2 | [
"MIT"
] | 1 | 2020-12-22T23:06:27.000Z | 2020-12-22T23:06:27.000Z | spotify_dl/constants.py | opiumozor/spotify-dl | 2e5b42727f6d05123e8f05c0b8da547585b6a9d2 | [
"MIT"
] | null | null | null | spotify_dl/constants.py | opiumozor/spotify-dl | 2e5b42727f6d05123e8f05c0b8da547585b6a9d2 | [
"MIT"
] | null | null | null | __all__ = ['VERSION']
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
VIDEO = 'youtube#video'
YOUTUBE_VIDEO_URL = 'https://www.youtube.com/watch?v='
VERSION = '4.0.0'
| 23 | 54 | 0.728261 | __all__ = ['VERSION']
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
VIDEO = 'youtube#video'
YOUTUBE_VIDEO_URL = 'https://www.youtube.com/watch?v='
VERSION = '4.0.0'
| true | true |
f732e9b2a6ebaaa5570c84740a20877a5638855d | 162 | py | Python | tests/test_models/test_backbones/__init__.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_backbones/__init__.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_backbones/__init__.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .utils import check_norm_state, is_block, is_norm
__all__ = ['is_block', 'is_norm', 'check_norm_state']
| 32.4 | 55 | 0.740741 |
from .utils import check_norm_state, is_block, is_norm
__all__ = ['is_block', 'is_norm', 'check_norm_state']
| true | true |
f732eaff6151f4d4b22cd35da4acef79c66dca69 | 2,212 | py | Python | tests/integration/exception_test.py | enginbozaba/stweet-twitter-api | 060250e00a01ae53c2ca12954719b5efc918e132 | [
"MIT"
] | null | null | null | tests/integration/exception_test.py | enginbozaba/stweet-twitter-api | 060250e00a01ae53c2ca12954719b5efc918e132 | [
"MIT"
] | null | null | null | tests/integration/exception_test.py | enginbozaba/stweet-twitter-api | 060250e00a01ae53c2ca12954719b5efc918e132 | [
"MIT"
] | null | null | null | import pytest
import stweet as st
from stweet.auth import TwitterAuthTokenProvider, SimpleAuthTokenProvider
from stweet.exceptions import RefreshTokenException, ScrapBatchBadResponse
from tests.integration.mock_web_client import MockWebClient
def test_get_auth_token_with_incorrect_response_1():
with pytest.raise... | 38.807018 | 117 | 0.711121 | import pytest
import stweet as st
from stweet.auth import TwitterAuthTokenProvider, SimpleAuthTokenProvider
from stweet.exceptions import RefreshTokenException, ScrapBatchBadResponse
from tests.integration.mock_web_client import MockWebClient
def test_get_auth_token_with_incorrect_response_1():
with pytest.raise... | true | true |
f732ed8370a93b287fd9dff34ab1c8565a35baae | 2,805 | py | Python | user/models/verifycode.py | Hrsn2861/pysat-server | 72224bb0e6af8ef825eaf3259587698b5639b8a5 | [
"MIT"
] | null | null | null | user/models/verifycode.py | Hrsn2861/pysat-server | 72224bb0e6af8ef825eaf3259587698b5639b8a5 | [
"MIT"
] | 7 | 2020-06-06T01:55:39.000Z | 2022-02-10T11:46:31.000Z | user/models/verifycode.py | Hrsnnnn/pysat-server | 72224bb0e6af8ef825eaf3259587698b5639b8a5 | [
"MIT"
] | null | null | null | """Models about verify
"""
from django.db import models
from utils import getdate_now, randkey
from utils.checker import UserInfoChecker
class VerifyCode(models.Model):
"""VerifyCode
"""
session_id = models.IntegerField()
phone = models.CharField(max_length=11)
code = models.CharField(max_length=8... | 26.714286 | 59 | 0.557576 | from django.db import models
from utils import getdate_now, randkey
from utils.checker import UserInfoChecker
class VerifyCode(models.Model):
session_id = models.IntegerField()
phone = models.CharField(max_length=11)
code = models.CharField(max_length=8)
send_time = models.DateTimeField()
class M... | true | true |
f732ee5fee3b6ed7c4a9c5da6e42fa1b95cb49b1 | 1,200 | py | Python | aliyun-python-sdk-edas/aliyunsdkedas/request/v20170801/ListDegradeControlsRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-edas/aliyunsdkedas/request/v20170801/ListDegradeControlsRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-edas/aliyunsdkedas/request/v20170801/ListDegradeControlsRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.5 | 73 | 0.7625 |
from aliyunsdkcore.request import RoaRequest
class ListDegradeControlsRequest(RoaRequest):
def __init__(self):
RoaRequest.__init__(self, 'Edas', '2017-08-01', 'ListDegradeControls')
self.set_uri_pattern('/pop/v5/app/degradeControls')
self.set_method('GET')
def get_AppId(self):
return... | true | true |
f732f01c93fca354ce9cbdca8c18adaa7da7961b | 415,830 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py | benbp/azure-sdk-for-python | 2329ba03e48098dcdc581898f6434d7c2b13a7b9 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py | benbp/azure-sdk-for-python | 2329ba03e48098dcdc581898f6434d7c2b13a7b9 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py | benbp/azure-sdk-for-python | 2329ba03e48098dcdc581898f6434d7c2b13a7b9 | [
"MIT"
] | null | null | null | # 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 ... | 43.324651 | 901 | 0.678087 |
import datetime
from typing import Dict, List, Optional, Union
import msrest.serialization
from ._compute_management_client_enums import *
class AccessUri(msrest.serialization.Model):
_validation = {
'access_sas': {'readonly': True},
}
_attribute_map = {
'access_sas': {'key': '... | true | true |
f732f0d839cc5d33925dcd7c1ee794b50b520202 | 576 | py | Python | utils/cython/setup.py | AsaphLightricks/3DDFA | 7630986c0286cd2c85b5dfd14ae6e8322e4ba605 | [
"MIT"
] | null | null | null | utils/cython/setup.py | AsaphLightricks/3DDFA | 7630986c0286cd2c85b5dfd14ae6e8322e4ba605 | [
"MIT"
] | null | null | null | utils/cython/setup.py | AsaphLightricks/3DDFA | 7630986c0286cd2c85b5dfd14ae6e8322e4ba605 | [
"MIT"
] | null | null | null | '''
python setup.py build_ext -i
to compile
'''
# setup.py
from distutils.core import setup, Extension
# from Cython.Build import cythonize
from Cython.Distutils import build_ext
import numpy
setup(
name='mesh_core_cython',
cmdclass={'build_ext': build_ext},
ext_modules=[Extension("mesh_core_cython",
... | 27.428571 | 135 | 0.623264 |
from distutils.core import setup, Extension
from Cython.Distutils import build_ext
import numpy
setup(
name='mesh_core_cython',
cmdclass={'build_ext': build_ext},
ext_modules=[Extension("mesh_core_cython",
sources=["mesh_core_cython.pyx", "mesh_core.cpp"],
... | true | true |
f732f0dc65b3444ec138652f503105e575e280c7 | 1,563 | py | Python | saboteurs/tools.py | Edinburgh-Genome-Foundry/saboteurs | e421b241cd227537c78e6d6bff97fa8aa3f88219 | [
"MIT"
] | 6 | 2018-12-17T11:44:22.000Z | 2020-11-02T10:46:16.000Z | saboteurs/tools.py | Edinburgh-Genome-Foundry/saboteurs | e421b241cd227537c78e6d6bff97fa8aa3f88219 | [
"MIT"
] | null | null | null | saboteurs/tools.py | Edinburgh-Genome-Foundry/saboteurs | e421b241cd227537c78e6d6bff97fa8aa3f88219 | [
"MIT"
] | null | null | null | from collections import OrderedDict
def csv_to_groups_data(csv_path=None, csv_string=None):
"""Read a CSV to get the data to feed to ``find_statistical_saboteurs()``
or ``find_logical_saboteurs()``.
See examples of such a file in the code repository:
https://github.com/Edinburgh-Genome-Foundry/sabot... | 30.057692 | 88 | 0.550224 | from collections import OrderedDict
def csv_to_groups_data(csv_path=None, csv_string=None):
if csv_string is None:
with open(csv_path, "r") as f:
csv_string = f.read()
lines = [
[e.strip() for e in l.split(",") if len(e.strip())]
for l in csv_string.split("\n")
if l... | true | true |
f732f1d978cb0ce632674ce18f5e5d8efdd69688 | 25,770 | py | Python | mne/io/pick.py | britta-wstnr/mne-python | b69afd1ff3337ac84f219b26c53537a5c8ceb1b9 | [
"BSD-3-Clause"
] | null | null | null | mne/io/pick.py | britta-wstnr/mne-python | b69afd1ff3337ac84f219b26c53537a5c8ceb1b9 | [
"BSD-3-Clause"
] | null | null | null | mne/io/pick.py | britta-wstnr/mne-python | b69afd1ff3337ac84f219b26c53537a5c8ceb1b9 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from copy import deepcopy
import re
import numpy as np
from .constants import FIFF
from ..utils import logge... | 34.683715 | 79 | 0.60066 |
from copy import deepcopy
import re
import numpy as np
from .constants import FIFF
from ..utils import logger, verbose
from ..externals.six import string_types
def channel_type(info, idx):
kind = info['chs'][idx]['kind']
if kind == FIFF.FIFFV_MEG_CH:
if info['chs'][idx]['unit'] == FIFF.FIFF_UN... | true | true |
f732f4e7e21e8a4fab8a3b90ccfac4661d2c653c | 1,118 | py | Python | reana_job_controller/spec.py | CodyKank/reana-job-controller | 66da26389b69b8c711ace53fedaa2a70b9c34e5f | [
"MIT"
] | null | null | null | reana_job_controller/spec.py | CodyKank/reana-job-controller | 66da26389b69b8c711ace53fedaa2a70b9c34e5f | [
"MIT"
] | null | null | null | reana_job_controller/spec.py | CodyKank/reana-job-controller | 66da26389b69b8c711ace53fedaa2a70b9c34e5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""OpenAPI generator."""
from apispec import APISpec
from flask ... | 26.619048 | 72 | 0.65653 |
from apispec import APISpec
from flask import current_app
from reana_job_controller.schemas import Job, JobRequest
def build_openapi_spec():
spec = APISpec(
title='reana-job-controller',
version='0.4.0',
info=dict(
description='REANA Job Controller API'
),
... | true | true |
f732f5eed6da1e0445d9d1307cec5a6e5f0ed759 | 1,887 | py | Python | books_app/core/migrations/0002_auto_20210704_1304.py | JvitorS23/my-book-list | 3d41404d1eead6e10628678a67f6c47615f66caf | [
"MIT"
] | 3 | 2021-07-14T00:33:59.000Z | 2022-03-08T11:21:49.000Z | books_app/core/migrations/0002_auto_20210704_1304.py | JvitorS23/my-book-list | 3d41404d1eead6e10628678a67f6c47615f66caf | [
"MIT"
] | 8 | 2021-07-01T12:37:08.000Z | 2021-07-04T20:09:35.000Z | books_app/core/migrations/0002_auto_20210704_1304.py | JvitorS23/my-book-list | 3d41404d1eead6e10628678a67f6c47615f66caf | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-07-04 13:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
... | 41.933333 | 199 | 0.583996 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_staff',... | true | true |
f732f62e663a2d692aa7e047db88d8bf741bbb37 | 4,878 | py | Python | networkx-d3-v2/lib/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py | suraj-testing2/Clock_Websites | 0e65331da40cfd3766f1bde17f0a9c7ff6666dea | [
"Apache-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | networkx-d3-v2/lib/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py | suraj-testing2/Clock_Websites | 0e65331da40cfd3766f1bde17f0a9c7ff6666dea | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | networkx-d3-v2/lib/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py | suraj-testing2/Clock_Websites | 0e65331da40cfd3766f1bde17f0a9c7ff6666dea | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | """TLS Lite + asyncore."""
import asyncore
from gdata.tlslite.TLSConnection import TLSConnection
from AsyncStateMachine import AsyncStateMachine
class TLSAsyncDispatcherMixIn(AsyncStateMachine):
"""This class can be "mixed in" with an
L{asyncore.dispatcher} to add TLS support.
This class es... | 34.842857 | 76 | 0.639811 |
import asyncore
from gdata.tlslite.TLSConnection import TLSConnection
from AsyncStateMachine import AsyncStateMachine
class TLSAsyncDispatcherMixIn(AsyncStateMachine):
def __init__(self, sock=None):
AsyncStateMachine.__init__(self)
if sock:
self.tlsConnection = TLSCo... | true | true |
f732f736784b388962d513111f1e7834e84036cd | 14,608 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/arista/eos/tests/unit/modules/network/eos/test_eos_acls.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/arista/eos/tests/unit/modules/network/eos/test_eos_acls.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/arista/eos/tests/unit/modules/network/eos/test_eos_acls.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.arista.eos.tests.unit.compat.mock import patch
from ansible_collections.a... | 37.649485 | 123 | 0.374932 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.arista.eos.tests.unit.compat.mock import patch
from ansible_collections.arista.eos.plugins.modules import eos_acls
from ansible_collections.arista.eos.plugins.module_utils.network.eos.config.acls.acls i... | true | true |
f732f7906f9eea0af911846b31d9da44293429d5 | 7,757 | py | Python | sas/sascalc/data_util/ordereddicttest.py | arm61/fitbenchmarking | c745c684e3ca4895a666eb863426746d8f06636c | [
"BSD-3-Clause"
] | null | null | null | sas/sascalc/data_util/ordereddicttest.py | arm61/fitbenchmarking | c745c684e3ca4895a666eb863426746d8f06636c | [
"BSD-3-Clause"
] | null | null | null | sas/sascalc/data_util/ordereddicttest.py | arm61/fitbenchmarking | c745c684e3ca4895a666eb863426746d8f06636c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from random import shuffle
import copy
import inspect
import pickle
import unittest
from ordereddict import OrderedDict
class TestOrderedDict(unittest.TestCase):
def test_init(self):
self.assertRaises(TypeError, OrderedDict, ([('a', 1), ('b', 2)], None))
# too man... | 41.481283 | 97 | 0.485755 |
from random import shuffle
import copy
import inspect
import pickle
import unittest
from ordereddict import OrderedDict
class TestOrderedDict(unittest.TestCase):
def test_init(self):
self.assertRaises(TypeError, OrderedDict, ([('a', 1), ('b', 2)], None))
pairs = [('a', 1), ('... | true | true |
f732f8891382f4d823f29467801b37510e4bebda | 118 | py | Python | {{cookiecutter.project_slug}}/src/app/admin/model_admin.py | nvo87/django | fd07fb74ab59e868c73512cd0ca4952129b44cd8 | [
"MIT"
] | 98 | 2020-04-21T20:22:16.000Z | 2021-06-07T12:33:51.000Z | {{cookiecutter.project_slug}}/src/app/admin/model_admin.py | nvo87/django | fd07fb74ab59e868c73512cd0ca4952129b44cd8 | [
"MIT"
] | 70 | 2020-04-21T21:59:49.000Z | 2021-06-13T13:35:01.000Z | {{cookiecutter.project_slug}}/src/app/admin/model_admin.py | ginsenghillock/django | 65ab4f52897ca7efdfde347383153fca4f2d2c14 | [
"MIT"
] | 23 | 2020-04-23T06:03:13.000Z | 2021-06-09T06:59:34.000Z | from django.contrib import admin
class ModelAdmin(admin.ModelAdmin):
"""Future app-wide admin customizations"""
| 19.666667 | 46 | 0.762712 | from django.contrib import admin
class ModelAdmin(admin.ModelAdmin):
| true | true |
f732f8a071807b509d76e81fff8b30ee19833db3 | 2,278 | py | Python | src/config/fabric-ansible/job_manager/sandesh_utils.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/config/fabric-ansible/job_manager/sandesh_utils.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/fabric-ansible/job_manager/sandesh_utils.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | #
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
"""Contains utility functions used for Sandesh initialization and logging."""
from builtins import object
import time
from job_manager.job_exception import JobException
from job_manager.job_messages import MsgBundle
class SandeshUtils(object):
... | 34 | 77 | 0.614574 |
from builtins import object
import time
from job_manager.job_exception import JobException
from job_manager.job_messages import MsgBundle
class SandeshUtils(object):
def __init__(self, logger):
self._logger = logger
def wait_for_connection_establish(self):
total_wait = 0
state ... | true | true |
f732f8e51cba0ac367420fda29c64bfbd1f0079a | 1,484 | py | Python | backend/pycloud_api/api/endpoints/user.py | git-albertomarin/pycloud | 2d273096bc16d09ec2890ca3e3200ad64bde92d3 | [
"Apache-2.0"
] | 3 | 2020-02-23T12:54:47.000Z | 2021-01-09T11:32:49.000Z | backend/pycloud_api/api/endpoints/user.py | git-albertomarin/pycloud | 2d273096bc16d09ec2890ca3e3200ad64bde92d3 | [
"Apache-2.0"
] | 5 | 2021-03-09T22:04:10.000Z | 2022-02-18T14:07:29.000Z | backend/pycloud_api/api/endpoints/user.py | albmarin/Pycloud | 2d273096bc16d09ec2890ca3e3200ad64bde92d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from fastapi import APIRouter, Body, Security
from pycloud_api.crud.tenant import get_tenant_by_id
from pycloud_api.crud.user import get_current_user, check_free_username_and_email
from pycloud_api.models.schemas.tenant import Tenant, TenantInResponse
from pycloud_api.models.schemas.user import ... | 38.051282 | 88 | 0.760108 |
from fastapi import APIRouter, Body, Security
from pycloud_api.crud.tenant import get_tenant_by_id
from pycloud_api.crud.user import get_current_user, check_free_username_and_email
from pycloud_api.models.schemas.tenant import Tenant, TenantInResponse
from pycloud_api.models.schemas.user import User, UserInDB, UserInR... | true | true |
f732f9ff8549e75b8c69601d77977b4b42746a1b | 1,713 | py | Python | amaranth_boards/zturn_lite_z007s.py | lethalbit/nmigen-boards | aaf18252e457ff95257137da2a629820c0ff2bfa | [
"BSD-2-Clause"
] | 11 | 2021-12-10T12:23:29.000Z | 2022-03-13T08:40:20.000Z | amaranth_boards/zturn_lite_z007s.py | lethalbit/nmigen-boards | aaf18252e457ff95257137da2a629820c0ff2bfa | [
"BSD-2-Clause"
] | 12 | 2021-12-11T18:51:29.000Z | 2022-03-12T05:08:52.000Z | amaranth_boards/zturn_lite_z007s.py | lethalbit/nmigen-boards | aaf18252e457ff95257137da2a629820c0ff2bfa | [
"BSD-2-Clause"
] | 7 | 2021-12-12T07:20:21.000Z | 2022-03-06T06:20:55.000Z | from amaranth.build import *
from amaranth.vendor.xilinx_7series import *
__all__ = ["ZTurnLiteZ007SPlatform"]
class ZTurnLiteZ007SPlatform(Xilinx7SeriesPlatform):
device = "xc7z007s"
package = "clg400"
speed = "1"
resources = []
connectors = [
Connector("expansion", 0,
... | 22.246753 | 52 | 0.269119 | from amaranth.build import *
from amaranth.vendor.xilinx_7series import *
__all__ = ["ZTurnLiteZ007SPlatform"]
class ZTurnLiteZ007SPlatform(Xilinx7SeriesPlatform):
device = "xc7z007s"
package = "clg400"
speed = "1"
resources = []
connectors = [
Connector("expansion", 0,
... | true | true |
f732fbd3e6dc3979180d2e2ad1d28018bd128e2d | 12,791 | py | Python | backend/proxy_modules/forgery.py | veepee-oss/hermes | 24b3057a8a1faf3a92291e86dc889f291d874ad0 | [
"0BSD"
] | 26 | 2021-08-04T14:06:58.000Z | 2021-12-14T09:15:02.000Z | backend/proxy_modules/forgery.py | veepee-oss/hermes | 24b3057a8a1faf3a92291e86dc889f291d874ad0 | [
"0BSD"
] | null | null | null | backend/proxy_modules/forgery.py | veepee-oss/hermes | 24b3057a8a1faf3a92291e86dc889f291d874ad0 | [
"0BSD"
] | 4 | 2021-08-18T04:06:45.000Z | 2022-01-02T17:47:27.000Z | import copy
import json
import ssl
import flexssl
import re
import base64
import subprocess
import os
import gzip
import random
from bson import json_util
from py_mini_racer import py_mini_racer
import utils.redis_utils
import proxy_modules.utils
def handle_connection_close_header(request_breakdow... | 34.384409 | 172 | 0.619029 | import copy
import json
import ssl
import flexssl
import re
import base64
import subprocess
import os
import gzip
import random
from bson import json_util
from py_mini_racer import py_mini_racer
import utils.redis_utils
import proxy_modules.utils
def handle_connection_close_header(request_breakdow... | true | true |
f732fd11bb89a0d743915922aa15867ea03dfdb3 | 10,654 | py | Python | logging_plus/__init__.py | signag/py-logging-plus | dee3c63a36033183628d1941eb08e4dd0d613866 | [
"MIT"
] | null | null | null | logging_plus/__init__.py | signag/py-logging-plus | dee3c63a36033183628d1941eb08e4dd0d613866 | [
"MIT"
] | null | null | null | logging_plus/__init__.py | signag/py-logging-plus | dee3c63a36033183628d1941eb08e4dd0d613866 | [
"MIT"
] | null | null | null | #MIT License
#
#Copyright (c) 2020 signag
#
#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, di... | 33.822222 | 124 | 0.620237 |
import logging
import inspect
import sys
import atexit
noInfrastructureLogging = True
class Manager(logging.Manager):
def __init__(self, rootnode):
super().__init__(rootnode)
def getLogger(self, name):
rv = None
if not isinstance(name, str):
rai... | true | true |
f732fd69f8f5bfd7c3e567e627a4c59e84d2aee0 | 3,260 | py | Python | gym-rbdl/gym_rbdl/envs/real_pendulum.py | michaelyeah7/magics_mbrl | 7f1503986fd50c8336b8b9e7bb1d2f4be4e84b08 | [
"MIT"
] | 2 | 2021-10-02T21:58:02.000Z | 2022-03-23T15:34:46.000Z | gym-rbdl/gym_rbdl/envs/real_pendulum.py | michaelyeah7/roblax | 7f1503986fd50c8336b8b9e7bb1d2f4be4e84b08 | [
"MIT"
] | null | null | null | gym-rbdl/gym_rbdl/envs/real_pendulum.py | michaelyeah7/roblax | 7f1503986fd50c8336b8b9e7bb1d2f4be4e84b08 | [
"MIT"
] | null | null | null | import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from os import path
class PendulumEnv(gym.Env):
metadata = {"render.modes": ["human", "rgb_array"], "video.frames_per_second": 30}
def __init__(self, g=10.0):
self.max_speed = 8
self.max_torque = 2.0
se... | 32.277228 | 86 | 0.557975 | import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from os import path
class PendulumEnv(gym.Env):
metadata = {"render.modes": ["human", "rgb_array"], "video.frames_per_second": 30}
def __init__(self, g=10.0):
self.max_speed = 8
self.max_torque = 2.0
se... | true | true |
f732fdf1128b31b7b49d386c93aa86199f8cc84f | 109 | py | Python | examples/etcc.py | t-pimpisa/pythainlp17 | cc6bc4991dfffd68953dcdb26fd99c22d60a4c1f | [
"Apache-2.0"
] | null | null | null | examples/etcc.py | t-pimpisa/pythainlp17 | cc6bc4991dfffd68953dcdb26fd99c22d60a4c1f | [
"Apache-2.0"
] | null | null | null | examples/etcc.py | t-pimpisa/pythainlp17 | cc6bc4991dfffd68953dcdb26fd99c22d60a4c1f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from pythainlp.tokenize import etcc
print(etcc.etcc("คืนความสุข")) # /คืน/ความสุข
| 18.166667 | 46 | 0.642202 |
from pythainlp.tokenize import etcc
print(etcc.etcc("คืนความสุข"))
| true | true |
f732fedcfa95d0c98923cfbada7fd3b630707d7f | 1,515 | py | Python | gridpot-feeder/GL_TRANSFORMER.py | sk4ld/vagrant-skyline-puppet | 3cfd6083e26f3de0abeea4c6e68f12b3151eb350 | [
"Apache-2.0"
] | 1 | 2015-11-18T19:58:28.000Z | 2015-11-18T19:58:28.000Z | gridpot-feeder/GL_TRANSFORMER.py | sk4ld/vagrant-skyline-puppet | 3cfd6083e26f3de0abeea4c6e68f12b3151eb350 | [
"Apache-2.0"
] | null | null | null | gridpot-feeder/GL_TRANSFORMER.py | sk4ld/vagrant-skyline-puppet | 3cfd6083e26f3de0abeea4c6e68f12b3151eb350 | [
"Apache-2.0"
] | 1 | 2021-08-06T22:17:32.000Z | 2021-08-06T22:17:32.000Z | # GridPot code
# switch object class for integrating with a GridLAB-D simulation instance
# Author: sk4ld
import logging
import urllib2
logger = logging.getLogger(__name__)
from GL_obj import GL_obj
# base object class for integrating with a GridLAB-D simulation instance
class GL_TRANSFORMER(GL_obj):
def init_p... | 37.875 | 101 | 0.592079 |
import logging
import urllib2
logger = logging.getLogger(__name__)
from GL_obj import GL_obj
class GL_TRANSFORMER(GL_obj):
def init_params(self):
self.params["status"] = ""
self.params["phases"] = ""
self.params["from"] = ""
self.params["to"] = ""
... | true | true |
f732ff07b4b9ceaad3c0ef1c9713573cdba5964c | 65 | py | Python | tests/resource/valid/class/import_check.py | JSAbrahams/mamba | 66ae435a4abf496aae945a78e4fdfa8e4785d854 | [
"MIT"
] | 82 | 2019-03-19T14:29:59.000Z | 2022-01-07T15:08:11.000Z | tests/resource/valid/class/import_check.py | JSAbrahams/mamba | 66ae435a4abf496aae945a78e4fdfa8e4785d854 | [
"MIT"
] | 171 | 2019-03-16T14:21:28.000Z | 2022-01-11T15:27:39.000Z | tests/resource/valid/class/import_check.py | JSAbrahams/mamba | 66ae435a4abf496aae945a78e4fdfa8e4785d854 | [
"MIT"
] | 3 | 2019-03-20T14:06:49.000Z | 2020-05-18T09:24:02.000Z | from a import b,c as c,d
from b import c
import d
import d as dd
| 13 | 24 | 0.723077 | from a import b,c as c,d
from b import c
import d
import d as dd
| true | true |
f732ff2b0f8c36e28675b28dbadae1a7182a00bc | 42,238 | py | Python | lib/sqlalchemy/sql/ddl.py | drecover/sqlalchemy | 6206f0ff74e95c9339dc0f0e26caab55e9bcda45 | [
"MIT"
] | null | null | null | lib/sqlalchemy/sql/ddl.py | drecover/sqlalchemy | 6206f0ff74e95c9339dc0f0e26caab55e9bcda45 | [
"MIT"
] | 1 | 2020-08-07T16:50:16.000Z | 2020-08-07T16:50:16.000Z | lib/sqlalchemy/sql/ddl.py | drecover/sqlalchemy | 6206f0ff74e95c9339dc0f0e26caab55e9bcda45 | [
"MIT"
] | null | null | null | # sql/ddl.py
# Copyright (C) 2009-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke the... | 32.69195 | 79 | 0.608244 |
from . import roles
from .base import _generative
from .base import Executable
from .base import SchemaVisitor
from .elements import ClauseElement
from .. import exc
from .. import util
from ..util import topological
class _DDLCompiles(ClauseElement):
def _compiler(self, dialect, **kw):
return dia... | true | true |
f732ff55a4a646485c2089f03e232039dc638275 | 1,579 | py | Python | qcodes/tests/dataset/test_subscribing.py | cgranade/Qcodes | 2d8fd0b8e0fa12d7921a96003318598ad347dd05 | [
"MIT"
] | 1 | 2019-10-12T04:54:30.000Z | 2019-10-12T04:54:30.000Z | qcodes/tests/dataset/test_subscribing.py | cgranade/Qcodes | 2d8fd0b8e0fa12d7921a96003318598ad347dd05 | [
"MIT"
] | null | null | null | qcodes/tests/dataset/test_subscribing.py | cgranade/Qcodes | 2d8fd0b8e0fa12d7921a96003318598ad347dd05 | [
"MIT"
] | null | null | null | # Test some subscription scenarios
from typing import List, Tuple, Dict, Union
from numbers import Number
import pytest
from numpy import ndarray
from qcodes.dataset.param_spec import ParamSpec
# pylint: disable=unused-import
from qcodes.tests.dataset.temporary_databases import (empty_temp_db,
... | 29.792453 | 74 | 0.609246 |
from typing import List, Tuple, Dict, Union
from numbers import Number
import pytest
from numpy import ndarray
from qcodes.dataset.param_spec import ParamSpec
from qcodes.tests.dataset.temporary_databases import (empty_temp_db,
experiment,
... | true | true |
f732ffa63ee18b865a81cf1519498f341dbde992 | 13,600 | py | Python | utils.py | ZeroDesigner/quantum-gan | 76b12fe1be25ac2a5e75fdc472947a08d7065c50 | [
"MIT"
] | 49 | 2021-01-12T04:18:58.000Z | 2022-03-06T03:19:39.000Z | utils.py | jundeli/quantum-gan | 76b12fe1be25ac2a5e75fdc472947a08d7065c50 | [
"MIT"
] | null | null | null | utils.py | jundeli/quantum-gan | 76b12fe1be25ac2a5e75fdc472947a08d7065c50 | [
"MIT"
] | 17 | 2021-01-14T16:01:24.000Z | 2022-01-20T00:49:56.000Z | from sklearn.metrics import classification_report as sk_classification_report
from sklearn.metrics import confusion_matrix
import pickle
import gzip
from rdkit import DataStructs
from rdkit import Chem
from rdkit.Chem import QED
from rdkit.Chem import Crippen
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
... | 41.087613 | 120 | 0.614632 | from sklearn.metrics import classification_report as sk_classification_report
from sklearn.metrics import confusion_matrix
import pickle
import gzip
from rdkit import DataStructs
from rdkit import Chem
from rdkit.Chem import QED
from rdkit.Chem import Crippen
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
... | true | true |
f732ffea86e424f5d7345500e9a63580f2cb690e | 1,887 | py | Python | tools/harness-automation/cases/commissioner_8_1_1.py | ltaoti/openthread | b24192267d56c9a175739d8b2a285bc4b701deaf | [
"BSD-3-Clause"
] | 3 | 2018-06-20T11:13:33.000Z | 2020-12-08T15:15:10.000Z | tools/harness-automation/cases/commissioner_8_1_1.py | ltaoti/openthread | b24192267d56c9a175739d8b2a285bc4b701deaf | [
"BSD-3-Clause"
] | 2 | 2017-03-23T07:47:54.000Z | 2017-08-21T03:12:31.000Z | tools/harness-automation/cases/commissioner_8_1_1.py | ltaoti/openthread | b24192267d56c9a175739d8b2a285bc4b701deaf | [
"BSD-3-Clause"
] | 3 | 2017-08-29T01:31:57.000Z | 2020-05-07T22:56:52.000Z | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | 42.886364 | 77 | 0.772655 |
import unittest
from autothreadharness.harness_case import HarnessCase
class Commissioner_8_1_1(HarnessCase):
role = HarnessCase.ROLE_COMMISSIONER
case = '8 1 1'
golden_devices_required = 1
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
u... | true | true |
f7330023a31679d2fbb1d500dfb418d3b17ea11b | 112,294 | py | Python | keepa/interface.py | akaszynski/keepa | ffc35edc2f7a4601408b0f0a22a8856be88dcb3e | [
"Apache-2.0"
] | 110 | 2019-02-27T20:28:16.000Z | 2022-03-25T12:58:14.000Z | keepa/interface.py | akaszynski/keepa | ffc35edc2f7a4601408b0f0a22a8856be88dcb3e | [
"Apache-2.0"
] | 74 | 2019-02-23T14:31:10.000Z | 2022-03-25T02:55:06.000Z | keepa/interface.py | akaszynski/keepa | ffc35edc2f7a4601408b0f0a22a8856be88dcb3e | [
"Apache-2.0"
] | 50 | 2019-02-26T21:17:37.000Z | 2022-03-24T02:42:36.000Z | """Interface module to download Amazon product and history data from
keepa.com
"""
import requests
import asyncio
import datetime
import json
import logging
import time
from functools import wraps
import aiohttp
import numpy as np
import pandas as pd
from tqdm import tqdm
from keepa.query_keys import DEAL_REQUEST_KE... | 41.178585 | 115 | 0.562639 |
import requests
import asyncio
import datetime
import json
import logging
import time
from functools import wraps
import aiohttp
import numpy as np
import pandas as pd
from tqdm import tqdm
from keepa.query_keys import DEAL_REQUEST_KEYS, PRODUCT_REQUEST_KEYS
def is_documented_by(original):
def wrapper(target)... | true | true |
f7330032a0c00b8ed90a653c8a08895ffa52cf4e | 5,999 | py | Python | mpc/kmpc_casadi/utility/casadi-example_pack-v3.4.4/python/vdp_collocation2.py | se-hwan/MIT_Driverless | 7674b29887ba518c134cfba805432f9c98f92270 | [
"MIT"
] | 2 | 2021-03-22T08:50:29.000Z | 2021-08-18T03:04:18.000Z | flip-optimization-master/casadi/ex/casadi-example_pack-v3.4.0/python/vdp_collocation2.py | WatsonZhouAnda/Cheetah-Software | 05e416fb26f968300826f0deb0953be9afb22bfe | [
"MIT"
] | null | null | null | flip-optimization-master/casadi/ex/casadi-example_pack-v3.4.0/python/vdp_collocation2.py | WatsonZhouAnda/Cheetah-Software | 05e416fb26f968300826f0deb0953be9afb22bfe | [
"MIT"
] | 2 | 2022-01-14T04:28:41.000Z | 2022-01-14T05:29:01.000Z | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | 24.586066 | 127 | 0.635939 |
from casadi import *
from casadi.tools import *
import numpy as NP
import matplotlib.pyplot as plt
nk = 20
tf = 10.0
t = SX.sym("t")
u = SX.sym("u")
states = struct_symSX([
entry('x',shape=2),
entry('L')
])
rhs = struct_SX(... | true | true |
f73300828bf5ac52017e45fc1c5e8a5c2c0df975 | 3,509 | py | Python | bj-web/format-web-templates.py | pastly/blackjack | df59614cdde6a0151b2b3dffcca92705e5394a3d | [
"MIT"
] | 1 | 2021-07-26T20:44:22.000Z | 2021-07-26T20:44:22.000Z | bj-web/format-web-templates.py | pastly/blackjack-rs | df59614cdde6a0151b2b3dffcca92705e5394a3d | [
"MIT"
] | 4 | 2019-12-06T17:48:39.000Z | 2020-03-12T01:18:01.000Z | bj-web/format-web-templates.py | pastly/blackjack | df59614cdde6a0151b2b3dffcca92705e5394a3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from glob import iglob
import os
import logging
from subprocess import run
BIN_EXTS = [
'.wasm',
'.png',
]
VERSION_STR = None
logging.basicConfig(level=logging.INFO)
def abspath(p):
op = os.path
return op.absp... | 30.513043 | 135 | 0.634369 |
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from glob import iglob
import os
import logging
from subprocess import run
BIN_EXTS = [
'.wasm',
'.png',
]
VERSION_STR = None
logging.basicConfig(level=logging.INFO)
def abspath(p):
op = os.path
return op.abspath(op.expanduser(op.e... | true | true |
f733010399f5ba012473da30aa9be866dc57e355 | 7,556 | py | Python | grplot/features/plot/treemaps.py | ghiffaryr/grplot | 43ea08febac4ffecbce0a6a3d679850f5013aa28 | [
"BSD-3-Clause"
] | null | null | null | grplot/features/plot/treemaps.py | ghiffaryr/grplot | 43ea08febac4ffecbce0a6a3d679850f5013aa28 | [
"BSD-3-Clause"
] | null | null | null | grplot/features/plot/treemaps.py | ghiffaryr/grplot | 43ea08febac4ffecbce0a6a3d679850f5013aa28 | [
"BSD-3-Clause"
] | null | null | null | # Squarified Treemap Layout
# Implements algorithm from Bruls, Huizing, van Wijk, "Squarified Treemaps" and Laserson with some modifications
# (but not using their pseudocode)
# INTERNAL FUNCTIONS not meant to be used by the user
def pad_rectangle(rect):
if rect["dx"] > 2:
rect["x"] += 1
rect[... | 28.513208 | 112 | 0.598332 |
def pad_rectangle(rect):
if rect["dx"] > 2:
rect["x"] += 1
rect["dx"] -= 2
if rect["dy"] > 2:
rect["y"] += 1
rect["dy"] -= 2
def layoutrow(sizes, x, y, dx, dy):
covered_area = sum(sizes)
width = covered_area / dy
rects = []
for size i... | true | true |
f733020541f06e586fbfed8118f91663bf6bdd3c | 4,814 | py | Python | tests/unittest/test_sampler.py | bkktimber/gluon-nlp | 205acce13a83b30eabd7a638e4773e7a4f91059a | [
"Apache-2.0"
] | null | null | null | tests/unittest/test_sampler.py | bkktimber/gluon-nlp | 205acce13a83b30eabd7a638e4773e7a4f91059a | [
"Apache-2.0"
] | null | null | null | tests/unittest/test_sampler.py | bkktimber/gluon-nlp | 205acce13a83b30eabd7a638e4773e7a4f91059a | [
"Apache-2.0"
] | 1 | 2018-09-18T08:39:00.000Z | 2018-09-18T08:39:00.000Z | import pytest
import numpy as np
from mxnet.gluon import data
import gluonnlp as nlp
from gluonnlp.data import sampler as s
N = 1000
def test_sorted_sampler():
dataset = data.SimpleDataset([np.random.normal(0, 1, (np.random.randint(10, 100), 1, 1))
for _ in range(N)])
gt_samp... | 49.122449 | 98 | 0.606356 | import pytest
import numpy as np
from mxnet.gluon import data
import gluonnlp as nlp
from gluonnlp.data import sampler as s
N = 1000
def test_sorted_sampler():
dataset = data.SimpleDataset([np.random.normal(0, 1, (np.random.randint(10, 100), 1, 1))
for _ in range(N)])
gt_samp... | true | true |
f73302dea282cd2c8d0f519eeb2540fda43085a2 | 3,677 | py | Python | prssm/benchmarks/run_real_world_tasks/run_large_scale_experiment.py | boschresearch/PR-SSM | 87d24888373b43575924a4e117b496908830d1a9 | [
"MIT",
"BSD-3-Clause"
] | 38 | 2018-07-12T09:48:00.000Z | 2022-03-28T10:31:42.000Z | prssm/benchmarks/run_real_world_tasks/run_large_scale_experiment.py | andreasdoerr/PR-SSM | 87d24888373b43575924a4e117b496908830d1a9 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-11-13T11:48:12.000Z | 2019-12-15T12:50:57.000Z | prssm/benchmarks/run_real_world_tasks/run_large_scale_experiment.py | boschresearch/PR-SSM | 87d24888373b43575924a4e117b496908830d1a9 | [
"MIT",
"BSD-3-Clause"
] | 19 | 2018-09-19T15:26:44.000Z | 2021-12-02T11:31:45.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) 2018 Robert Bosch GmbH
All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
@author: Andreas Doerr
"""
import os
from prssm.benchmarks.run import run
from prssm.tasks.real_world_tasks i... | 33.427273 | 84 | 0.538754 |
import os
from prssm.benchmarks.run import run
from prssm.tasks.real_world_tasks import SarcosArm
from prssm.benchmarks.outputs import VisualOutput
from prssm.benchmarks.outputs import PrintRMSE
from prssm.benchmarks.outputs import SaveRMSE
from prssm.benchmarks.outputs import PrintLogLik
from prssm.benchmarks.out... | true | true |
f73303c8e3b3a96b3d69dd83cfb99a5abe8a2a72 | 721 | py | Python | var/spack/repos/builtin/packages/inputproto/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/inputproto/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/inputproto/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Inputproto(AutotoolsPackage, XorgPackage):
"""X Input Extension.
This extension defin... | 32.772727 | 95 | 0.751734 |
from spack import *
class Inputproto(AutotoolsPackage, XorgPackage):
homepage = "https://cgit.freedesktop.org/xorg/proto/inputproto"
xorg_mirror_path = "proto/inputproto-2.3.2.tar.gz"
version('2.3.2', sha256='10eaadd531f38f7c92ab59ef0708ca195caf3164a75c4ed99f0c04f2913f6ef3')
depends_on('pkgcon... | true | true |
f733056fff62a3323147362fe522314a66fa7c85 | 4,578 | py | Python | flask_sketch/handlers/api_framework_handler.py | ericsouza/flask-sketch | 65625a567e5492b3787c5da3ba5e12b1473783c4 | [
"MIT"
] | 11 | 2020-08-19T14:33:00.000Z | 2021-05-29T17:12:47.000Z | flask_sketch/handlers/api_framework_handler.py | ericsouza/flask-sketch | 65625a567e5492b3787c5da3ba5e12b1473783c4 | [
"MIT"
] | 3 | 2021-03-16T19:33:39.000Z | 2021-03-18T18:53:55.000Z | flask_sketch/handlers/api_framework_handler.py | ericsouza/flask-sketch | 65625a567e5492b3787c5da3ba5e12b1473783c4 | [
"MIT"
] | 2 | 2020-08-19T14:33:11.000Z | 2020-09-16T19:34:16.000Z | import os
from os.path import join as pjoin
from flask_sketch import templates
from flask_sketch.sketch import Sketch
from flask_sketch.const import requirements as reqs
from flask_sketch.utils import GenericHandler
def restx_handler(sketch: Sketch):
if sketch.api_framework == "restx":
sketch.add_requirem... | 30.52 | 89 | 0.576889 | import os
from os.path import join as pjoin
from flask_sketch import templates
from flask_sketch.sketch import Sketch
from flask_sketch.const import requirements as reqs
from flask_sketch.utils import GenericHandler
def restx_handler(sketch: Sketch):
if sketch.api_framework == "restx":
sketch.add_requirem... | true | true |
f7330613c773e3513188aafb37bf605465fc7e38 | 428 | py | Python | scheduler.py | becca-mayers/alert-bot | c4abdc39038fdda97a08c650a64d231282ba0cce | [
"MIT"
] | null | null | null | scheduler.py | becca-mayers/alert-bot | c4abdc39038fdda97a08c650a64d231282ba0cce | [
"MIT"
] | null | null | null | scheduler.py | becca-mayers/alert-bot | c4abdc39038fdda97a08c650a64d231282ba0cce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 9 16:31:57 2021
@author: beccamayers
"""
import schedule
from datetime import datetime
from alert_bot import get_alert
import time
now = datetime.now()
timestamp = now.strftime("%b%d%Y %H%M%p")
def job():
print("Launching Alert Bot app...")
ge... | 16.461538 | 42 | 0.633178 |
import schedule
from datetime import datetime
from alert_bot import get_alert
import time
now = datetime.now()
timestamp = now.strftime("%b%d%Y %H%M%p")
def job():
print("Launching Alert Bot app...")
get_alert()
schedule.every().hour.do(job)
while True:
schedule.run_pending()
... | true | true |
f733062558b556f138fa0ab74640c75b263babd6 | 4,139 | py | Python | deep_qa-master/deep_qa/contrib/models/tree_lstm_model.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | 1 | 2017-04-11T13:03:55.000Z | 2017-04-11T13:03:55.000Z | deep_qa-master/deep_qa/contrib/models/tree_lstm_model.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | null | null | null | deep_qa-master/deep_qa/contrib/models/tree_lstm_model.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict
from overrides import overrides
from keras.layers import Input, Dense, Dropout, merge
from keras.regularizers import l2
from ...data.instances.logical_form_instance import LogicalFormInstance
from ..layers.tree_composition_lstm import TreeCompositionLSTM
from ...training.text_trainer impo... | 44.505376 | 106 | 0.694129 | from typing import Any, Dict
from overrides import overrides
from keras.layers import Input, Dense, Dropout, merge
from keras.regularizers import l2
from ...data.instances.logical_form_instance import LogicalFormInstance
from ..layers.tree_composition_lstm import TreeCompositionLSTM
from ...training.text_trainer impo... | true | true |
f73306ecc4e756db762dfaa3937f0a707690f701 | 16,072 | py | Python | tests/test_event_auth.py | User-green/synapse | 173ddbbe0b220bb28e67575079e1f775d73f967f | [
"Apache-2.0"
] | null | null | null | tests/test_event_auth.py | User-green/synapse | 173ddbbe0b220bb28e67575079e1f775d73f967f | [
"Apache-2.0"
] | null | null | null | tests/test_event_auth.py | User-green/synapse | 173ddbbe0b220bb28e67575079e1f775d73f967f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 30.324528 | 83 | 0.542123 |
import unittest
from typing import Optional
from synapse import event_auth
from synapse.api.errors import AuthError
from synapse.api.room_versions import RoomVersions
from synapse.events import EventBase, make_event_from_dict
from synapse.types import JsonDict, get_domain_from_id
class EventAuthTestCas... | true | true |
f733078f9b4c60d7eb959bf6f4e3c669c39d8b44 | 3,107 | py | Python | rdflib/plugins/parsers/nquads.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 1 | 2020-03-18T08:57:23.000Z | 2020-03-18T08:57:23.000Z | rdflib/plugins/parsers/nquads.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 1 | 2022-03-17T16:46:04.000Z | 2022-03-17T16:46:04.000Z | rdflib/plugins/parsers/nquads.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 2 | 2020-04-15T10:03:29.000Z | 2020-04-20T11:34:18.000Z | """
This is a rdflib plugin for parsing NQuad files into Conjunctive
graphs that can be used and queried. The store that backs the graph
*must* be able to handle contexts.
>>> from rdflib import ConjunctiveGraph, URIRef, Namespace
>>> g = ConjunctiveGraph()
>>> data = open("test/nquads.rdflib/example.nquads", "rb")
>>... | 33.771739 | 82 | 0.64242 | """
This is a rdflib plugin for parsing NQuad files into Conjunctive
graphs that can be used and queried. The store that backs the graph
*must* be able to handle contexts.
>>> from rdflib import ConjunctiveGraph, URIRef, Namespace
>>> g = ConjunctiveGraph()
>>> data = open("test/nquads.rdflib/example.nquads", "rb")
>>... | false | true |
f73307d09ce2412b5111e7dbe06013b05e0f061f | 1,930 | py | Python | homeassistant/components/nam/button.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/nam/button.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/nam/button.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for the Nettigo Air Monitor service."""
from __future__ import annotations
import logging
from homeassistant.components.button import (
ButtonDeviceClass,
ButtonEntity,
ButtonEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
f... | 30.634921 | 84 | 0.759067 | from __future__ import annotations
import logging
from homeassistant.components.button import (
ButtonDeviceClass,
ButtonEntity,
ButtonEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCateg... | true | true |
f73309561fba95db4ba2a0a348346c540dbea713 | 392 | py | Python | pacientes/migrations/0002_auto_20191003_1201.py | williamlemos253/health | 9c4ffebfdf79a6e622225f6b5d059e991c903bc2 | [
"Unlicense"
] | null | null | null | pacientes/migrations/0002_auto_20191003_1201.py | williamlemos253/health | 9c4ffebfdf79a6e622225f6b5d059e991c903bc2 | [
"Unlicense"
] | null | null | null | pacientes/migrations/0002_auto_20191003_1201.py | williamlemos253/health | 9c4ffebfdf79a6e622225f6b5d059e991c903bc2 | [
"Unlicense"
] | null | null | null | # Generated by Django 2.2.5 on 2019-10-03 15:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pacientes', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='empresa',
... | 20.631579 | 63 | 0.596939 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pacientes', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='empresa',
field=models.CharField(blank=True, max_lengt... | true | true |
f7330a456835a6e3ed0b79a4dfe6154732fa71ea | 3,851 | py | Python | parsers/GB_ORK.py | phanthe1/electricitymap-contrib | 26c071107fca86c2548b9558891c4a38b8ac7781 | [
"MIT"
] | 1,582 | 2018-07-16T10:52:36.000Z | 2021-12-06T06:03:32.000Z | parsers/GB_ORK.py | phanthe1/electricitymap-contrib | 26c071107fca86c2548b9558891c4a38b8ac7781 | [
"MIT"
] | 1,463 | 2018-07-09T12:23:35.000Z | 2021-12-06T08:11:37.000Z | parsers/GB_ORK.py | phanthe1/electricitymap-contrib | 26c071107fca86c2548b9558891c4a38b8ac7781 | [
"MIT"
] | 650 | 2018-07-10T02:07:17.000Z | 2021-12-03T11:05:45.000Z | #!/usr/bin/env python3
"""Parser for the Orkney Islands"""
import arrow
import dateutil
import logging
import requests
from bs4 import BeautifulSoup
# There is a 2MW storage battery on the islands.
# http://www.oref.co.uk/orkneys-energy/innovations-2/
TZ = 'Europe/London'
DATETIME_LINK = 'https://www.ssen.co.uk/anm... | 31.056452 | 175 | 0.660608 |
import arrow
import dateutil
import logging
import requests
from bs4 import BeautifulSoup
TZ = 'Europe/London'
DATETIME_LINK = 'https://www.ssen.co.uk/anm/orkney/'
GENERATION_LINK = 'https://www.ssen.co.uk/Sse_Components/Views/Controls/FormControls/Handlers/ActiveNetworkManagementHandler.ashx?action=graph&conten... | true | true |
f7330a62c3ae0fab87713a5d1f5c2187bc314f45 | 2,750 | py | Python | tests/endtoend/TestRealRandomGroupXData.py | jun2tong/bnp-anomaly | c7fa106b5bb29ed6688a3d91e3f302a0a130b896 | [
"BSD-3-Clause"
] | 3 | 2018-07-02T03:50:23.000Z | 2019-05-16T03:23:55.000Z | tests/endtoend/TestRealRandomGroupXData.py | jun2tong/bnp-anomaly | c7fa106b5bb29ed6688a3d91e3f302a0a130b896 | [
"BSD-3-Clause"
] | 1 | 2021-01-07T01:33:06.000Z | 2021-01-07T01:33:06.000Z | tests/endtoend/TestRealRandomGroupXData.py | jun2tong/bnp-anomaly | c7fa106b5bb29ed6688a3d91e3f302a0a130b896 | [
"BSD-3-Clause"
] | 1 | 2020-09-01T13:21:18.000Z | 2020-09-01T13:21:18.000Z | import numpy as np
import unittest
from collections import OrderedDict
import bnpy
from AbstractEndToEndTest import AbstractEndToEndTest
class TestEndToEnd(AbstractEndToEndTest):
__test__ = True
def setUp(self):
""" Create the dataset
"""
rng = np.random.RandomState(0)
X = rn... | 35.714286 | 66 | 0.460727 | import numpy as np
import unittest
from collections import OrderedDict
import bnpy
from AbstractEndToEndTest import AbstractEndToEndTest
class TestEndToEnd(AbstractEndToEndTest):
__test__ = True
def setUp(self):
rng = np.random.RandomState(0)
X = rng.rand(100, 2)
doc_range = [0, 20, ... | true | true |
f7330c64bab4aab0a950535c1736cf21247eb440 | 776 | py | Python | projects/project_2_commerce/auctions/migrations/0013_auto_20210426_1629.py | kevinbeirne1/CS50-course | b6247cdea50890369a5e0fd60017980643bf6e37 | [
"MIT"
] | 1 | 2021-08-31T20:52:41.000Z | 2021-08-31T20:52:41.000Z | projects/project_2_commerce/auctions/migrations/0013_auto_20210426_1629.py | kevinbeirne1/CS50-course | b6247cdea50890369a5e0fd60017980643bf6e37 | [
"MIT"
] | null | null | null | projects/project_2_commerce/auctions/migrations/0013_auto_20210426_1629.py | kevinbeirne1/CS50-course | b6247cdea50890369a5e0fd60017980643bf6e37 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-04-26 20:29
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auctions', '0012_auto_20210426_1628'),
]
operations = [
m... | 28.740741 | 140 | 0.645619 |
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auctions', '0012_auto_20210426_1628'),
]
operations = [
migrations.AlterField(
model_name='c... | true | true |
f7330c6694875625fe7eec1a0346b2660db5233d | 3,759 | py | Python | tests/test_neural_predicate.py | Joshua-Schroijen/deepproblog | 4ae56f1e860010b7857b29d5bd76fb1555d5e19d | [
"Apache-2.0"
] | 54 | 2021-06-23T08:03:23.000Z | 2022-03-10T01:02:43.000Z | tests/test_neural_predicate.py | Damzwan/deepproblog | 56bcf5208e79c17510b5d288068fabc6cd64f3cf | [
"Apache-2.0"
] | 2 | 2021-06-30T23:48:25.000Z | 2022-03-18T10:45:05.000Z | tests/test_neural_predicate.py | Damzwan/deepproblog | 56bcf5208e79c17510b5d288068fabc6cd64f3cf | [
"Apache-2.0"
] | 12 | 2021-06-30T10:47:52.000Z | 2022-03-09T23:51:48.000Z | import pytest
from deepproblog.utils.standard_networks import DummyNet
from problog.logic import Term, Var
from deepproblog.engines import ExactEngine, ApproximateEngine
from deepproblog.heuristics import geometric_mean
from deepproblog.model import Model
from deepproblog.query import Query
from deepproblog.network imp... | 36.495146 | 87 | 0.611067 | import pytest
from deepproblog.utils.standard_networks import DummyNet
from problog.logic import Term, Var
from deepproblog.engines import ExactEngine, ApproximateEngine
from deepproblog.heuristics import geometric_mean
from deepproblog.model import Model
from deepproblog.query import Query
from deepproblog.network imp... | true | true |
f7330cccd845faac892f6590e80c0731c10bfa86 | 1,330 | py | Python | Problems/Next Lucky Number/lucky.py | jamtot/HackerEarth | 71b919920dbc5b3af3fc49920939bab418455fb6 | [
"MIT"
] | 3 | 2018-07-17T09:03:02.000Z | 2020-05-11T18:03:25.000Z | Problems/Next Lucky Number/lucky.py | jamtot/HackerEarth | 71b919920dbc5b3af3fc49920939bab418455fb6 | [
"MIT"
] | null | null | null | Problems/Next Lucky Number/lucky.py | jamtot/HackerEarth | 71b919920dbc5b3af3fc49920939bab418455fb6 | [
"MIT"
] | 2 | 2016-06-01T13:16:27.000Z | 2018-09-25T08:32:24.000Z | def next_lucky(n):
if len(n) == 0:
return ''
if int(n[0]) < 3:
return '3'*len(n)
elif int(n[0]) == 3:
pos1 = int(n[0]+next_lucky(n[1:]))
pos2 = int('5'+'3'*(len(n)-1))
if pos1 > pos2: pos1,pos2 = pos2,pos1
if pos1 > int(n):
return str(pos1)
... | 23.75 | 45 | 0.496241 | def next_lucky(n):
if len(n) == 0:
return ''
if int(n[0]) < 3:
return '3'*len(n)
elif int(n[0]) == 3:
pos1 = int(n[0]+next_lucky(n[1:]))
pos2 = int('5'+'3'*(len(n)-1))
if pos1 > pos2: pos1,pos2 = pos2,pos1
if pos1 > int(n):
return str(pos1)
... | false | true |
f7330d70b64d5fb5ed24ad6e63793959cb3a079f | 72 | py | Python | File Handling/ReadCharacter.py | UgainJain/LearnPythonByDoing | 4784c334d7f485223a29592ab47c6c017ec67145 | [
"MIT"
] | 5 | 2018-11-06T11:15:35.000Z | 2020-07-29T21:54:28.000Z | File Handling/ReadCharacter.py | UgainJain/LearnPythonByDoing | 4784c334d7f485223a29592ab47c6c017ec67145 | [
"MIT"
] | 1 | 2018-11-13T13:22:11.000Z | 2018-11-13T13:22:11.000Z | File Handling/ReadCharacter.py | UgainJain/LearnPythonByDoing | 4784c334d7f485223a29592ab47c6c017ec67145 | [
"MIT"
] | 11 | 2018-11-06T11:12:21.000Z | 2019-07-12T11:43:05.000Z | f = open("Writelist.txt", "r")
data = f.read(6)
print(data)
f.close() | 18 | 31 | 0.597222 | f = open("Writelist.txt", "r")
data = f.read(6)
print(data)
f.close() | true | true |
f7330e60ec01b0731bf537b748634fcb7065790e | 1,957 | py | Python | alipay/aop/api/domain/AlipayEcoMycarViolationCityPushModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayEcoMycarViolationCityPushModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayEcoMycarViolationCityPushModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEcoMycarViolationCityPushModel(object):
def __init__(self):
self._city_code = None
self._push_type = None
self._service_status = None
@property
def city_cod... | 27.56338 | 79 | 0.602453 |
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEcoMycarViolationCityPushModel(object):
def __init__(self):
self._city_code = None
self._push_type = None
self._service_status = None
@property
def city_code(self):
return self._city_code
... | true | true |
f7330ee984c0980ccf5e9c6390ac902891c23fe9 | 1,098 | py | Python | Chapter16/bypass_os.py | souhaiboudiouf/Hands-On-AWS-Penetration-Testing-with-Kali-Linux | 65b987e741d08dc933ffec0590947d764f4f62b7 | [
"MIT"
] | 102 | 2019-02-15T13:38:13.000Z | 2022-01-17T11:39:34.000Z | Chapter16/bypass_os.py | souhaiboudiouf/Hands-On-AWS-Penetration-Testing-with-Kali-Linux | 65b987e741d08dc933ffec0590947d764f4f62b7 | [
"MIT"
] | null | null | null | Chapter16/bypass_os.py | souhaiboudiouf/Hands-On-AWS-Penetration-Testing-with-Kali-Linux | 65b987e741d08dc933ffec0590947d764f4f62b7 | [
"MIT"
] | 56 | 2019-05-21T22:31:52.000Z | 2022-03-19T14:16:41.000Z | import random
import boto3
import botocore
# A list of user agents that won't trigger GuardDuty
safe_user_agents = [
'Boto3/1.7.48 Python/3.7.0 Windows/10 Botocore/1.10.48',
'aws-sdk-go/1.4.22 (go1.7.4; linux; amd64)',
'aws-cli/1.15.10 Python/2.7.9 Windows/8 botocore/1.10.10'
]
# Grab the current user a... | 31.371429 | 100 | 0.734973 | import random
import boto3
import botocore
safe_user_agents = [
'Boto3/1.7.48 Python/3.7.0 Windows/10 Botocore/1.10.48',
'aws-sdk-go/1.4.22 (go1.7.4; linux; amd64)',
'aws-cli/1.15.10 Python/2.7.9 Windows/8 botocore/1.10.10'
]
# Grab the current user agent
user_agent = boto3.session.Session()._session.u... | true | true |
f7330f121e0d941a5ef4aff5f7eb6011732a74f8 | 4,077 | py | Python | Gds/src/fprime_gds/common/templates/event_template.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 4 | 2021-06-17T16:45:40.000Z | 2022-02-08T00:05:32.000Z | Gds/src/fprime_gds/common/templates/event_template.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 35 | 2021-06-30T20:40:48.000Z | 2022-03-01T04:51:42.000Z | Gds/src/fprime_gds/common/templates/event_template.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 13 | 2021-06-02T20:52:17.000Z | 2022-02-21T17:51:57.000Z | """
@brief Event Template class
Instances of this class describe a specific event type. For example: AF_ASSERT_0
or cmdSeq_CS_CmdStarted
@date Created July 2, 2018
@author R. Joseph Paetz
@bug No known bugs
"""
from fprime.common.models.serialize import type_base
from fprime.common.models.serialize.type_exceptions ... | 31.122137 | 85 | 0.638705 |
from fprime.common.models.serialize import type_base
from fprime.common.models.serialize.type_exceptions import TypeMismatchException
from fprime_gds.common.utils.event_severity import EventSeverity
from . import data_template
class EventTemplate(data_template.DataTemplate):
def __init__(
self, event_i... | true | true |
f7330f24728dcfd149a3001a44d2ed61a9343a8e | 3,105 | py | Python | ddtrace/utils/deprecation.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/utils/deprecation.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-22T16:56:55.000Z | 2020-12-22T16:56:55.000Z | ddtrace/utils/deprecation.py | kenferrara/dd-trace-py | 12e52e0ab804061e72b0f76214f5e4bb475ae20f | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-22T16:54:02.000Z | 2020-12-22T16:54:02.000Z | import os
import warnings
from functools import wraps
from ddtrace.vendor import debtcollector
class RemovedInDDTrace10Warning(DeprecationWarning):
pass
def format_message(name, message, version):
"""Message formatter to create `DeprecationWarning` messages
such as:
'fn' is deprecated and will... | 34.5 | 120 | 0.677617 | import os
import warnings
from functools import wraps
from ddtrace.vendor import debtcollector
class RemovedInDDTrace10Warning(DeprecationWarning):
pass
def format_message(name, message, version):
return "'{}' is deprecated and will be remove in future versions{}. {}".format(
name,
" ({})".... | true | true |
f733105d65957142954e8587e025220e714ea3f8 | 21,697 | py | Python | nlplingo/nn/extractor.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | 3 | 2020-10-22T13:28:00.000Z | 2022-03-24T19:57:22.000Z | nlplingo/nn/extractor.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | null | null | null | nlplingo/nn/extractor.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | 1 | 2020-10-22T13:29:51.000Z | 2020-10-22T13:29:51.000Z | import codecs
import json
import os
import numpy as np
from nlplingo.nn.sequence_model import SequenceXLMRBase, SequenceXLMRCustom
from nlplingo.nn.spanpair_model import SpanPairModelEmbedded
from nlplingo.tasks.entitycoref.feature import EntityCorefFeatureGenerator
from nlplingo.tasks.entitycoref.generator import Ent... | 55.633333 | 175 | 0.646357 | import codecs
import json
import os
import numpy as np
from nlplingo.nn.sequence_model import SequenceXLMRBase, SequenceXLMRCustom
from nlplingo.nn.spanpair_model import SpanPairModelEmbedded
from nlplingo.tasks.entitycoref.feature import EntityCorefFeatureGenerator
from nlplingo.tasks.entitycoref.generator import Ent... | true | true |
f73310aa2b49cd42868188d5dd473dea96e80215 | 45 | py | Python | mmdet2trt/models/backbones/__init__.py | jackweiwang/mmdetection-to-tensorrt | f988ba8e923764fb1173385a1c7160b8f8b5bd99 | [
"Apache-2.0"
] | 1 | 2021-08-23T10:09:37.000Z | 2021-08-23T10:09:37.000Z | mmdet2trt/models/backbones/__init__.py | gcong18/mmdetection-to-tensorrt | c31c32ee4720ff56010bcda77bacf3a110d0526c | [
"Apache-2.0"
] | null | null | null | mmdet2trt/models/backbones/__init__.py | gcong18/mmdetection-to-tensorrt | c31c32ee4720ff56010bcda77bacf3a110d0526c | [
"Apache-2.0"
] | null | null | null | from .base_backbone import BaseBackboneWraper | 45 | 45 | 0.911111 | from .base_backbone import BaseBackboneWraper | true | true |
f73310bc504ae60753d4112724e86a8d78e11598 | 7,189 | py | Python | tests/components/bond/test_fan.py | dakesson/core | 8cfffd00d607e75595e208fbe46794084e6c8707 | [
"Apache-2.0"
] | 1 | 2016-08-21T21:32:20.000Z | 2016-08-21T21:32:20.000Z | tests/components/bond/test_fan.py | dakesson/core | 8cfffd00d607e75595e208fbe46794084e6c8707 | [
"Apache-2.0"
] | 39 | 2020-08-03T07:33:25.000Z | 2022-03-31T06:02:02.000Z | tests/components/bond/test_fan.py | mKeRix/home-assistant | 9a81fe507db4a2b7f164d0683ca55c4e3dc6ccda | [
"Apache-2.0"
] | null | null | null | """Tests for the Bond fan device."""
from datetime import timedelta
from typing import Optional
from bond_api import Action, DeviceType, Direction
from homeassistant import core
from homeassistant.components import fan
from homeassistant.components.fan import (
ATTR_DIRECTION,
ATTR_SPEED_LIST,
DIRECTION_F... | 36.866667 | 114 | 0.716372 | from datetime import timedelta
from typing import Optional
from bond_api import Action, DeviceType, Direction
from homeassistant import core
from homeassistant.components import fan
from homeassistant.components.fan import (
ATTR_DIRECTION,
ATTR_SPEED_LIST,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
DO... | true | true |
f733114f2e58f62143485597d342dc7a64037cbd | 1,889 | py | Python | one.py | jacobbieker/NUR_Handin2 | 6e620b23191edaec4452d29eac90ec37ced0c038 | [
"MIT"
] | null | null | null | one.py | jacobbieker/NUR_Handin2 | 6e620b23191edaec4452d29eac90ec37ced0c038 | [
"MIT"
] | null | null | null | one.py | jacobbieker/NUR_Handin2 | 6e620b23191edaec4452d29eac90ec37ced0c038 | [
"MIT"
] | 1 | 2019-05-17T07:33:07.000Z | 2019-05-17T07:33:07.000Z | import numpy as np
import matplotlib.pyplot as plt
from one_a import one_a
from one_b import one_b
from one_c import one_c
from one_d import one_d
from one_e import one_e
def random_generator(seed, m=2 ** 64 - 1, a=2349543, c=913842, a1=21, a2=35, a3=4, a4=4294957665):
"""
Generates psuedorandom numbers w... | 30.467742 | 98 | 0.640551 | import numpy as np
import matplotlib.pyplot as plt
from one_a import one_a
from one_b import one_b
from one_c import one_c
from one_d import one_d
from one_e import one_e
def random_generator(seed, m=2 ** 64 - 1, a=2349543, c=913842, a1=21, a2=35, a3=4, a4=4294957665):
bit_64 = 0xffffffffffffffff
... | true | true |
f733137fe3e51c1e6257318a2ab8f29dc627f5f4 | 7 | py | Python | django/tests/template_backends/forbidden/template_backends/hello.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/tests/template_backends/forbidden/template_backends/hello.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/tests/template_backends/forbidden/template_backends/hello.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | XX XXX
| 3.5 | 6 | 0.714286 | XX XXX
| false | true |
f73313cc26a7892cd6799b2f06261298f88d8f58 | 1,304 | py | Python | data/external/repositories/114534/kaggle-seizure-prediction-master/scripts/csv_median_center.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/114534/kaggle-seizure-prediction-master/scripts/csv_median_center.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/114534/kaggle-seizure-prediction-master/scripts/csv_median_center.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z |
import sys
from numpy import *
narg = len(sys.argv)
if narg != 2:
print "usage: %s <file>" % sys.argv[0]
exit(1)
fpath = sys.argv[1]
f = open(fpath)
X = f.readlines()
f.close()
N = len(X)
# the number of test segments for each subject
T = [ 502, 1000, 907, 990, 191, 195, 150 ]
assert(... | 17.386667 | 79 | 0.493098 |
import sys
from numpy import *
narg = len(sys.argv)
if narg != 2:
print "usage: %s <file>" % sys.argv[0]
exit(1)
fpath = sys.argv[1]
f = open(fpath)
X = f.readlines()
f.close()
N = len(X)
T = [ 502, 1000, 907, 990, 191, 195, 150 ]
assert( N == sum(T)+1 )
C = [ sum(T[:i+1]) for i i... | false | true |
f73315aa71396ff61edb7deaaef7841c99c6b86e | 364 | py | Python | solution/practice/algorithms/strings/hackerrank-in-a-string/solution.py | satyam857/HackerRank | b6c0c199a5e320b1b59fdedafda2630258314b76 | [
"MIT"
] | 158 | 2017-03-17T19:43:14.000Z | 2022-03-23T04:10:33.000Z | solution/practice/algorithms/strings/hackerrank-in-a-string/solution.py | skatsd/HackerRank | 74918aa46144150f4da0986c27d6762afe7c4ef3 | [
"MIT"
] | 2 | 2018-06-13T02:41:19.000Z | 2020-06-03T19:43:58.000Z | solution/practice/algorithms/strings/hackerrank-in-a-string/solution.py | skatsd/HackerRank | 74918aa46144150f4da0986c27d6762afe7c4ef3 | [
"MIT"
] | 67 | 2017-08-03T02:52:24.000Z | 2022-03-25T03:22:01.000Z | # This challenge just wants us to determine if a string contains a
# given subsequence. We do this by iterating through the string and
# test whether the characters from the subsequence appear one by one.
for case in range(int(input())):
s = input()
i = 0
for c in s:
if i < 10 and c == 'hackerrank'[i]:
... | 30.333333 | 69 | 0.662088 |
for case in range(int(input())):
s = input()
i = 0
for c in s:
if i < 10 and c == 'hackerrank'[i]:
i += 1
print('YES' if i == 10 else 'NO')
| true | true |
f733165323bb66266cb28f9208819bcb4c35f98f | 420 | py | Python | mp_google/_setup.py | moonstock/mp_google | 21e610491fcad5a4e003cfe1f6726ae893ce89f4 | [
"MIT"
] | null | null | null | mp_google/_setup.py | moonstock/mp_google | 21e610491fcad5a4e003cfe1f6726ae893ce89f4 | [
"MIT"
] | null | null | null | mp_google/_setup.py | moonstock/mp_google | 21e610491fcad5a4e003cfe1f6726ae893ce89f4 | [
"MIT"
] | null | null | null | import glob
import yaml
import json
def to_json(path):
# print(f"path: {path}")
stem = path.rsplit(".", 1)[0]
data = yaml.load(open(path, "r", encoding="UTF-8"), Loader=yaml.FullLoader)
print(f"stem: {stem}.json")
json.dump(data, open(f"{stem}.json", "w", encoding="utf-8"), ensure_ascii=False, ind... | 28 | 94 | 0.616667 | import glob
import yaml
import json
def to_json(path):
stem = path.rsplit(".", 1)[0]
data = yaml.load(open(path, "r", encoding="UTF-8"), Loader=yaml.FullLoader)
print(f"stem: {stem}.json")
json.dump(data, open(f"{stem}.json", "w", encoding="utf-8"), ensure_ascii=False, indent=4)
for path in [f.... | true | true |
f7331699d16cc32769f8d737d2a508e299277049 | 700 | py | Python | others/maddpg/utils/noise.py | manish-pra/trcopo | df8730f07ef554970c7a0aa653cc42d4886948ec | [
"MIT"
] | 5 | 2020-06-22T17:13:51.000Z | 2021-11-02T14:19:58.000Z | others/maddpg/utils/noise.py | manish-pra/trcopo | df8730f07ef554970c7a0aa653cc42d4886948ec | [
"MIT"
] | null | null | null | others/maddpg/utils/noise.py | manish-pra/trcopo | df8730f07ef554970c7a0aa653cc42d4886948ec | [
"MIT"
] | 1 | 2020-09-14T06:41:03.000Z | 2020-09-14T06:41:03.000Z | import numpy as np
# from https://github.com/songrotek/DDPG/blob/master/ou_noise.py
class OUNoise:
def __init__(self, action_dimension, scale=0.1, mu=0, theta=0.15, sigma=1):#sigma=0.2
self.action_dimension = action_dimension
self.scale = scale
self.mu = mu
self.theta = theta
... | 30.434783 | 89 | 0.615714 | import numpy as np
class OUNoise:
def __init__(self, action_dimension, scale=0.1, mu=0, theta=0.15, sigma=1):
self.action_dimension = action_dimension
self.scale = scale
self.mu = mu
self.theta = theta
self.sigma = sigma
self.state = np.ones(self.action_dimension) ... | true | true |
f7331854f3dfbfd98cf8caeb459471b1519084a0 | 137 | py | Python | dash/__main__.py | thepearson/dash-cli | 706c0671e6dcff6c440eb030a8d8b35b9d62b907 | [
"MIT"
] | 7 | 2018-03-19T10:08:16.000Z | 2018-07-25T01:22:45.000Z | dash/__main__.py | thepearson/dash-cli | 706c0671e6dcff6c440eb030a8d8b35b9d62b907 | [
"MIT"
] | 1 | 2018-10-24T06:07:15.000Z | 2018-10-24T06:07:15.000Z | dash/__main__.py | thepearson/dash-cli | 706c0671e6dcff6c440eb030a8d8b35b9d62b907 | [
"MIT"
] | 2 | 2018-07-19T01:46:19.000Z | 2018-08-20T22:55:57.000Z | # -*- coding: utf-8 -*-
"""dash.cli.__main__: executed when bootstrap directory is called as script."""
from .cli import main
main()
| 15.222222 | 79 | 0.671533 |
from .cli import main
main()
| true | true |
f7331a32a725e59a59a5bb4c7a897b4dc351bfb3 | 424 | py | Python | packages/python/plotly/plotly/validators/heatmapgl/hoverlabel/_alignsrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/heatmapgl/hoverlabel/_alignsrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/heatmapgl/hoverlabel/_alignsrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="alignsrc", parent_name="heatmapgl.hoverlabel", **kwargs
):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 30.285714 | 82 | 0.658019 | import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="alignsrc", parent_name="heatmapgl.hoverlabel", **kwargs
):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
f7331b05e413882e1b54fe0fb81c1630497f0cc4 | 562 | py | Python | scalica/web/scalica/micro/urls.py | BlindGhosty/LSWA-Project | 950fa492426bcebe60872c9a24e00399ff63f045 | [
"MIT"
] | null | null | null | scalica/web/scalica/micro/urls.py | BlindGhosty/LSWA-Project | 950fa492426bcebe60872c9a24e00399ff63f045 | [
"MIT"
] | 2 | 2017-12-03T23:04:13.000Z | 2017-12-03T23:49:25.000Z | scalica/web/scalica/micro/urls.py | BlindGhosty/LSWA-Project | 950fa492426bcebe60872c9a24e00399ff63f045 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from . import views
from django.contrib.auth import views as auth_views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^home/$', views.home, name='home'),
url(r'^stream/(?P<user_id>[0-9]+)/$', views.stream, name='stream'),
url(r'^post/$', views.p... | 35.125 | 71 | 0.635231 | from django.conf.urls import include, url
from . import views
from django.contrib.auth import views as auth_views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^home/$', views.home, name='home'),
url(r'^stream/(?P<user_id>[0-9]+)/$', views.stream, name='stream'),
url(r'^post/$', views.p... | true | true |
f7331b74808c449c76dc0e45eaf36d36615704d5 | 13,969 | py | Python | tensorflow_estimator/python/estimator/tpu/tpu_estimator_signals_test.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 2 | 2019-05-13T16:37:32.000Z | 2019-09-17T22:01:38.000Z | tensorflow_estimator/python/estimator/tpu/tpu_estimator_signals_test.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 1 | 2020-01-31T21:04:31.000Z | 2020-01-31T21:04:31.000Z | tensorflow_estimator/python/estimator/tpu/tpu_estimator_signals_test.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 2 | 2019-09-17T22:02:05.000Z | 2020-10-22T03:56:07.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.085294 | 80 | 0.662467 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.client import session
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import errors
from tensorflow.python.framework... | true | true |
f7331bba94c19b8a27742a366d84b1bebf5a1400 | 428 | py | Python | src/utils/color.py | nixiesquid/mf-dakoker | 106a05d3cc55ca18c2f0d3111ff6c7110af368b9 | [
"MIT"
] | null | null | null | src/utils/color.py | nixiesquid/mf-dakoker | 106a05d3cc55ca18c2f0d3111ff6c7110af368b9 | [
"MIT"
] | 1 | 2020-06-25T18:19:36.000Z | 2020-06-25T18:19:36.000Z | src/utils/color.py | nixiesquid/mf-dakoker | 106a05d3cc55ca18c2f0d3111ff6c7110af368b9 | [
"MIT"
] | 1 | 2021-06-08T07:48:09.000Z | 2021-06-08T07:48:09.000Z | # coding:utf-8
class Color(object):
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
BLUE = "\033[34m"
PURPLE = "\033[35m"
CYAN = "\033[36m"
WHITE = "\033[37m"
BOLD = "\033[1m"
END = "\033[0m"
@classmethod
def get_colored(cls, color, text):
return color + te... | 19.454545 | 43 | 0.549065 |
class Color(object):
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
BLUE = "\033[34m"
PURPLE = "\033[35m"
CYAN = "\033[36m"
WHITE = "\033[37m"
BOLD = "\033[1m"
END = "\033[0m"
@classmethod
def get_colored(cls, color, text):
return color + text + cls.END
... | true | true |
f7331bd9f0a0ac254108834149813e5d1164e927 | 1,739 | py | Python | server/sqlmap/tamper/between.py | kurpav/volcano | 31d5f8f6f5a282abbea3861368eb39cfe33bba77 | [
"MIT"
] | null | null | null | server/sqlmap/tamper/between.py | kurpav/volcano | 31d5f8f6f5a282abbea3861368eb39cfe33bba77 | [
"MIT"
] | null | null | null | server/sqlmap/tamper/between.py | kurpav/volcano | 31d5f8f6f5a282abbea3861368eb39cfe33bba77 | [
"MIT"
] | 1 | 2018-07-04T18:35:16.000Z | 2018-07-04T18:35:16.000Z | #!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.HIGHEST
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Replaces greater than... | 28.983333 | 112 | 0.547441 |
import re
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.HIGHEST
def dependencies():
pass
def tamper(payload, **kwargs):
retVal = payload
if payload:
match = re.search(r"(?i)(\b(AND|OR)\b\s+)(?!.*\b(AND|OR)\b)([^>]+?)\s*>\s*([^>]+)\s*\Z", payload)
if match:
... | true | true |
f7331c1e0b73761c6966f8baf01e754a417fc2a3 | 1,528 | py | Python | src/asyncioffmpeg/ffplay.py | scivision/asyncio-subprocess-ffmpeg | 915a9c3a24e011059cdd38ae74bee31135f0a34f | [
"MIT"
] | 3 | 2019-11-11T14:59:54.000Z | 2020-09-11T15:05:53.000Z | src/asyncioffmpeg/ffplay.py | scivision/asyncio-subprocess-ffmpeg | 915a9c3a24e011059cdd38ae74bee31135f0a34f | [
"MIT"
] | null | null | null | src/asyncioffmpeg/ffplay.py | scivision/asyncio-subprocess-ffmpeg | 915a9c3a24e011059cdd38ae74bee31135f0a34f | [
"MIT"
] | null | null | null | """
This example uses a finite number of workers, rather than slamming the system with endless subprocesses.
This is more effective than endless context switching for an overloaded CPU.
"""
import asyncio
from pathlib import Path
import shutil
import sys
from typing import Iterable
import os
FFPLAY = shutil.which("ff... | 24.253968 | 104 | 0.651178 |
import asyncio
from pathlib import Path
import shutil
import sys
from typing import Iterable
import os
FFPLAY = shutil.which("ffplay")
if not FFPLAY:
raise ImportError("FFPLAY not found")
async def ffplay(queue: asyncio.Queue):
assert isinstance(FFPLAY, str)
while True:
filein = await queue.get... | true | true |
f7331cdfb63678d19d68f9fda8a16e100ca99eba | 4,621 | py | Python | test/dll_path.py | MaxSac/build | 482c25f3a26171073c7e6c59f0427f2259a63fec | [
"BSL-1.0"
] | 50 | 2019-08-30T13:20:19.000Z | 2022-02-12T16:25:38.000Z | test/dll_path.py | MaxSac/build | 482c25f3a26171073c7e6c59f0427f2259a63fec | [
"BSL-1.0"
] | 5 | 2019-09-02T17:42:07.000Z | 2020-07-17T09:30:47.000Z | test/dll_path.py | MaxSac/build | 482c25f3a26171073c7e6c59f0427f2259a63fec | [
"BSL-1.0"
] | 8 | 2015-11-03T14:12:19.000Z | 2020-09-22T19:20:54.000Z | #!/usr/bin/python
# Copyright (C) 2003. Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test that the <dll-path> property is correctly set when using
# <hardcode-dll-paths>true.
import BoostBuild
... | 28.176829 | 77 | 0.61069 |
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", "using dll_paths ;")
t.write("jamfile.jam", """\
exe main : main.cpp b//b ;
explicit main ;
path-list mp : main ;
""")
t.write("main.cpp", "int main() {}\n")
t.write("dll_paths.jam", """\
import "class" : new ;
impo... | true | true |
f7331d89ea2c95a3ddeecfb941f15be9e6fe77fe | 148 | py | Python | opensfm/log.py | YonatanSimson/OpenSfM | 358843738359f4b5d767b22df2f3960ded31c981 | [
"BSD-2-Clause"
] | 1 | 2020-11-18T03:14:45.000Z | 2020-11-18T03:14:45.000Z | opensfm/log.py | YonatanSimson/OpenSfM | 358843738359f4b5d767b22df2f3960ded31c981 | [
"BSD-2-Clause"
] | null | null | null | opensfm/log.py | YonatanSimson/OpenSfM | 358843738359f4b5d767b22df2f3960ded31c981 | [
"BSD-2-Clause"
] | null | null | null | import logging
import os
def setup():
logging.basicConfig(
format="%(asctime)s %(levelname)s: %(message)s", level=logging.DEBUG
)
| 16.444444 | 76 | 0.648649 | import logging
import os
def setup():
logging.basicConfig(
format="%(asctime)s %(levelname)s: %(message)s", level=logging.DEBUG
)
| true | true |
f7331f00e53db23e56e03175308569c9a9f459e0 | 817 | py | Python | scraper/services/WebScraper.py | grimmhud/django-scraper | 66902fa73cc6fcb3504bad97c19e95e2951e9754 | [
"MIT"
] | null | null | null | scraper/services/WebScraper.py | grimmhud/django-scraper | 66902fa73cc6fcb3504bad97c19e95e2951e9754 | [
"MIT"
] | null | null | null | scraper/services/WebScraper.py | grimmhud/django-scraper | 66902fa73cc6fcb3504bad97c19e95e2951e9754 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import ast
def scrap_website(url, filter):
soup = __get_html_content_as_soup(url)
return __extract_data(soup, filter)
def __get_html_content_as_soup(url):
response = requests.get(url)
return BeautifulSoup(response.text, 'lxml')
def __extrac... | 26.354839 | 63 | 0.665851 | from bs4 import BeautifulSoup
import requests
import ast
def scrap_website(url, filter):
soup = __get_html_content_as_soup(url)
return __extract_data(soup, filter)
def __get_html_content_as_soup(url):
response = requests.get(url)
return BeautifulSoup(response.text, 'lxml')
def __extrac... | true | true |
f7331f8ce198dccf836db66c2e0a80f3f5329d05 | 1,053 | py | Python | leetcode/48_Rotate_Image.py | PhillipLeeHub/algorithm-and-data-structure | c0c27fee1b4fd634084da0b41395a26307d76e69 | [
"MIT"
] | 1 | 2020-05-01T21:29:17.000Z | 2020-05-01T21:29:17.000Z | leetcode/48_Rotate_Image.py | PhillipLeeHub/algorithm-and-data-structure | c0c27fee1b4fd634084da0b41395a26307d76e69 | [
"MIT"
] | null | null | null | leetcode/48_Rotate_Image.py | PhillipLeeHub/algorithm-and-data-structure | c0c27fee1b4fd634084da0b41395a26307d76e69 | [
"MIT"
] | 1 | 2020-06-12T23:32:14.000Z | 2020-06-12T23:32:14.000Z | '''
48. Rotate Image Medium
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.
'''
class Solution:
def rotate(... | 35.1 | 154 | 0.578348 | class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
self.transpose(matrix)
self.reflex(matrix)
def transpose(self, matrix):
m_len = len(matrix)
for r in range(m_len):
for c in range(r, m_len):
matrix[c... | true | true |
f7331fbd624a7306d9d51e241d7a6f3f2d83e072 | 803 | py | Python | reframe/__init__.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | reframe/__init__.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | reframe/__init__.py | jacwah/reframe | d650bbbb2f87c6ae5f354e50b50bcfd98fafe77b | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import sys
VERSION = '3.11.0-dev.2'
INSTALL_PREFIX = os.path.normpath(
os.path.abspath(os.path.join(os.path.dir... | 29.740741 | 77 | 0.713574 |
import os
import sys
VERSION = '3.11.0-dev.2'
INSTALL_PREFIX = os.path.normpath(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
)
MIN_PYTHON_VERSION = (3, 6, 0)
if sys.version_info[:3] < MIN_PYTHON_VERSION:
sys.stderr.write('Unsupported Python version: '
'Python >= %... | true | true |
f7332037c48c1a294de655fb80ab1613b7eb5f5e | 4,220 | py | Python | program_synthesis/algolisp/dataset/evaluation.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 123 | 2018-06-09T00:49:39.000Z | 2022-03-09T05:41:20.000Z | program_synthesis/algolisp/dataset/evaluation.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 9 | 2018-06-12T01:01:17.000Z | 2022-03-18T09:06:39.000Z | program_synthesis/algolisp/dataset/evaluation.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 24 | 2018-06-09T00:42:46.000Z | 2021-09-29T08:23:32.000Z | import numpy as np
from program_synthesis.algolisp.tools import bleu
from program_synthesis.algolisp.dataset import executor
def is_same_code(example, res):
correct = False
if hasattr(res, 'code_sequence'):
if res.code_sequence is not None:
correct = res.code_sequence == example.code_sequ... | 40.576923 | 111 | 0.657346 | import numpy as np
from program_synthesis.algolisp.tools import bleu
from program_synthesis.algolisp.dataset import executor
def is_same_code(example, res):
correct = False
if hasattr(res, 'code_sequence'):
if res.code_sequence is not None:
correct = res.code_sequence == example.code_sequ... | true | true |
f73320915bbcab3da5d57576298cc060b153093e | 5,765 | py | Python | readthedocs/conf.py | akiannillo/explore-trusted-firmware-m | 6fe063162612d421b7bd59743e0eb1dcce15e7f3 | [
"BSD-3-Clause"
] | 1 | 2022-01-03T03:42:47.000Z | 2022-01-03T03:42:47.000Z | readthedocs/conf.py | akiannillo/explore-trusted-firmware-m | 6fe063162612d421b7bd59743e0eb1dcce15e7f3 | [
"BSD-3-Clause"
] | null | null | null | readthedocs/conf.py | akiannillo/explore-trusted-firmware-m | 6fe063162612d421b7bd59743e0eb1dcce15e7f3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------#
# Configuration file for the Sp... | 31.331522 | 81 | 0.643018 |
import os
import sys
sys.path.insert(0, os.path.abspath('./'))
import tfm_copy_files
project = 'TF-M'
copyright = '2017-2019, ARM CE-OSS'
author = 'ARM CE-OSS'
title = 'TF-M user Guide'
version = '1.0.0-Beta'
release = 'Version 1.0.0-Beta'
extensions = [
'sphinx.ext.imgmath',
... | false | true |
f7332097fae90562e0b8ddcc60167c43486e039a | 793 | py | Python | migrations/versions/f1578ff17ae1_new_fields_in_user_moodel.py | aboladebaba/flaskTut | 9da02e2d8a1c78ffdd84c11796bedb8e08913c85 | [
"MIT"
] | null | null | null | migrations/versions/f1578ff17ae1_new_fields_in_user_moodel.py | aboladebaba/flaskTut | 9da02e2d8a1c78ffdd84c11796bedb8e08913c85 | [
"MIT"
] | null | null | null | migrations/versions/f1578ff17ae1_new_fields_in_user_moodel.py | aboladebaba/flaskTut | 9da02e2d8a1c78ffdd84c11796bedb8e08913c85 | [
"MIT"
] | null | null | null | """new fields in user moodel
Revision ID: f1578ff17ae1
Revises: bda639e5aafd
Create Date: 2021-01-11 10:01:54.417977
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f1578ff17ae1'
down_revision = 'bda639e5aafd'
branch_labels = None
depends_on = None
def upgra... | 25.580645 | 86 | 0.691047 | from alembic import op
import sqlalchemy as sa
revision = 'f1578ff17ae1'
down_revision = 'bda639e5aafd'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f73320b0766ec5ad6b88eb37a6a3cde6d5816d5c | 4,066 | py | Python | s2_organisation_and_version_control/exercise_files/typing_exercise_solution.py | oliverkinch/dtu_mlops | ce3a1f8f02ee95105b7b907735c39ad082321a4b | [
"Apache-2.0"
] | 94 | 2021-06-01T09:53:45.000Z | 2022-03-29T21:06:22.000Z | s2_organisation_and_version_control/exercise_files/typing_exercise_solution.py | oliverkinch/dtu_mlops | ce3a1f8f02ee95105b7b907735c39ad082321a4b | [
"Apache-2.0"
] | 4 | 2021-06-07T08:28:40.000Z | 2022-01-07T19:56:40.000Z | s2_organisation_and_version_control/exercise_files/typing_exercise_solution.py | oliverkinch/dtu_mlops | ce3a1f8f02ee95105b7b907735c39ad082321a4b | [
"Apache-2.0"
] | 133 | 2021-06-05T07:20:37.000Z | 2022-03-22T10:56:51.000Z | from typing import Callable, Tuple, Union, Optional, List
import torch
import torch.nn.functional as F
from torch import nn
class Network(nn.Module):
def __init__(self, input_size: int, output_size: int, hidden_layers: List[int], drop_p: float = 0.5) -> None:
''' Builds a feedforward network with arbitrar... | 35.666667 | 113 | 0.57575 | from typing import Callable, Tuple, Union, Optional, List
import torch
import torch.nn.functional as F
from torch import nn
class Network(nn.Module):
def __init__(self, input_size: int, output_size: int, hidden_layers: List[int], drop_p: float = 0.5) -> None:
super().__init__()
self.hidde... | true | true |
f733214d74349e47d083be5a9c8839cd0b56b8fc | 6,801 | py | Python | python_modules/dagster/dagster/core/execution/execute_in_process_result.py | makotonium/dagster | f5d56514b7e7c5bca28ea14060316d242f51b71b | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/execute_in_process_result.py | makotonium/dagster | f5d56514b7e7c5bca28ea14060316d242f51b71b | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/execute_in_process_result.py | makotonium/dagster | f5d56514b7e7c5bca28ea14060316d242f51b71b | [
"Apache-2.0"
] | 1 | 2021-12-08T18:13:19.000Z | 2021-12-08T18:13:19.000Z | from typing import Any, Dict, List, Optional, cast
from dagster import DagsterEvent, check
from dagster.core.definitions import NodeDefinition, NodeHandle
from dagster.core.definitions.utils import DEFAULT_OUTPUT
from dagster.core.errors import DagsterInvariantViolationError
from dagster.core.execution.plan.outputs im... | 38.862857 | 104 | 0.670931 | from typing import Any, Dict, List, Optional, cast
from dagster import DagsterEvent, check
from dagster.core.definitions import NodeDefinition, NodeHandle
from dagster.core.definitions.utils import DEFAULT_OUTPUT
from dagster.core.errors import DagsterInvariantViolationError
from dagster.core.execution.plan.outputs im... | true | true |
f73322ecb27294a01b81c53f96a5bf1229d121ca | 221 | py | Python | server/apps/user/admin.py | arun-thekkuden/django-app-structure | fa55696bcd175b11c9dacd8084241393f6ffb3f0 | [
"MIT"
] | null | null | null | server/apps/user/admin.py | arun-thekkuden/django-app-structure | fa55696bcd175b11c9dacd8084241393f6ffb3f0 | [
"MIT"
] | null | null | null | server/apps/user/admin.py | arun-thekkuden/django-app-structure | fa55696bcd175b11c9dacd8084241393f6ffb3f0 | [
"MIT"
] | 1 | 2021-02-28T09:48:05.000Z | 2021-02-28T09:48:05.000Z | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
class CustomUserAdmin(UserAdmin):
readonly_fields = ('email', )
admin.site.register(User, CustomUserAdmin)
| 20.090909 | 47 | 0.78733 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
class CustomUserAdmin(UserAdmin):
readonly_fields = ('email', )
admin.site.register(User, CustomUserAdmin)
| true | true |
f73323917401f52a7716451a042bd30c18ecda5f | 4,250 | py | Python | src/list-availability-zones.py | AWSToolbox/list-availability-zones | 84c4c3ccaa76b1c050d13891247a200bbe36d4e3 | [
"MIT"
] | 1 | 2021-10-04T09:04:19.000Z | 2021-10-04T09:04:19.000Z | src/list-availability-zones.py | AWSToolbox/list-availability-zones | 84c4c3ccaa76b1c050d13891247a200bbe36d4e3 | [
"MIT"
] | null | null | null | src/list-availability-zones.py | AWSToolbox/list-availability-zones | 84c4c3ccaa76b1c050d13891247a200bbe36d4e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script will query the AWS API using boto3 and provide a list (table) of all regions and availability zones.
Example Usage:
./list-availability-zones.py
"""
from __future__ import print_function
import boto3
import requests
import sys
from botocore.exceptions import ClientError
f... | 32.442748 | 133 | 0.499059 |
from __future__ import print_function
import boto3
import requests
import sys
from botocore.exceptions import ClientError
from prettytable import PrettyTable
unknown_string = 'unknown'
country_mapping = {
'af-south-1': 'Africa (Cape Town)',
'ap-east-1': 'Asia Pacific (Hong ... | true | true |
f73323c5248a8c99f4a1341c763f28ceb0bd51bf | 5,206 | py | Python | mars/services/subtask/tests/test_service.py | yuyiming/mars | 5e6990d1ea022444dd646c56697e596ef5d7e747 | [
"Apache-2.0"
] | 1 | 2022-02-24T08:39:26.000Z | 2022-02-24T08:39:26.000Z | mars/services/subtask/tests/test_service.py | yuyiming/mars | 5e6990d1ea022444dd646c56697e596ef5d7e747 | [
"Apache-2.0"
] | null | null | null | mars/services/subtask/tests/test_service.py | yuyiming/mars | 5e6990d1ea022444dd646c56697e596ef5d7e747 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.159236 | 87 | 0.684595 |
import asyncio
import time
import numpy as np
import pytest
from .... import oscar as mo
from .... import tensor as mt
from .... import remote as mr
from ....core.graph import TileableGraph, TileableGraphBuilder, ChunkGraphBuilder
from ....resource import Resource
from ....utils import Timer
from ... i... | true | true |
f73324757c8fe86199a89fe5528fe1ae141249f5 | 2,766 | py | Python | tools/Bitcoin Parser/blockchain_parser/tests/test_output.py | SimeoW/bitcoin_researcher | 3644405f06c8b16a437513e8c02f0f061b91be2e | [
"MIT"
] | 1 | 2020-02-15T21:44:04.000Z | 2020-02-15T21:44:04.000Z | tools/Bitcoin Parser/blockchain_parser/tests/test_output.py | SimeoW/bitcoin_researcher | 3644405f06c8b16a437513e8c02f0f061b91be2e | [
"MIT"
] | null | null | null | tools/Bitcoin Parser/blockchain_parser/tests/test_output.py | SimeoW/bitcoin_researcher | 3644405f06c8b16a437513e8c02f0f061b91be2e | [
"MIT"
] | null | null | null | # Copyright (C) 2015-2016 The bitcoin-blockchain-parser developers
#
# This file is part of bitcoin-blockchain-parser.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of bitcoin-blockchain-parser, including this file, may be copied,
# modif... | 41.283582 | 79 | 0.707158 |
import unittest
from binascii import a2b_hex
from blockchain_parser.output import Output
class TestOutput(unittest.TestCase):
def test_pubkeyhash_from_hex(self):
raw_output = "01000000000000001976a91432ba382cf668657bae15ee0a97fa87" \
"f12e1bc89f88ac"
output = Outpu... | true | true |
f7332501c73d1e51adfaedc1f6ffe078f2e3b8c2 | 8,367 | py | Python | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/compile/deploy_optimizer.py | bluetiger9/Vitis-AI | a7728733bbcfc292ff3afa46b9c8b03e94b740b3 | [
"Apache-2.0"
] | null | null | null | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/compile/deploy_optimizer.py | bluetiger9/Vitis-AI | a7728733bbcfc292ff3afa46b9c8b03e94b740b3 | [
"Apache-2.0"
] | null | null | null | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/compile/deploy_optimizer.py | bluetiger9/Vitis-AI | a7728733bbcfc292ff3afa46b9c8b03e94b740b3 | [
"Apache-2.0"
] | null | null | null |
#
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 32.811765 | 123 | 0.659018 |
import copy
from nndct_shared.base import NNDCT_OP
from nndct_shared.nndct_graph import Tensor, Graph, Node
from nndct_shared.utils import NndctDebugLogger, NndctOption
from typing import List, Dict
from .op_evaluator import Evaluator
from collections import defaultdict
class DevGraphOptimizer(objec... | true | true |
f733273aec9a49b209744ed817dbfc31753f022d | 27,671 | py | Python | elit/components/srl/span_rank/span_ranking_srl_model.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-09-17T15:23:31.000Z | 2022-02-28T10:18:04.000Z | elit/components/srl/span_rank/span_ranking_srl_model.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | elit/components/srl/span_rank/span_ranking_srl_model.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from alnlp.modules.feedforward import FeedForward
from alnlp.modules.time_distributed import TimeDistributed
from .highway_variational_lstm import *
import torch
from alnlp.modules import util
from ...parsers.biaffine.biaffine import Biaffine
def initializer_1d(input_tensor, initializer):
... | 55.231537 | 123 | 0.668317 | from typing import Dict
from alnlp.modules.feedforward import FeedForward
from alnlp.modules.time_distributed import TimeDistributed
from .highway_variational_lstm import *
import torch
from alnlp.modules import util
from ...parsers.biaffine.biaffine import Biaffine
def initializer_1d(input_tensor, initializer):
... | true | true |
f73327804f950cdb77bf55735456e5bd94c31f50 | 3,701 | py | Python | app/api/copytter/migrations/0002_entry_follow_media_profile.py | T-8723/copytter | bf27545a010d5fd1e17a38b10adddd22858cbcea | [
"MIT"
] | null | null | null | app/api/copytter/migrations/0002_entry_follow_media_profile.py | T-8723/copytter | bf27545a010d5fd1e17a38b10adddd22858cbcea | [
"MIT"
] | null | null | null | app/api/copytter/migrations/0002_entry_follow_media_profile.py | T-8723/copytter | bf27545a010d5fd1e17a38b10adddd22858cbcea | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-25 03:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('copy... | 52.871429 | 182 | 0.598757 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('copytter', '0001_initial'),
]
operations =... | true | true |
f73327d5e75e9c13d3934310bd44d2656ccf8cef | 332,816 | py | Python | kubernetes_asyncio/client/api/rbac_authorization_v1alpha1_api.py | opsani/kubernetes_asyncio | 55283bf6f3690e5c0a0c589cd752221511e2be51 | [
"Apache-2.0"
] | 196 | 2018-05-23T16:55:41.000Z | 2022-03-31T10:09:40.000Z | kubernetes_asyncio/client/api/rbac_authorization_v1alpha1_api.py | tomplus/kubernetes_asyncio | e8c8686ec11be3a5295ae9d5d8728299492a61f8 | [
"Apache-2.0"
] | 164 | 2018-05-20T20:39:03.000Z | 2022-03-29T22:57:04.000Z | kubernetes_asyncio/client/api/rbac_authorization_v1alpha1_api.py | opsani/kubernetes_asyncio | 55283bf6f3690e5c0a0c589cd752221511e2be51 | [
"Apache-2.0"
] | 41 | 2018-06-08T00:39:53.000Z | 2022-01-12T18:19:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.18.20
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re #... | 73.355962 | 1,390 | 0.674574 |
from __future__ import absolute_import
import re
import six
from kubernetes_asyncio.client.api_client import ApiClient
from kubernetes_asyncio.client.exceptions import (
ApiTypeError,
ApiValueError
)
class RbacAuthorizationV1alpha1Api(object):
def __init__(self, api_client=None):
if a... | true | true |
f733282a2a00b8956c51e6558ce4316df6e89b60 | 3,996 | py | Python | src/main/resources/license.xlr/LicenseUsageTile.py | xebialabs-community/xlr-license-usage-tile | a15b36b1d84469a00a4d99dba2a4e000b2f685e8 | [
"MIT"
] | null | null | null | src/main/resources/license.xlr/LicenseUsageTile.py | xebialabs-community/xlr-license-usage-tile | a15b36b1d84469a00a4d99dba2a4e000b2f685e8 | [
"MIT"
] | 2 | 2019-12-03T16:10:16.000Z | 2020-02-25T02:15:13.000Z | src/main/resources/license.xlr/LicenseUsageTile.py | xebialabs-community/xlr-license-usage-tile | a15b36b1d84469a00a4d99dba2a4e000b2f685e8 | [
"MIT"
] | null | null | null | #
# Copyright 2020 XEBIALABS
#
# 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, subli... | 41.195876 | 462 | 0.676927 |
from xlrelease.HttpRequest import HttpRequest
import logging
import json
from datetime import datetime, timedelta
logging.basicConfig(filename='log/custom-tile.log',
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
... | true | true |
f73328450770dc31a88d16880e3a21aeae5c4868 | 68,372 | py | Python | ourAutomation/generateArtiTest.py | ayhamkassab/blockchain-automation-framework | 2b29abc77d36d7347c209c3a8884010c44aef9bc | [
"Apache-2.0"
] | null | null | null | ourAutomation/generateArtiTest.py | ayhamkassab/blockchain-automation-framework | 2b29abc77d36d7347c209c3a8884010c44aef9bc | [
"Apache-2.0"
] | null | null | null | ourAutomation/generateArtiTest.py | ayhamkassab/blockchain-automation-framework | 2b29abc77d36d7347c209c3a8884010c44aef9bc | [
"Apache-2.0"
] | 1 | 2021-05-27T15:22:21.000Z | 2021-05-27T15:22:21.000Z | #!/usr/bin/python3
import os
import argparse
import shutil
import subprocess
import yaml
import sys
import pprint
#import oyaml as yaml
from collections import OrderedDict
import glob
import numpy as np
import datetime
import time
ts = time.time()
class UnsortableList(list):
def sort(self, *args, **kwargs):
... | 46.958791 | 6,938 | 0.622536 |
import os
import argparse
import shutil
import subprocess
import yaml
import sys
import pprint
from collections import OrderedDict
import glob
import numpy as np
import datetime
import time
ts = time.time()
class UnsortableList(list):
def sort(self, *args, **kwargs):
pass
class UnsortableOrderedDict(Ord... | false | true |
f73328553727f0236d71100aa88a52b283b8b71f | 3,421 | py | Python | django_signal_valve/tests/test_valve.py | SHUN-YI/bk-sops | a4a841bdc44a18518c6c53c04a02996ddc7da2be | [
"Apache-2.0"
] | 2 | 2019-08-15T10:06:26.000Z | 2019-09-17T11:49:20.000Z | django_signal_valve/tests/test_valve.py | SHUN-YI/bk-sops | a4a841bdc44a18518c6c53c04a02996ddc7da2be | [
"Apache-2.0"
] | null | null | null | django_signal_valve/tests/test_valve.py | SHUN-YI/bk-sops | a4a841bdc44a18518c6c53c04a02996ddc7da2be | [
"Apache-2.0"
] | 1 | 2020-07-03T06:45:07.000Z | 2020-07-03T06:45:07.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 36.393617 | 305 | 0.684303 |
from django.test import TestCase
from django_signal_valve import valve
from django_signal_valve.tests import mock_signal
from django_signal_valve.models import Signal
class TestValve(TestCase):
def setUp(self):
valve.unload_valve_function()
def test_set_valve_function(self):
self.assertRais... | true | true |
f73328b9abf3338db66b74e2b9511a22db3e10af | 8 | py | Python | python/testData/codeInsight/mlcompletion/numOfPrevQualifiersIs1.py | Sajaki/intellij-community | 6748af2c40567839d11fd652ec77ba263c074aad | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/codeInsight/mlcompletion/numOfPrevQualifiersIs1.py | Sajaki/intellij-community | 6748af2c40567839d11fd652ec77ba263c074aad | [
"Apache-2.0"
] | 1 | 2020-07-30T19:04:47.000Z | 2020-07-30T19:04:47.000Z | python/testData/codeInsight/mlcompletion/numOfPrevQualifiersIs1.py | bradleesand/intellij-community | 750ff9c10333c9c1278c00dbe8d88c877b1b9749 | [
"Apache-2.0"
] | 1 | 2020-10-15T05:56:42.000Z | 2020-10-15T05:56:42.000Z | a<caret> | 8 | 8 | 0.75 | a<caret> | false | true |
f73328c7728db7b0c158a96b040f0fbb97007485 | 4,046 | py | Python | alipay/aop/api/request/KoubeiMarketingCampaignOpenDeliveryDeleteRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/KoubeiMarketingCampaignOpenDeliveryDeleteRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/KoubeiMarketingCampaignOpenDeliveryDeleteRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiMarketingCampaignOpenDeliveryDeleteModel import KoubeiMarketingCampaignOpenDeliveryDeleteModel
class KoubeiMarketingCampaignOp... | 27.903448 | 148 | 0.651013 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiMarketingCampaignOpenDeliveryDeleteModel import KoubeiMarketingCampaignOpenDeliveryDeleteModel
class KoubeiMarketingCampaignOpenDeliveryDeleteRequest(object):
def __... | true | true |
f7332a528686f1767dfbe9b79555fc71b67c5c1c | 9,566 | py | Python | Integrations/python/deephaven_legacy/lang/vectorize_simple.py | mattrunyon/deephaven-core | 80e3567e4647ab76a81e483d0a8ab542f9aadace | [
"MIT"
] | null | null | null | Integrations/python/deephaven_legacy/lang/vectorize_simple.py | mattrunyon/deephaven-core | 80e3567e4647ab76a81e483d0a8ab542f9aadace | [
"MIT"
] | null | null | null | Integrations/python/deephaven_legacy/lang/vectorize_simple.py | mattrunyon/deephaven-core | 80e3567e4647ab76a81e483d0a8ab542f9aadace | [
"MIT"
] | null | null | null |
"""
Utilities for vectorization.
**The contents of this module are intended only for internal Deephaven use and may change at any time.**
"""
import ast
import traceback
from collections import OrderedDict
import collections
from io import UnsupportedOperation
import numba as nb
import numba.types
import numba.typi... | 41.055794 | 155 | 0.589484 |
import ast
import traceback
from collections import OrderedDict
import collections
from io import UnsupportedOperation
import numba as nb
import numba.types
import numba.typing
import numpy
from numba.npyufunc import vectorize
from numpy.core.multiarray import ndarray
from deephaven_legacy.lang.analyzer import Anal... | true | true |
f7332ae2eed05985ae6cecf9073d692e38ef04fa | 1,342 | py | Python | vmaig_blog/uwsgi-2.0.14/tests/queue.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | 1 | 2018-11-24T16:10:49.000Z | 2018-11-24T16:10:49.000Z | vmaig_blog/uwsgi-2.0.14/tests/queue.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null | vmaig_blog/uwsgi-2.0.14/tests/queue.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null | # uwsgi --queue 10 --queue-store test.queue --master --module tests.queue --socket :3031
import uwsgi
import os
from flask import Flask,render_template,request,redirect,flash
app = Flask(__name__)
app.debug = True
app.secret_key = os.urandom(24)
@app.route('/')
def index():
return render_template('queue.html', ... | 27.387755 | 103 | 0.634128 |
import uwsgi
import os
from flask import Flask,render_template,request,redirect,flash
app = Flask(__name__)
app.debug = True
app.secret_key = os.urandom(24)
@app.route('/')
def index():
return render_template('queue.html', uwsgi=uwsgi)
@app.route('/push', methods=['POST'])
def push_item():
if uwsgi.queue_... | true | true |
f7332b120a80430b2740b372b62f2bf1873a53c5 | 8,162 | py | Python | pasta/treeholder.py | koditaraszka/pasta | 2f14d5ae5b256ce1cd6bc49e44cc84a7b25be7f9 | [
"Python-2.0",
"BSD-Source-Code",
"OLDAP-2.7"
] | 1 | 2018-06-22T03:27:55.000Z | 2018-06-22T03:27:55.000Z | pasta/treeholder.py | kodicollins/pasta | 2f14d5ae5b256ce1cd6bc49e44cc84a7b25be7f9 | [
"Python-2.0",
"BSD-Source-Code",
"OLDAP-2.7"
] | null | null | null | pasta/treeholder.py | kodicollins/pasta | 2f14d5ae5b256ce1cd6bc49e44cc84a7b25be7f9 | [
"Python-2.0",
"BSD-Source-Code",
"OLDAP-2.7"
] | null | null | null | #!/usr/bin/env python
# This file is part of PASTA and is forked from SATe
# PASTA like SATe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | 40.405941 | 119 | 0.659397 |
import dendropy
try:
from cStringIO import StringIO
except:
from io import StringIO
from pasta.tree import PhylogeneticTree
from pasta.errors import TaxaLabelsMismatchError
from pasta import get_logger
from dendropy import Tree, TreeList
_LOG = get_logger(__name__)
from dendropy.datamodel.tr... | true | true |
f7332bc723643ecab2695e061bcbc427a2a2cf7d | 7,532 | py | Python | TA-linode/bin/ta_linode/aob_py3/solnlib/splunkenv.py | jriddle-linode/splunk-addon-linode | 5954acd12ef88ab991365ef51072db68aed46aa1 | [
"Apache-2.0"
] | 11 | 2020-01-23T11:32:26.000Z | 2021-09-23T09:24:02.000Z | TA-linode/bin/ta_linode/aob_py3/solnlib/splunkenv.py | jriddle-linode/splunk-addon-linode | 5954acd12ef88ab991365ef51072db68aed46aa1 | [
"Apache-2.0"
] | 26 | 2019-07-15T02:38:22.000Z | 2021-12-01T04:14:17.000Z | TA-linode/bin/ta_linode/aob_py3/solnlib/splunkenv.py | jriddle-linode/splunk-addon-linode | 5954acd12ef88ab991365ef51072db68aed46aa1 | [
"Apache-2.0"
] | 6 | 2019-07-14T17:44:06.000Z | 2020-11-17T17:33:23.000Z | # Copyright 2016 Splunk, Inc.
# SPDX-FileCopyrightText: 2020 2020
#
# SPDX-License-Identifier: Apache-2.0
"""
Splunk platform related utilities.
"""
import os
import os.path as op
import subprocess
import socket
try:
from ConfigParser import ConfigParser
CONF_PARSER_KWARGS = {}
except ImportError:
from ... | 26.42807 | 85 | 0.635024 |
import os
import os.path as op
import subprocess
import socket
try:
from ConfigParser import ConfigParser
CONF_PARSER_KWARGS = {}
except ImportError:
from configparser import ConfigParser
CONF_PARSER_KWARGS = {"strict": False}
from io import StringIO
from . import utils
__all__ = [
"make... | true | true |
f7332c7bdb8b56b19acfa24147f6f7e92a2f35cf | 1,187 | py | Python | django/duck/media.py | lastcoolnameleft/duckiehunt | 4a00c12aac934fc9492ebd8563a36b4e76eab671 | [
"MIT"
] | 1 | 2018-04-16T04:03:13.000Z | 2018-04-16T04:03:13.000Z | django/duck/media.py | lastcoolnameleft/duckiehunt | 4a00c12aac934fc9492ebd8563a36b4e76eab671 | [
"MIT"
] | 38 | 2017-07-31T01:02:10.000Z | 2022-02-10T07:45:55.000Z | django/duck/media.py | lastcoolnameleft/duckiehunt | 4a00c12aac934fc9492ebd8563a36b4e76eab671 | [
"MIT"
] | null | null | null | """ Helper functions for uploading image to Flickr """
import flickr_api
from django.conf import settings
from django.core.files.storage import FileSystemStorage
def handle_uploaded_file(uploaded_file, duck_id, duck_name, comments):
""" Upload duck location image to flickr """
title = 'Duck #' + str(duck_id) +... | 40.931034 | 100 | 0.723673 | import flickr_api
from django.conf import settings
from django.core.files.storage import FileSystemStorage
def handle_uploaded_file(uploaded_file, duck_id, duck_name, comments):
title = 'Duck #' + str(duck_id) + ' (' + duck_name + ')'
tags = "duckiehunt"
file_path = write_upload_to_file(uploaded_file, set... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.