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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f3b91aaafecc64212f98af0b110358b4a50fdb | 655 | py | Python | categories_api/config/yasg.py | spanickroon/Categories-API | dc4a3f8e3ba9aa6f836f5d5a8dc3368abc11bac6 | [
"MIT"
] | null | null | null | categories_api/config/yasg.py | spanickroon/Categories-API | dc4a3f8e3ba9aa6f836f5d5a8dc3368abc11bac6 | [
"MIT"
] | 1 | 2021-01-12T10:34:46.000Z | 2021-01-12T10:53:08.000Z | categories_api/config/yasg.py | spanickroon/Categories-API | dc4a3f8e3ba9aa6f836f5d5a8dc3368abc11bac6 | [
"MIT"
] | null | null | null | from django.urls import path
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
openapi.Info(
title='Catagories API',
default_version='v1',
description="""A simple Categories API that stores category tree
... | 26.2 | 70 | 0.712977 | from django.urls import path
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
openapi.Info(
title='Catagories API',
default_version='v1',
description="""A simple Categories API that stores category tree
... | true | true |
08f3b937dc19175365045f03317b51cab71b5ce3 | 491 | py | Python | maps.py | ArkaneOnline/discord-life360-bot | 01a6e3d5e0ed08ae517b6da6ca2a61bb1f089694 | [
"Unlicense"
] | 2 | 2019-06-21T15:36:01.000Z | 2021-03-09T06:10:00.000Z | maps.py | ArkaneOnline/discord-life360-bot | 01a6e3d5e0ed08ae517b6da6ca2a61bb1f089694 | [
"Unlicense"
] | null | null | null | maps.py | ArkaneOnline/discord-life360-bot | 01a6e3d5e0ed08ae517b6da6ca2a61bb1f089694 | [
"Unlicense"
] | 2 | 2022-03-16T04:49:57.000Z | 2022-03-27T12:47:47.000Z | import urllib.request
import json
import os
def retornarEnd(latlng):
url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + \
latlng + "&key=" + os.environ["mapsAPI_key"]
r = urllib.request.urlopen(url)
results = json.loads(r.read().decode())
results = results['results']... | 30.6875 | 74 | 0.631365 | import urllib.request
import json
import os
def retornarEnd(latlng):
url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + \
latlng + "&key=" + os.environ["mapsAPI_key"]
r = urllib.request.urlopen(url)
results = json.loads(r.read().decode())
results = results['results']... | true | true |
08f3b96a9183d37117226eb43bec574bf916393f | 1,656 | py | Python | star_tides/api/controllers/__init__.py | STAR-TIDES/kb | 6f895b03db0eefa86a1667d3024f4fe5b92ea99e | [
"MIT"
] | 2 | 2021-06-10T20:58:27.000Z | 2021-12-29T14:40:44.000Z | star_tides/api/controllers/__init__.py | STAR-TIDES/kb | 6f895b03db0eefa86a1667d3024f4fe5b92ea99e | [
"MIT"
] | 38 | 2021-05-13T06:23:49.000Z | 2021-10-12T23:32:36.000Z | star_tides/api/controllers/__init__.py | STAR-TIDES/kb | 6f895b03db0eefa86a1667d3024f4fe5b92ea99e | [
"MIT"
] | null | null | null | ''' star_tides.api.controllers
'''
import json
from http import HTTPStatus
import re
from typing import NamedTuple
from flask import Response
import string
from star_tides.exceptions import InvalidParamError
class ControllerResponse(NamedTuple):
response: dict
http_code: HTTPStatus
def build_response(respon... | 28.067797 | 89 | 0.704106 | import json
from http import HTTPStatus
import re
from typing import NamedTuple
from flask import Response
import string
from star_tides.exceptions import InvalidParamError
class ControllerResponse(NamedTuple):
response: dict
http_code: HTTPStatus
def build_response(response: ControllerResponse) -> Response... | true | true |
08f3bac62a5513b4ea664a2b2ee58d0fd3fff15c | 1,537 | py | Python | web/api/py/codechecker_api/setup.py | gaybro8777/codechecker | 33bfac050a194552ec84450802aae05a9a973b32 | [
"Apache-2.0"
] | null | null | null | web/api/py/codechecker_api/setup.py | gaybro8777/codechecker | 33bfac050a194552ec84450802aae05a9a973b32 | [
"Apache-2.0"
] | null | null | null | web/api/py/codechecker_api/setup.py | gaybro8777/codechecker | 33bfac050a194552ec84450802aae05a9a973b32 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
# io.open is needed for projects that support Python 2.7
# Python 3 only projects can skip this import
from io import open
# Get the long description from the README file
with open('README.md', encoding='utf-8', errors="ignore") as f:
long_description = f.read()
api_ve... | 31.367347 | 80 | 0.654522 | from setuptools import setup, find_packages
from io import open
with open('README.md', encoding='utf-8', errors="ignore") as f:
long_description = f.read()
api_version = '6.36.0'
setup(
name='codechecker_api',
version=api_version,
author='CodeChecker Team (Ericsson)',
description='Generated Pyth... | true | true |
08f3bb42d6afadb80c7326a3238a181606e891e6 | 1,212 | py | Python | tensorflow_federated/python/tensorflow_libs/function_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 5 | 2020-06-04T20:10:25.000Z | 2020-07-22T02:15:38.000Z | tensorflow_federated/python/tensorflow_libs/function_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 7 | 2020-04-03T05:32:28.000Z | 2020-05-15T01:28:25.000Z | tensorflow_federated/python/tensorflow_libs/function_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 2 | 2020-04-28T17:46:13.000Z | 2022-02-10T02:40:40.000Z | # Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.647059 | 74 | 0.768977 |
import tensorflow as tf
from tensorflow_federated.python.common_libs import test
from tensorflow_federated.python.tensorflow_libs import function
class FunctionTest(test.TestCase):
def test_is_tf_function(self):
self.assertTrue(function.is_tf_function(tf.function(lambda x: None)))
concrete_fn = tf.functi... | true | true |
08f3bbed0ae64e7debbed89092c58ea8479e3e29 | 7,679 | py | Python | tests/test_strides.py | LukichevaPolina/dpnp | 5f5a679905d237ac7be1cc9ad1075877a9f77e39 | [
"BSD-2-Clause"
] | null | null | null | tests/test_strides.py | LukichevaPolina/dpnp | 5f5a679905d237ac7be1cc9ad1075877a9f77e39 | [
"BSD-2-Clause"
] | null | null | null | tests/test_strides.py | LukichevaPolina/dpnp | 5f5a679905d237ac7be1cc9ad1075877a9f77e39 | [
"BSD-2-Clause"
] | null | null | null | import math
import pytest
import dpnp
import numpy
def _getattr(ex, str_):
attrs = str_.split(".")
res = ex
for attr in attrs:
res = getattr(res, attr)
return res
@pytest.mark.parametrize("func_name",
['abs', ])
@pytest.mark.parametrize("type",
... | 33.532751 | 119 | 0.565308 | import math
import pytest
import dpnp
import numpy
def _getattr(ex, str_):
attrs = str_.split(".")
res = ex
for attr in attrs:
res = getattr(res, attr)
return res
@pytest.mark.parametrize("func_name",
['abs', ])
@pytest.mark.parametrize("type",
... | true | true |
08f3bd4dfaf917019f114bd41558be5cbe5ae49e | 3,560 | py | Python | tests/unit/bokeh/command/subcommands/test_info.py | jyoung0519/bokeh | c0aa52cfd9c47d0ab614afa667758cc3f8a39fa5 | [
"BSD-3-Clause"
] | 1 | 2020-05-26T15:21:22.000Z | 2020-05-26T15:21:22.000Z | tests/unit/bokeh/command/subcommands/test_info.py | jyoung0519/bokeh | c0aa52cfd9c47d0ab614afa667758cc3f8a39fa5 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T17:32:31.000Z | 2021-12-21T18:11:05.000Z | tests/unit/bokeh/command/subcommands/test_info.py | jyoung0519/bokeh | c0aa52cfd9c47d0ab614afa667758cc3f8a39fa5 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T05:50:00.000Z | 2021-12-20T05:50:00.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 35.959596 | 93 | 0.442978 |
from __future__ import annotations
import pytest ; pytest
from os.path import join
from bokeh._testing.util.types import Capture
from bokeh.command.bootstrap import main
from bokeh.command.subcommand import Argument
import bokeh.command.subcommands.info as scinfo
def test_create() -> None:
import argparse... | true | true |
08f3be50fdf2bce2ab0aec4b9cbc983456fc990f | 7,756 | py | Python | docs/conf.py | ayushlabh/Titanic | 6dcc89af8d5f3bf4a00ce17e93b212410da738aa | [
"MIT"
] | null | null | null | docs/conf.py | ayushlabh/Titanic | 6dcc89af8d5f3bf4a00ce17e93b212410da738aa | [
"MIT"
] | null | null | null | docs/conf.py | ayushlabh/Titanic | 6dcc89af8d5f3bf4a00ce17e93b212410da738aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Titanic documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a... | 31.657143 | 80 | 0.706034 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Titanic'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/b... | true | true |
08f3bebe107e6a4e48f8dcea656e19041bcb024b | 2,251 | py | Python | userbot/modules/artsnew.py | TAMILVIP007/javes-3.0 | d9238785fa2d79740bbb526aca92455dbccb3838 | [
"MIT"
] | 1 | 2021-05-06T18:30:50.000Z | 2021-05-06T18:30:50.000Z | userbot/modules/artsnew.py | hellboi-atul/javes-3.0 | 8777d482bd1ee877a96332a2cd84d880c151fa43 | [
"MIT"
] | null | null | null | userbot/modules/artsnew.py | hellboi-atul/javes-3.0 | 8777d482bd1ee877a96332a2cd84d880c151fa43 | [
"MIT"
] | null | null | null | import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from platform import uname
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd
from userbot import bot as javes
n = str(ALIVE_NAME) if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku"
#@command(o... | 22.068627 | 80 | 0.436251 | import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from platform import uname
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd
from userbot import bot as javes
n = str(ALIVE_NAME) if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku"
@javes.on(a... | true | true |
08f3bee7d3141cc36d69cecf6e04bbe610e0269a | 165 | py | Python | chat/routing.py | Nurs66/my_twitter | aceba4fd4b2d03fb4227e2d3ac5071ecac062b58 | [
"MIT"
] | null | null | null | chat/routing.py | Nurs66/my_twitter | aceba4fd4b2d03fb4227e2d3ac5071ecac062b58 | [
"MIT"
] | 4 | 2020-02-12T00:54:10.000Z | 2021-06-10T21:41:55.000Z | chat/routing.py | Nurs66/my_twitter | aceba4fd4b2d03fb4227e2d3ac5071ecac062b58 | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import consumers
websocket_urlpatterns = [
re_path(r'^ws/chat/(?P<room_name>[^/]+)/$', consumers.ChatConsumer),
]
| 20.625 | 72 | 0.70303 | from django.urls import path, re_path
from . import consumers
websocket_urlpatterns = [
re_path(r'^ws/chat/(?P<room_name>[^/]+)/$', consumers.ChatConsumer),
]
| true | true |
08f3bf5701bd838173e83e4b08a79d5f7744b9dd | 29,628 | py | Python | glance/common/config.py | netsec/glance | 93231924fd26abbd66e7c3950dc12875d4500d29 | [
"Apache-2.0"
] | null | null | null | glance/common/config.py | netsec/glance | 93231924fd26abbd66e7c3950dc12875d4500d29 | [
"Apache-2.0"
] | null | null | null | glance/common/config.py | netsec/glance | 93231924fd26abbd66e7c3950dc12875d4500d29 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# 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 requ... | 35.739445 | 102 | 0.669266 |
import logging
import os
from oslo_config import cfg
from oslo_middleware import cors
from oslo_policy import policy
from paste import deploy
from glance.i18n import _
from glance.version import version_info as version
paste_deploy_opts = [
cfg.StrOpt('flavor',
sample_default='keystone',
... | true | true |
08f3bf78ec0bf3ecbdc2b6d02b4fb5cc5ad133ad | 2,373 | py | Python | test/functional/mempool_spend_coinbase.py | thelazier/dash | 22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd | [
"MIT"
] | null | null | null | test/functional/mempool_spend_coinbase.py | thelazier/dash | 22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd | [
"MIT"
] | null | null | null | test/functional/mempool_spend_coinbase.py | thelazier/dash | 22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100... ... | 40.220339 | 143 | 0.718921 |
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.blocktools import create_raw_transaction
from test_framework.util import assert_equal, assert_raises_rpc_error
class MempoolSpendCoinbaseTest(BitcoinTestFramework):
def set_test_params(self):
s... | true | true |
08f3c049a010ebece3a804520d1654a3bbb18aee | 516 | py | Python | risk_register/migrations/0038_auto_20181008_1219.py | justin441/risk_management | 2f5f0f62aae34998db7cf4155297ce4f6a8d774e | [
"MIT"
] | null | null | null | risk_register/migrations/0038_auto_20181008_1219.py | justin441/risk_management | 2f5f0f62aae34998db7cf4155297ce4f6a8d774e | [
"MIT"
] | null | null | null | risk_register/migrations/0038_auto_20181008_1219.py | justin441/risk_management | 2f5f0f62aae34998db7cf4155297ce4f6a8d774e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-10-08 11:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('risk_register', '0037_auto_20181008_1146'),
]
operations = [
migrations.AlterField(
model_name='controle',
name='cri... | 27.157895 | 165 | 0.614341 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('risk_register', '0037_auto_20181008_1146'),
]
operations = [
migrations.AlterField(
model_name='controle',
name='critere_cible',
field=models.CharField(... | true | true |
08f3c085999a1e1b5ee7cae95073b7a75ac07cb6 | 23,538 | py | Python | bmediacenter/src/MC_WeatherInfo.py | Mariusz1970/enigma2-plugins-1 | 126d31d075c156f32b09d4321ebe1a17f93a5bd6 | [
"OLDAP-2.3"
] | 2 | 2020-09-02T18:25:39.000Z | 2020-09-02T18:39:07.000Z | bmediacenter/src/MC_WeatherInfo.py | Mariusz1970/enigma2-plugins-1 | 126d31d075c156f32b09d4321ebe1a17f93a5bd6 | [
"OLDAP-2.3"
] | null | null | null | bmediacenter/src/MC_WeatherInfo.py | Mariusz1970/enigma2-plugins-1 | 126d31d075c156f32b09d4321ebe1a17f93a5bd6 | [
"OLDAP-2.3"
] | 11 | 2015-02-26T20:59:14.000Z | 2021-09-20T08:23:03.000Z | # -*- coding: utf-8 -*-
# for localized messages
from __init__ import _
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.MenuList import MenuList
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import St... | 43.508318 | 250 | 0.708132 | from __init__ import _
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.MenuList import MenuList
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from xml.etree.cElementTree import froms... | false | true |
08f3c11f7be52e5767413cd67bf726580b582d90 | 617 | py | Python | atividades/ex88_11.py | Fleen66/Python_exercises | fd05fdf1181da833a1a1bc9f4a476afc8f467977 | [
"MIT"
] | null | null | null | atividades/ex88_11.py | Fleen66/Python_exercises | fd05fdf1181da833a1a1bc9f4a476afc8f467977 | [
"MIT"
] | null | null | null | atividades/ex88_11.py | Fleen66/Python_exercises | fd05fdf1181da833a1a1bc9f4a476afc8f467977 | [
"MIT"
] | null | null | null | import random
jogos = int(input('Quantos jogos deseja sortear? '))
numeros = list()
c = jogos
cont = 1
for i in range(0, 6):
n = random.randint(0, 60)
numeros.append(n)
if i == 5:
numeros.sort()
print(f'Jogo {cont} foi: {numeros} ')
numeros.clear()
cont += 1
if c > 1:
whi... | 23.730769 | 52 | 0.461912 | import random
jogos = int(input('Quantos jogos deseja sortear? '))
numeros = list()
c = jogos
cont = 1
for i in range(0, 6):
n = random.randint(0, 60)
numeros.append(n)
if i == 5:
numeros.sort()
print(f'Jogo {cont} foi: {numeros} ')
numeros.clear()
cont += 1
if c > 1:
whi... | true | true |
08f3c1662c718f15d28cb334f72d2a38001988dc | 3,218 | py | Python | doc/make.py | astraw/matplotlib-ancient | 7272f102482941ada6e5fd874bdf7f185f420526 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | 3 | 2015-11-16T07:22:28.000Z | 2016-11-11T17:55:14.000Z | doc/make.py | astraw/matplotlib-ancient | 7272f102482941ada6e5fd874bdf7f185f420526 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | doc/make.py | astraw/matplotlib-ancient | 7272f102482941ada6e5fd874bdf7f185f420526 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import fileinput
import glob
import os
import shutil
import sys
def check_build():
build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',
'_static', '_templates']
for d in build_dirs:
try:
os.mkdir(d)
except OSError:
... | 28.22807 | 131 | 0.585146 | import fileinput
import glob
import os
import shutil
import sys
def check_build():
build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',
'_static', '_templates']
for d in build_dirs:
try:
os.mkdir(d)
except OSError:
pass
def sf():
'... | false | true |
08f3c17924b7473e866a58b8a13604b3a2af4613 | 840 | py | Python | posts/migrations/0002_auto_20201011_1034.py | Drag0nfather/hw02_community | 4ab66b71b11dd4f733c06b9d0be5cf255530a38e | [
"BSD-3-Clause"
] | null | null | null | posts/migrations/0002_auto_20201011_1034.py | Drag0nfather/hw02_community | 4ab66b71b11dd4f733c06b9d0be5cf255530a38e | [
"BSD-3-Clause"
] | 5 | 2021-03-19T12:55:51.000Z | 2022-02-10T12:58:14.000Z | posts/migrations/0002_auto_20201011_1034.py | Drag0nfather/hw02_community | 4ab66b71b11dd4f733c06b9d0be5cf255530a38e | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.9 on 2020-10-11 10:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Group',
fie... | 28.965517 | 123 | 0.565476 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Group',
fields=[
('id', models.AutoField(au... | true | true |
08f3c1c53181e0088b3461d0b50aa3806c489eff | 1,775 | py | Python | reportlib.py | nuric/pix2rule | 0f0f654e488a1839455786ccc4ad023c0aa0c2e8 | [
"MIT"
] | 6 | 2021-06-15T10:37:34.000Z | 2022-01-26T14:41:44.000Z | reportlib.py | nuric/pix2rule | 0f0f654e488a1839455786ccc4ad023c0aa0c2e8 | [
"MIT"
] | 3 | 2021-08-25T15:17:22.000Z | 2021-11-12T13:52:14.000Z | reportlib.py | nuric/pix2rule | 0f0f654e488a1839455786ccc4ad023c0aa0c2e8 | [
"MIT"
] | 1 | 2021-11-08T17:36:52.000Z | 2021-11-08T17:36:52.000Z | """Global reporting tool to extract eager tensors."""
from typing import Dict, Any
import pdb
import tensorflow as tf
# Global report dictionary
_report: Dict[str, Any] = dict()
# Models / layers use this function to write into the global dictionary
def report_tensor(key: str, tensor: tf.Tensor):
"""Report a te... | 35.5 | 85 | 0.655775 | from typing import Dict, Any
import pdb
import tensorflow as tf
_report: Dict[str, Any] = dict()
def report_tensor(key: str, tensor: tf.Tensor):
assert isinstance(key, str), "Keys must be strings."
key_count = sum([1 for k in _report if k.startswith(key)])
if key_count:
key = key + str(key_count... | true | true |
08f3c31d52dd46193d0e01b15dc012e895bd8bac | 1,645 | py | Python | var/spack/repos/builtin/packages/atmi/package.py | vreshniak/spack-xsdk | b2da85f9309e38082db6b35a79028734ae5e0e96 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/atmi/package.py | vreshniak/spack-xsdk | b2da85f9309e38082db6b35a79028734ae5e0e96 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/atmi/package.py | vreshniak/spack-xsdk | b2da85f9309e38082db6b35a79028734ae5e0e96 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 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 Atmi(CMakePackage):
"""Asynchronous Task and Memory Interface, or ATMI, is a runtime fram... | 37.386364 | 105 | 0.681459 |
from spack import *
class Atmi(CMakePackage):
homepage = "https://github.com/RadeonOpenCompute/atmi"
url = "https://github.com/RadeonOpenCompute/atmi/archive/rocm-3.7.0.tar.gz"
maintainers = ['srekolam', 'arjun-raj-kuppala']
version('3.7.0', sha256='8df08489a10ee04cea911811393e0e7d91bd437fc1... | true | true |
08f3c37941c06231406888f0b520e57a8e753653 | 8,078 | py | Python | applications/FluidDynamicsApplication/python_scripts/navier_stokes_compressible_explicit_solver.py | cwx-ae/Kratos | 25e73148a1db56a142650a1e19f195124888c6cd | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/FluidDynamicsApplication/python_scripts/navier_stokes_compressible_explicit_solver.py | cwx-ae/Kratos | 25e73148a1db56a142650a1e19f195124888c6cd | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/FluidDynamicsApplication/python_scripts/navier_stokes_compressible_explicit_solver.py | cwx-ae/Kratos | 25e73148a1db56a142650a1e19f195124888c6cd | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Importing the Kratos Library
import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
## Import base class file
from KratosMultiphysics.FluidDyna... | 53.496689 | 159 | 0.724684 | from __future__ import print_function, absolute_import, division import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
from KratosMultiphysics.FluidDynamicsApplication.fluid_solver import FluidSolver
from KratosMultiphysics import python_linear_solver_factory as linear_solver_fa... | true | true |
08f3c45364813b0c46d2aa5982cfaf1ae6744201 | 8,916 | py | Python | Autocoders/Python/src/fprime_ac/parsers/XmlArrayParser.py | samisweird/fprime | 5218784f25250e454df86f8eecc9cd7e483edc04 | [
"Apache-2.0"
] | 2 | 2021-09-24T23:28:33.000Z | 2022-03-06T08:42:02.000Z | Autocoders/Python/src/fprime_ac/parsers/XmlArrayParser.py | samisweird/fprime | 5218784f25250e454df86f8eecc9cd7e483edc04 | [
"Apache-2.0"
] | 42 | 2021-06-10T23:31:10.000Z | 2021-06-25T00:35:31.000Z | Autocoders/Python/src/fprime_ac/parsers/XmlArrayParser.py | samisweird/fprime | 5218784f25250e454df86f8eecc9cd7e483edc04 | [
"Apache-2.0"
] | 1 | 2021-07-20T18:23:26.000Z | 2021-07-20T18:23:26.000Z | #!/usr/bin/env python3
# ===============================================================================
# NAME: XmlArrayParser.py
#
# DESCRIPTION: This class parses the XML Array types files.
#
# USAGE:
#
# AUTHOR: jishii
# EMAIL: jordan.ishii@jpl.nasa.gov
# DATE CREATED : May 28, 2020
#
# Copyright 2020, California... | 32.421818 | 110 | 0.585913 | import logging
import os
import sys
import hashlib
from fprime_ac.utils import ConfigManager
from lxml import etree
from lxml import isoschematron
from fprime_ac.parsers import XmlParser
from fprime_ac.utils.exceptions import (
FprimeXmlException,
FprimeRngXmlValidationException,
)
PRINT = logging.getLogger("... | true | true |
08f3c63e3cdc9ca41cb96899561f94f40ca8a019 | 2,338 | py | Python | gamestonk_terminal/etf/financedatabase_view.py | CameronBeebe/GamestonkTerminal | e235f09290fbc188566643e5a7be46298d33ac35 | [
"MIT"
] | null | null | null | gamestonk_terminal/etf/financedatabase_view.py | CameronBeebe/GamestonkTerminal | e235f09290fbc188566643e5a7be46298d33ac35 | [
"MIT"
] | null | null | null | gamestonk_terminal/etf/financedatabase_view.py | CameronBeebe/GamestonkTerminal | e235f09290fbc188566643e5a7be46298d33ac35 | [
"MIT"
] | null | null | null | """Finance Database view"""
__docformat__ = "numpy"
import financedatabase as fd
import pandas as pd
from tabulate import tabulate
from gamestonk_terminal import feature_flags as gtff
def show_etfs(
category: str,
name: str,
description: str,
include_exchanges: bool,
amount: int,
options: str... | 30.763158 | 100 | 0.628315 | __docformat__ = "numpy"
import financedatabase as fd
import pandas as pd
from tabulate import tabulate
from gamestonk_terminal import feature_flags as gtff
def show_etfs(
category: str,
name: str,
description: str,
include_exchanges: bool,
amount: int,
options: str,
):
if options:
... | true | true |
08f3c6b387f07df80fac5687e5e56c94de82028c | 833 | py | Python | utils/operate_dir.py | hyooqi/artemis | bd410c274d2bf01fe69423589b19f2b7aabb7ead | [
"Apache-2.0"
] | null | null | null | utils/operate_dir.py | hyooqi/artemis | bd410c274d2bf01fe69423589b19f2b7aabb7ead | [
"Apache-2.0"
] | 3 | 2020-06-05T23:06:10.000Z | 2021-11-15T17:49:20.000Z | utils/operate_dir.py | shangjunimo/ooqitech-artemis | bd410c274d2bf01fe69423589b19f2b7aabb7ead | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import os
import shutil
logger = logging.getLogger('deploy.app')
def create_dir(path):
if not os.path.exists(path):
os.mkdir(path)
return True
return False
def copy_dir(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
s ... | 21.358974 | 52 | 0.554622 | import logging
import os
import shutil
logger = logging.getLogger('deploy.app')
def create_dir(path):
if not os.path.exists(path):
os.mkdir(path)
return True
return False
def copy_dir(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
s = os.path.join(src, item... | true | true |
08f3c7f899385eed378bda7eeb85a31e565ee4b1 | 1,470 | py | Python | jpgrep/test/test_morpheme.py | momijiame/jpgrep | eec8e418afa974db090bee7201f4651c207eff1f | [
"Apache-2.0"
] | 2 | 2015-12-09T15:47:11.000Z | 2016-04-15T08:19:54.000Z | jpgrep/test/test_morpheme.py | momijiame/jpgrep | eec8e418afa974db090bee7201f4651c207eff1f | [
"Apache-2.0"
] | null | null | null | jpgrep/test/test_morpheme.py | momijiame/jpgrep | eec8e418afa974db090bee7201f4651c207eff1f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import nose
from nose.tools.trivial import eq_
from jpgrep.morpheme import tokenize
from jpgrep.morpheme import StreamDetector
class Test_tokenize(object):
def test(self):
""" 文章が適切に形態素に分解される """
text = u'吾輩は猫である'
expect = [u'吾輩', u'は', u'猫'... | 21.304348 | 67 | 0.57619 |
import nose
from nose.tools.trivial import eq_
from jpgrep.morpheme import tokenize
from jpgrep.morpheme import StreamDetector
class Test_tokenize(object):
def test(self):
text = u'吾輩は猫である'
expect = [u'吾輩', u'は', u'猫', u'で', u'ある']
tokens = tokenize(text)
eq_(tokens, expect)
... | true | true |
08f3c83254d548abcb0ddea3c5868a1fe3869618 | 21,029 | py | Python | SROMPy/postprocess/Postprocessor.py | omunroe-com/nasasrompy | 35ae060b6a032d085a31574fbe3bf390b023631d | [
"Apache-2.0"
] | null | null | null | SROMPy/postprocess/Postprocessor.py | omunroe-com/nasasrompy | 35ae060b6a032d085a31574fbe3bf390b023631d | [
"Apache-2.0"
] | null | null | null | SROMPy/postprocess/Postprocessor.py | omunroe-com/nasasrompy | 35ae060b6a032d085a31574fbe3bf390b023631d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 United States Government as represented by the Administrator of
# the National Aeronautics and Space Administration. No copyright is claimed in
# the United States under Title 17, U.S. Code. All Other Rights Reserved.
# The Stochastic Reduced Order Models with Python (SROMPy) platform is licensed
# un... | 38.304189 | 80 | 0.565552 |
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
import os
from SROMPy.srom.SROM import SROM
from SROMPy.target.RandomEntity import RandomEntity
class Postprocessor:
"""
Class for comparing an SROM vs the target random vector it is modeling.
Capabilities for plot... | false | true |
08f3c96c89c1886e8ec53be43502f04099fd0b91 | 3,595 | py | Python | build/lib/biosteam/units/_centrifuge_LLE.py | lilanyu/biosteam | b025bbe138bfd0b016af58583792fb4f3ff9186e | [
"MIT"
] | 1 | 2019-11-17T13:14:19.000Z | 2019-11-17T13:14:19.000Z | build/lib/biosteam/units/_centrifuge_LLE.py | lilanyu/biosteam | b025bbe138bfd0b016af58583792fb4f3ff9186e | [
"MIT"
] | null | null | null | build/lib/biosteam/units/_centrifuge_LLE.py | lilanyu/biosteam | b025bbe138bfd0b016af58583792fb4f3ff9186e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 23 21:23:56 2018
@author: yoelr
"""
from .. import Unit, MixedStream
from ._flash import RatioFlash
from ._splitter import Splitter
from .decorators import cost
__all__ = ('Centrifuge_LLE', 'SplitCentrifuge_LLE', 'RatioCentrifuge_LLE')
# electricity kW/(m3/hr) from USDA... | 32.681818 | 156 | 0.623644 | from .. import Unit, MixedStream
from ._flash import RatioFlash
from ._splitter import Splitter
from .decorators import cost
__all__ = ('Centrifuge_LLE', 'SplitCentrifuge_LLE', 'RatioCentrifuge_LLE')
@cost('Flow rate', units='m^3/hr', CE=525.4, cost=28100,
n=0.574, kW=3.66, ub=100, BM=2.03, N='Number of centri... | true | true |
08f3c97e8745ef960efc509b623a3d31c2399de7 | 63,048 | py | Python | Tensile/TensileCreateLibrary.py | daineAMD/Tensile | 31e10427e1612ea7d1b015980aa7e6ef7f1bc8ad | [
"MIT"
] | null | null | null | Tensile/TensileCreateLibrary.py | daineAMD/Tensile | 31e10427e1612ea7d1b015980aa7e6ef7f1bc8ad | [
"MIT"
] | null | null | null | Tensile/TensileCreateLibrary.py | daineAMD/Tensile | 31e10427e1612ea7d1b015980aa7e6ef7f1bc8ad | [
"MIT"
] | null | null | null | ################################################################################
# Copyright 2016-2020 Advanced Micro Devices, Inc. All rights reserved.
#
# 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 t... | 41.948104 | 204 | 0.650266 |
if __name__ == "__main__":
print("This file can no longer be run as a script. Run 'Tensile/bin/TensileCreateLibrary' instead.")
exit(1)
from . import Common
from . import EmbeddedData
from . import LibraryIO
from . import Utils
from .Common import globalParameters, HR, print1, print2, printExit, ensurePath, ... | true | true |
08f3c9ed09b5cad6b84bdd867142f85c7a5101b7 | 1,948 | py | Python | P1_solutions/Problem_2_File_Recursion.py | serglit72/Python_exercises | 7de440a3bdf50c4162bb2df5250487d568942ca8 | [
"Apache-2.0"
] | null | null | null | P1_solutions/Problem_2_File_Recursion.py | serglit72/Python_exercises | 7de440a3bdf50c4162bb2df5250487d568942ca8 | [
"Apache-2.0"
] | null | null | null | P1_solutions/Problem_2_File_Recursion.py | serglit72/Python_exercises | 7de440a3bdf50c4162bb2df5250487d568942ca8 | [
"Apache-2.0"
] | null | null | null | import os
path = "P1_solutions/testdir"
suffix = ".h"
suffix1 = ".c"
suffix2 = ".txt"
suffix3 = ".gitkeep"
def find_files(pth,sffix):
"""
Find all files beneath path with file name suffix.
Note that a path may contain further subdirectories
and those subdirectories may also contain further subdirector... | 33.016949 | 148 | 0.630903 | import os
path = "P1_solutions/testdir"
suffix = ".h"
suffix1 = ".c"
suffix2 = ".txt"
suffix3 = ".gitkeep"
def find_files(pth,sffix):
path = pth
suffix = sffix
found_pathes = []
def find_recursively(path,suffix,found_pathes):
for i in os.listdir(path):
if os.path.isfile(path+"... | true | true |
08f3cc548f03994bdc9f2371030ac00cbd0db1be | 1,851 | py | Python | setup.py | GaborWnuk/image-preview-python | bb2667d8c418f7c95e9027745492408b8d237bce | [
"MIT"
] | 1 | 2016-12-02T12:47:02.000Z | 2016-12-02T12:47:02.000Z | setup.py | GaborWnuk/image-preview-python | bb2667d8c418f7c95e9027745492408b8d237bce | [
"MIT"
] | 5 | 2021-03-18T19:55:37.000Z | 2022-03-11T23:11:39.000Z | setup.py | GaborWnuk/image-preview-python | bb2667d8c418f7c95e9027745492408b8d237bce | [
"MIT"
] | 1 | 2016-10-28T12:37:58.000Z | 2016-10-28T12:37:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py
~~~~~~~~
Image Preview creation python library to create low footprint image previews,
convenient to use as base64 data in your REST / GraphQL API payload
:copyright: (c) 2016 by GaborWnuk.
:license: see LICENSE for more details.
"""
... | 28.921875 | 126 | 0.631551 |
import codecs
import os
import re
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
return codecs.open(os.path.join(here, *parts), 'r').read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"... | true | true |
08f3cc602aac352348901e4557f1ce8f94bf3c27 | 7,208 | py | Python | Evaluation.py | xypan1232/ToxDL | 751cf1cd1352f4b300d68e520b8fdf9edc768c19 | [
"Apache-2.0"
] | 4 | 2020-07-27T08:28:25.000Z | 2021-07-13T04:44:38.000Z | Evaluation.py | xypan1232/ToxDL | 751cf1cd1352f4b300d68e520b8fdf9edc768c19 | [
"Apache-2.0"
] | null | null | null | Evaluation.py | xypan1232/ToxDL | 751cf1cd1352f4b300d68e520b8fdf9edc768c19 | [
"Apache-2.0"
] | 1 | 2020-07-27T08:29:45.000Z | 2020-07-27T08:29:45.000Z | __author__ = 'jasper.zuallaert, Xiaoyong.Pan'
from sklearn.metrics import roc_curve, auc
from sklearn.metrics import average_precision_score, roc_auc_score
from sklearn.metrics import f1_score, precision_recall_curve, matthews_corrcoef
# Evaluates the predictions as written to the a file. The evaluation is done on a pe... | 37.541667 | 157 | 0.612791 | __author__ = 'jasper.zuallaert, Xiaoyong.Pan'
from sklearn.metrics import roc_curve, auc
from sklearn.metrics import average_precision_score, roc_auc_score
from sklearn.metrics import f1_score, precision_recall_curve, matthews_corrcoef
def run_eval_per_protein(file, classN = None):
import numpy as np
mx = 0.0
... | true | true |
08f3cc81debb5e41d1cc636bdb73afe8ac283857 | 2,147 | py | Python | test/optim_param_scheduler_step_test.py | jerryzh168/ClassyVision-1 | 6acfb00a77487a9015803fbaad805330081293a9 | [
"MIT"
] | 1 | 2020-04-13T03:50:26.000Z | 2020-04-13T03:50:26.000Z | test/optim_param_scheduler_step_test.py | pkassotis/ClassyVision | e8704ecaa59a15dbb2f4b0724e85d6e5cb2f704e | [
"MIT"
] | null | null | null | test/optim_param_scheduler_step_test.py | pkassotis/ClassyVision | e8704ecaa59a15dbb2f4b0724e85d6e5cb2f704e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
StepParam... | 27.525641 | 66 | 0.604099 |
import copy
import unittest
from classy_vision.optim.param_scheduler import (
build_param_scheduler,
StepParamScheduler,
)
class TestStepScheduler(unittest.TestCase):
_num_epochs = 12
def _get_valid_config(self):
return {
"name": "step",
"num_epochs": self._num_epoch... | true | true |
08f3ccbfbc68aec00754ae5aad2de94f75bc009d | 1,210 | py | Python | setup.py | eoranged/redis-sentinel-url | 6144a5e40938b6641fe756c867aee3dfc6a3def0 | [
"Apache-2.0"
] | null | null | null | setup.py | eoranged/redis-sentinel-url | 6144a5e40938b6641fe756c867aee3dfc6a3def0 | [
"Apache-2.0"
] | null | null | null | setup.py | eoranged/redis-sentinel-url | 6144a5e40938b6641fe756c867aee3dfc6a3def0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='Redis-Sentinel-Url',
py_modules=['redis_sentinel_url'],
version='1.0.1',
install_requires=['redis>=2.10.3'],
tests_require=['mock', 'pytest'],
test_suite='nose.collector',
description='A factory for redi... | 36.666667 | 84 | 0.621488 | from setuptools import setup
setup(
name='Redis-Sentinel-Url',
py_modules=['redis_sentinel_url'],
version='1.0.1',
install_requires=['redis>=2.10.3'],
tests_require=['mock', 'pytest'],
test_suite='nose.collector',
description='A factory for redis connection that supports using Redis Sentine... | true | true |
08f3cebd8e3809af2a44346dae904fa1d019c44a | 8,689 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/isissegmentlist_28066a67f7cf6594d73c8fed733b33f6.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/isissegmentlist_28066a67f7cf6594d73c8fed733b33f6.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/isissegmentlist_28066a67f7cf6594d73c8fed733b33f6.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 38.277533 | 180 | 0.657843 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class IsisSegmentList(Base):
__slots__ = ()
_SDM_NAME = 'isisSegmentList'
_SDM_ATT_MAP = {
'Count': 'count',
'DescriptiveName': 'descriptiveName',
'Enable': 'enable'... | true | true |
08f3cec6117cc7550ef75a8dd4c037d388e81c3f | 5,412 | py | Python | tools/filters/gff/gff_filter_by_feature_count.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | tools/filters/gff/gff_filter_by_feature_count.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 72 | 2019-06-06T18:52:41.000Z | 2022-02-17T02:53:18.000Z | tools/filters/gff/gff_filter_by_feature_count.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2017-06-12T09:54:31.000Z | 2019-03-15T12:02:39.000Z | #!/usr/bin/env python
"""
Filter a gff file using a criterion based on feature counts for a transcript.
Usage:
%prog input_name output_name feature_name condition
"""
from __future__ import print_function
import sys
from ast import Module, parse, walk
from bx.intervals.io import GenomicInterval
from galaxy.datatype... | 29.57377 | 203 | 0.607724 | from __future__ import print_function
import sys
from ast import Module, parse, walk
from bx.intervals.io import GenomicInterval
from galaxy.datatypes.util.gff_util import GFFReaderWrapper
AST_NODE_TYPE_WHITELIST = [
'Expr', 'Load', 'Str', 'Num', 'BoolOp', 'Compare', 'And', 'Eq', 'NotEq',
'Or', 'GtE', 'LtE'... | true | true |
08f3cf01cde4193c6754facdc64118226fba2716 | 197 | py | Python | philoseismos/__init__.py | sir-dio/old-philoseismos | 4c830971641313abd95693b24965ede261c6824b | [
"MIT"
] | 1 | 2019-10-27T14:03:00.000Z | 2019-10-27T14:03:00.000Z | philoseismos/__init__.py | sir-dio/old-philoseismos | 4c830971641313abd95693b24965ede261c6824b | [
"MIT"
] | null | null | null | philoseismos/__init__.py | sir-dio/old-philoseismos | 4c830971641313abd95693b24965ede261c6824b | [
"MIT"
] | null | null | null | """ philoseismos: with passion for the seismic method.
@author: Ivan Dubrovin
e-mail: dubrovin.io@icloud.com """
from philoseismos.segy import Segy
from philoseismos.coordinates import WayPoints
| 24.625 | 54 | 0.791878 |
from philoseismos.segy import Segy
from philoseismos.coordinates import WayPoints
| true | true |
08f3cfe731f6486f5fb21b8418ff5d1619110365 | 331,201 | py | Python | catboost/pytest/test.py | bakwc/catboost | 28acd0d36dbdf2759890f54a775383912ccfb65c | [
"Apache-2.0"
] | null | null | null | catboost/pytest/test.py | bakwc/catboost | 28acd0d36dbdf2759890f54a775383912ccfb65c | [
"Apache-2.0"
] | null | null | null | catboost/pytest/test.py | bakwc/catboost | 28acd0d36dbdf2759890f54a775383912ccfb65c | [
"Apache-2.0"
] | null | null | null | from itertools import permutations
import yatest.common
from yatest.common import ExecutionTimeoutError, ExecutionError
import pytest
import os
import filecmp
import numpy as np
import pandas as pd
import timeit
import json
import catboost
from catboost_pytest_lib import (
apply_catboost,
compare_evals_with_p... | 37.356305 | 189 | 0.636034 | from itertools import permutations
import yatest.common
from yatest.common import ExecutionTimeoutError, ExecutionError
import pytest
import os
import filecmp
import numpy as np
import pandas as pd
import timeit
import json
import catboost
from catboost_pytest_lib import (
apply_catboost,
compare_evals_with_p... | true | true |
08f3d021d9966012e4a8cf58c353b9353744ecbe | 24,550 | py | Python | data_processing/water_mass_binning.py | DamienIrving/ocean-analysis | 23a6dbf616fb84e6e158e32534ffd394e0df2e3e | [
"MIT"
] | 7 | 2017-06-06T20:20:58.000Z | 2020-02-05T23:28:41.000Z | data_processing/water_mass_binning.py | DamienIrving/ocean-analysis | 23a6dbf616fb84e6e158e32534ffd394e0df2e3e | [
"MIT"
] | 17 | 2017-04-06T04:46:37.000Z | 2021-07-01T00:47:50.000Z | data_processing/water_mass_binning.py | DamienIrving/ocean-analysis | 23a6dbf616fb84e6e158e32534ffd394e0df2e3e | [
"MIT"
] | 4 | 2021-01-19T01:31:40.000Z | 2022-03-15T00:50:11.000Z | """Bin data for ocean water mass analysis."""
import sys
script_dir = sys.path[0]
import os
import pdb
import argparse
import logging
import numpy as np
import iris
import iris.coord_categorisation
import iris.util
import cmdline_provenance as cmdprov
from statsmodels.stats.weightstats import DescrStatsW
repo_dir = ... | 44.154676 | 133 | 0.614949 |
import sys
script_dir = sys.path[0]
import os
import pdb
import argparse
import logging
import numpy as np
import iris
import iris.coord_categorisation
import iris.util
import cmdline_provenance as cmdprov
from statsmodels.stats.weightstats import DescrStatsW
repo_dir = '/'.join(script_dir.split('/')[:-1])
module_di... | true | true |
08f3d0baad069a78a31f0479821b797acdeb6380 | 91 | wsgi | Python | proms.wsgi | fingerecho/proms-4.0 | 6c3a1fd62c9394761664e100fc1dde50fd79dc11 | [
"CC-BY-4.0"
] | 2 | 2019-11-23T03:56:28.000Z | 2019-12-03T15:48:34.000Z | proms.wsgi | fingerecho/proms-4.0 | 6c3a1fd62c9394761664e100fc1dde50fd79dc11 | [
"CC-BY-4.0"
] | null | null | null | proms.wsgi | fingerecho/proms-4.0 | 6c3a1fd62c9394761664e100fc1dde50fd79dc11 | [
"CC-BY-4.0"
] | 3 | 2019-04-12T18:09:35.000Z | 2020-03-14T14:38:45.000Z | import sys
sys.path.insert(0, '/media/sf_work/proms/')
from app import app as application
| 18.2 | 43 | 0.758242 | import sys
sys.path.insert(0, '/media/sf_work/proms/')
from app import app as application
| true | true |
08f3d16c555f62bbd6c0813f6770c2b8aca1e72f | 21,341 | py | Python | setup_app/test_data_loader.py | iromli/jans-setup | 5764661c1046ececd15a3dfc74b5add5f20771cc | [
"MIT"
] | null | null | null | setup_app/test_data_loader.py | iromli/jans-setup | 5764661c1046ececd15a3dfc74b5add5f20771cc | [
"MIT"
] | null | null | null | setup_app/test_data_loader.py | iromli/jans-setup | 5764661c1046ececd15a3dfc74b5add5f20771cc | [
"MIT"
] | null | null | null | import os
import sys
import glob
import time
import json
import socket
import ldap3
import urllib.request
import base64
from setup_app import paths
from setup_app import static
from setup_app.utils import base
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.install... | 55.287565 | 296 | 0.603205 | import os
import sys
import glob
import time
import json
import socket
import ldap3
import urllib.request
import base64
from setup_app import paths
from setup_app import static
from setup_app.utils import base
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.install... | true | true |
08f3d2016a4f7f66ec6e07e50b1fd5f983cbeb1d | 1,273 | py | Python | blender/categories.py | yuanming-hu/elements | e9eccbd61ac45f178ea88b7b405aa2c01549337d | [
"MIT"
] | 265 | 2020-01-09T05:05:26.000Z | 2022-03-31T11:47:32.000Z | blender/categories.py | TREYWANGCQU/taichi_elements | 6f8a03dcf5b407841b88f7b60cca2619e5cb79a5 | [
"MIT"
] | 76 | 2020-01-09T10:58:48.000Z | 2022-03-26T23:51:32.000Z | blender/categories.py | TREYWANGCQU/taichi_elements | 6f8a03dcf5b407841b88f7b60cca2619e5cb79a5 | [
"MIT"
] | 50 | 2020-01-11T11:25:39.000Z | 2022-02-20T14:43:36.000Z | import bpy
import nodeitems_utils
from . import nodes
class ElementsNodeCategory(nodeitems_utils.NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'elements_node_tree'
# get categories data
def get_categs_data():
# node categories data
data = {}
... | 24.480769 | 78 | 0.677141 | import bpy
import nodeitems_utils
from . import nodes
class ElementsNodeCategory(nodeitems_utils.NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'elements_node_tree'
def get_categs_data():
data = {}
for node in nodes.node_classes:
if n... | true | true |
08f3d3d2e66ae39ad8d5e95513d78b3884592c5c | 2,753 | py | Python | mix.py | vivek992/examination_System | 782cf360f7bbfeebcf17cee3e741b55d213d3c54 | [
"MIT"
] | null | null | null | mix.py | vivek992/examination_System | 782cf360f7bbfeebcf17cee3e741b55d213d3c54 | [
"MIT"
] | null | null | null | mix.py | vivek992/examination_System | 782cf360f7bbfeebcf17cee3e741b55d213d3c54 | [
"MIT"
] | null | null | null | from PyQt5 import QtCore, QtGui, QtWidgets
import login_pic
import image
import sys
import student_login
import AD
from PyQt5.QtWidgets import QMessageBox
class A:
def login(self,MainWindow):
def changefont(self) :
if self.radioButton.isChecked() :
MainWindow.close();
... | 39.328571 | 84 | 0.654559 | from PyQt5 import QtCore, QtGui, QtWidgets
import login_pic
import image
import sys
import student_login
import AD
from PyQt5.QtWidgets import QMessageBox
class A:
def login(self,MainWindow):
def changefont(self) :
if self.radioButton.isChecked() :
MainWindow.close();
... | true | true |
08f3d450d6ae8ccabb85dbd5a68c4d155e5ceef0 | 2,621 | py | Python | picotext/models/RNN_LM_deprecated/model.py | phiweger/picotext | d3bb1053f18552835fa7eb15b72f8f9489cb278a | [
"BSD-3-Clause"
] | null | null | null | picotext/models/RNN_LM_deprecated/model.py | phiweger/picotext | d3bb1053f18552835fa7eb15b72f8f9489cb278a | [
"BSD-3-Clause"
] | null | null | null | picotext/models/RNN_LM_deprecated/model.py | phiweger/picotext | d3bb1053f18552835fa7eb15b72f8f9489cb278a | [
"BSD-3-Clause"
] | null | null | null | '''
https://github.com/pytorch/examples/blob/master/word_language_model/model.py
'''
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class RNNModel(nn.Module):
"""Container module with an encoder, a recurrent module, and a decoder."""
def __init__(self, rnn_type, ntoken, ninp... | 37.442857 | 110 | 0.613506 |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class RNNModel(nn.Module):
def __init__(self, rnn_type, ntoken, ninp, nhid, nlayers, dropout=0.5, tie_weights=False):
super(RNNModel, self).__init__()
self.ntoken = ntoken
self.drop = nn.Dropout(dropout)
... | true | true |
08f3d5c6d384aa671677db24caea8178bb88c7d6 | 3,642 | py | Python | AnalysisSite/Play.py | A-Malone/NFL-Analytics | 9950be28101a70e1e7486eb5c85bc14c64e55b73 | [
"MIT"
] | null | null | null | AnalysisSite/Play.py | A-Malone/NFL-Analytics | 9950be28101a70e1e7486eb5c85bc14c64e55b73 | [
"MIT"
] | null | null | null | AnalysisSite/Play.py | A-Malone/NFL-Analytics | 9950be28101a70e1e7486eb5c85bc14c64e55b73 | [
"MIT"
] | null | null | null | import re
class Play:
'''
This class stores data for one NFL regulation play. Data scraped from Sport Data API. Variable Descriptions:
Offense (str) offensive team's name
Defense (str) defensive team's name
start_down (int) Down when play starts
distance_to_first (int) Distance to first down
end_down (... | 34.037383 | 137 | 0.652938 | import re
class Play:
'''
This class stores data for one NFL regulation play. Data scraped from Sport Data API. Variable Descriptions:
Offense (str) offensive team's name
Defense (str) defensive team's name
start_down (int) Down when play starts
distance_to_first (int) Distance to first down
end_down (... | false | true |
08f3d60c262a6a6e29d175ba1d40c233e36e26c5 | 1,893 | py | Python | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/DeleteConsumerChannelRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/DeleteConsumerChannelRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/DeleteConsumerChannelRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"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... | 38.632653 | 80 | 0.76598 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkdts.endpoint import endpoint_data
class DeleteConsumerChannelRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Dts', '2020-01-01', 'DeleteConsumerChannel','dts')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr... | true | true |
08f3d6e872fd061e984de40a56ec27a8d900c62f | 6,646 | py | Python | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_sensors.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_sensors.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_sensors.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | from dagster.core.definitions.job import JobType
from dagster.core.scheduler.job import JobState, JobStatus
from dagster.daemon import get_default_daemon_logger
from dagster.scheduler.sensor import execute_sensor_iteration
from dagster_graphql.test.utils import (
execute_dagster_graphql,
infer_repository_select... | 28.770563 | 99 | 0.65483 | from dagster.core.definitions.job import JobType
from dagster.core.scheduler.job import JobState, JobStatus
from dagster.daemon import get_default_daemon_logger
from dagster.scheduler.sensor import execute_sensor_iteration
from dagster_graphql.test.utils import (
execute_dagster_graphql,
infer_repository_select... | true | true |
08f3d725c9c7f01ffd70e1a8b0403ea7809e2979 | 614 | py | Python | odp/db/models/__init__.py | SAEONData/Open-Data-Platform | cfd2a53e145ec86e187d7c4e1260df17ec6dcb03 | [
"MIT"
] | 2 | 2021-03-04T07:09:47.000Z | 2022-01-02T19:23:41.000Z | odp/db/models/__init__.py | SAEONData/Open-Data-Platform | cfd2a53e145ec86e187d7c4e1260df17ec6dcb03 | [
"MIT"
] | 18 | 2020-09-16T09:16:45.000Z | 2022-01-25T14:17:42.000Z | odp/db/models/__init__.py | SAEONData/Open-Data-Platform | cfd2a53e145ec86e187d7c4e1260df17ec6dcb03 | [
"MIT"
] | 1 | 2021-06-25T13:02:57.000Z | 2021-06-25T13:02:57.000Z | from .catalogue_record import CatalogueRecord
from .client import Client
from .client_scope import ClientScope
from .collection import Collection
from .datacite_record import DataciteRecord
from .oauth2_token import OAuth2Token
from .project import Project
from .project_collection import ProjectCollection
from .provide... | 30.7 | 49 | 0.845277 | from .catalogue_record import CatalogueRecord
from .client import Client
from .client_scope import ClientScope
from .collection import Collection
from .datacite_record import DataciteRecord
from .oauth2_token import OAuth2Token
from .project import Project
from .project_collection import ProjectCollection
from .provide... | true | true |
08f3d72696c94df97797a7f8e90d0646cf82a116 | 16,711 | py | Python | moztrap/view/manage/cases/forms.py | Mozilla-GitHub-Standards/2a028a7541b867ed4d376d6d9a172a6885fe44030078c12a2b9428efabf22ab7 | 63b1c5eacfe35d5b80cc3b07e7c67145531ba343 | [
"BSD-2-Clause"
] | null | null | null | moztrap/view/manage/cases/forms.py | Mozilla-GitHub-Standards/2a028a7541b867ed4d376d6d9a172a6885fe44030078c12a2b9428efabf22ab7 | 63b1c5eacfe35d5b80cc3b07e7c67145531ba343 | [
"BSD-2-Clause"
] | null | null | null | moztrap/view/manage/cases/forms.py | Mozilla-GitHub-Standards/2a028a7541b867ed4d376d6d9a172a6885fe44030078c12a2b9428efabf22ab7 | 63b1c5eacfe35d5b80cc3b07e7c67145531ba343 | [
"BSD-2-Clause"
] | null | null | null | """
Management forms for cases.
"""
from django.core.urlresolvers import reverse
from django.forms.models import inlineformset_factory, BaseInlineFormSet
from django.db.models import Max
import floppyforms.__future__ as forms
from .... import model
from model_utils import Choices
from ...utils import mtforms
class... | 32.575049 | 80 | 0.60164 | from django.core.urlresolvers import reverse
from django.forms.models import inlineformset_factory, BaseInlineFormSet
from django.db.models import Max
import floppyforms.__future__ as forms
from .... import model
from model_utils import Choices
from ...utils import mtforms
class BaseCaseForm(mtforms.NonFieldErrorsC... | true | true |
08f3d7c07fa7f8d20eda8404def99e5b62684447 | 564 | py | Python | test/test_fonttools.py | notnotype/lazy-spider | 32363a1c91fa5b83fbdf3e378ab40662f8f4c4d6 | [
"MIT"
] | 1 | 2020-12-22T01:29:22.000Z | 2020-12-22T01:29:22.000Z | test/test_fonttools.py | notnotype/lazy-spider | 32363a1c91fa5b83fbdf3e378ab40662f8f4c4d6 | [
"MIT"
] | 1 | 2021-02-25T07:50:33.000Z | 2021-02-25T07:50:33.000Z | test/test_fonttools.py | notnotype/lazy-spider | 32363a1c91fa5b83fbdf3e378ab40662f8f4c4d6 | [
"MIT"
] | null | null | null | from configparser import ConfigParser
from lazy_spider.parse.fonttools import BaiduORCFontMapping
config = ConfigParser()
config.read('./config.ini')
def test_update():
app_id = config.get('BaiduORC', 'AppID')
api_key = config.get('BaiduORC', 'APIKey')
secret_key = config.get('BaiduORC', 'SecretKey')
... | 28.2 | 66 | 0.710993 | from configparser import ConfigParser
from lazy_spider.parse.fonttools import BaiduORCFontMapping
config = ConfigParser()
config.read('./config.ini')
def test_update():
app_id = config.get('BaiduORC', 'AppID')
api_key = config.get('BaiduORC', 'APIKey')
secret_key = config.get('BaiduORC', 'SecretKey')
... | true | true |
08f3d9765a9ea31f3f96affb6a03ef82a67b59f3 | 20,581 | py | Python | pytests/fts/es_base.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | pytests/fts/es_base.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | pytests/fts/es_base.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | import httplib2
import json
from tasks.taskmanager import TaskManager
from tasks.task import *
from remote.remote_util import RemoteMachineShellConnection, RemoteUtilHelper
import time
import ast
class BLEVE:
STOPWORDS = ['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves',
'you', 'your', ... | 38.613508 | 98 | 0.463486 | import httplib2
import json
from tasks.taskmanager import TaskManager
from tasks.task import *
from remote.remote_util import RemoteMachineShellConnection, RemoteUtilHelper
import time
import ast
class BLEVE:
STOPWORDS = ['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves',
'you', 'your', ... | true | true |
08f3da9eb5a325aafc07cf344f33d86de2804f11 | 6,845 | py | Python | Cython/Compiler/CythonScope.py | fried/cython | ab03eb164c9bac4c27b7e0082dbfadaa2eb8b8e6 | [
"Apache-2.0"
] | 2 | 2022-02-20T09:40:59.000Z | 2022-03-28T06:58:26.000Z | Cython/Compiler/CythonScope.py | fried/cython | ab03eb164c9bac4c27b7e0082dbfadaa2eb8b8e6 | [
"Apache-2.0"
] | null | null | null | Cython/Compiler/CythonScope.py | fried/cython | ab03eb164c9bac4c27b7e0082dbfadaa2eb8b8e6 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from .Symtab import ModuleScope
from .PyrexTypes import *
from .UtilityCode import CythonUtilityCode
from .Errors import error
from .Scanning import StringSourceDescriptor
from . import MemoryView
from .StringEncoding import EncodedString
class CythonScope(ModuleScope):
is_... | 37.60989 | 92 | 0.63214 | from __future__ import absolute_import
from .Symtab import ModuleScope
from .PyrexTypes import *
from .UtilityCode import CythonUtilityCode
from .Errors import error
from .Scanning import StringSourceDescriptor
from . import MemoryView
from .StringEncoding import EncodedString
class CythonScope(ModuleScope):
is_... | true | true |
08f3dc0a151744e639ea885e3ce8c8f8744767db | 11,965 | py | Python | nwg_panel/modules/sway_taskbar.py | JDPDO/nwg-panel | f5622e1a35e63840fb1826a2ef35a8edb9dfcbc2 | [
"MIT"
] | null | null | null | nwg_panel/modules/sway_taskbar.py | JDPDO/nwg-panel | f5622e1a35e63840fb1826a2ef35a8edb9dfcbc2 | [
"MIT"
] | null | null | null | nwg_panel/modules/sway_taskbar.py | JDPDO/nwg-panel | f5622e1a35e63840fb1826a2ef35a8edb9dfcbc2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
from gi.repository import Gtk, Gdk, GdkPixbuf
from nwg_panel.tools import check_key, get_icon_name, update_image, load_autotiling, get_config_dir, eprint
import nwg_panel.common
class SwayTaskbar(Gtk.Box):
def __init__(self, settings, i3, position, display_name="", icons_path=""... | 41.258621 | 140 | 0.572336 |
import os
from gi.repository import Gtk, Gdk, GdkPixbuf
from nwg_panel.tools import check_key, get_icon_name, update_image, load_autotiling, get_config_dir, eprint
import nwg_panel.common
class SwayTaskbar(Gtk.Box):
def __init__(self, settings, i3, position, display_name="", icons_path=""):
self.positio... | true | true |
08f3dc61dfbf90d9d28e284a65c45e9a97894992 | 4,226 | py | Python | tests/test_neuron.py | dimdamop/single-neuron | fa649bcd2c7cc68b46c87e63e3c5869f772fecdf | [
"MIT"
] | null | null | null | tests/test_neuron.py | dimdamop/single-neuron | fa649bcd2c7cc68b46c87e63e3c5869f772fecdf | [
"MIT"
] | 2 | 2019-02-21T19:16:02.000Z | 2019-02-21T20:12:33.000Z | tests/test_neuron.py | dimdamop/single-neuron | fa649bcd2c7cc68b46c87e63e3c5869f772fecdf | [
"MIT"
] | null | null | null | # Author: Dimitrios Damopoulos
# MIT license (see LICENCE.txt in the top-level folder)
import unittest
import os
from tempfile import mkstemp
from os.path import exists
import numpy as np
from numpy import random
import string
from random import choice as std_choice
from single_neuron import neuron as neuron
csv... | 33.015625 | 81 | 0.551585 |
import unittest
import os
from tempfile import mkstemp
from os.path import exists
import numpy as np
from numpy import random
import string
from random import choice as std_choice
from single_neuron import neuron as neuron
csv_files_to_check_n = 100
max_column_header_len = 30
max_features_n = 100
max_samples_n =... | true | true |
08f3dd003b93d1f6ae20a6c74188577066108086 | 5,102 | py | Python | tests/integ/test_factorization_machines.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:18:29.000Z | 2021-12-10T16:18:29.000Z | tests/integ/test_factorization_machines.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | tests/integ/test_factorization_machines.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 34.945205 | 91 | 0.667189 | from __future__ import absolute_import
import time
import pytest
from sagemaker import FactorizationMachines, FactorizationMachinesModel
from sagemaker.serverless import ServerlessInferenceConfig
from sagemaker.utils import unique_name_from_base
from tests.integ import datasets, TRAINING_DEFAULT_TIMEOUT_MINUTES
from... | true | true |
08f3dd44cf8dac48e17dae59f202f5d75247d12c | 472 | py | Python | dynamic_programming/python/LIS.py | JD235/algorithms | 71346a498720dc3da064b3e61de0b369cf7eb76a | [
"MIT"
] | 44 | 2017-12-11T11:13:07.000Z | 2022-03-15T02:59:43.000Z | dynamic_programming/python/LIS.py | JD235/algorithms | 71346a498720dc3da064b3e61de0b369cf7eb76a | [
"MIT"
] | 23 | 2018-10-06T06:17:21.000Z | 2021-03-08T17:13:53.000Z | dynamic_programming/python/LIS.py | JD235/algorithms | 71346a498720dc3da064b3e61de0b369cf7eb76a | [
"MIT"
] | 113 | 2017-12-12T06:46:04.000Z | 2021-11-15T17:33:11.000Z | #Longest increasing subsequence/
#implementacao bottom-up
def LIS():
global array
global dp
for i in xrange(1, tamanho):
for j in xrange(i):
if array[j] < array[i]:
if dp[i] < dp[j] + 1:
dp[i] = dp[j] + 1
def maiorSequencia():
global dp
maior = 0
for e in dp:
mai... | 12.102564 | 37 | 0.586864 |
def LIS():
global array
global dp
for i in xrange(1, tamanho):
for j in xrange(i):
if array[j] < array[i]:
if dp[i] < dp[j] + 1:
dp[i] = dp[j] + 1
def maiorSequencia():
global dp
maior = 0
for e in dp:
maior = max(e, maior)
return maior
tamanho = int(raw_inp... | false | true |
08f3dd902575fce741828db8762150fec0cc6d93 | 1,331 | py | Python | main.py | gigglearrows/anniesbot | fb9fb92b827c6c78efebb415f10d015216fb3ba2 | [
"MIT"
] | null | null | null | main.py | gigglearrows/anniesbot | fb9fb92b827c6c78efebb415f10d015216fb3ba2 | [
"MIT"
] | 1 | 2015-12-24T02:01:21.000Z | 2018-02-19T01:08:16.000Z | main.py | gigglearrows/anniesbot | fb9fb92b827c6c78efebb415f10d015216fb3ba2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import signal
import logging
try:
basestring
except NameError:
basestring = str
os.chdir(os.path.dirname(os.path.realpath(__file__)))
log = logging.getLogger('pajbot')
from pajbot.bot import Bot
def run(args):
from pajbot.tbutil import load_config
confi... | 20.476923 | 123 | 0.655147 |
import os
import sys
import signal
import logging
try:
basestring
except NameError:
basestring = str
os.chdir(os.path.dirname(os.path.realpath(__file__)))
log = logging.getLogger('pajbot')
from pajbot.bot import Bot
def run(args):
from pajbot.tbutil import load_config
config = load_config(args.co... | true | true |
08f3ddbd5f4f7d32d2edc62ddf742c2e009a6ccd | 11,228 | py | Python | zynq-old/test/test_data.py | chiro2001/zynqs | a9340a7d0e1376c991a7c21680e93c31a2acab1e | [
"MIT"
] | null | null | null | zynq-old/test/test_data.py | chiro2001/zynqs | a9340a7d0e1376c991a7c21680e93c31a2acab1e | [
"MIT"
] | null | null | null | zynq-old/test/test_data.py | chiro2001/zynqs | a9340a7d0e1376c991a7c21680e93c31a2acab1e | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
dat = [
16384, 8612, -1337, 2582, 10328, 4163, -8996, -9664, -540, -1274, -12721, -15195, -3892, 2413, -4918, -9055,
1598, 12103, 7531, -477, 4968, 15313, 11869, -469, ... | 145.818182 | 176 | 0.388582 | import matplotlib.pyplot as plt
import numpy as np
dat = [
16384, 8612, -1337, 2582, 10328, 4163, -8996, -9664, -540, -1274, -12721, -15195, -3892, 2413, -4918, -9055,
1598, 12103, 7531, -477, 4968, 15313, 11869, -469, ... | true | true |
08f3de324738121f3cdd3bb402abb4e86f5dd7e9 | 46,412 | py | Python | digits/model/images/generic/test_views.py | gheinrich/DIGITS-GAN | 63d388095b4f2a2aa6f3b0f6988e01b2c78c3877 | [
"BSD-3-Clause"
] | 111 | 2017-04-21T06:03:04.000Z | 2021-04-26T06:36:54.000Z | digits/model/images/generic/test_views.py | gheinrich/DIGITS-GAN | 63d388095b4f2a2aa6f3b0f6988e01b2c78c3877 | [
"BSD-3-Clause"
] | 6 | 2017-05-15T22:02:49.000Z | 2018-03-16T10:25:26.000Z | digits/model/images/generic/test_views.py | gheinrich/DIGITS-GAN | 63d388095b4f2a2aa6f3b0f6988e01b2c78c3877 | [
"BSD-3-Clause"
] | 40 | 2017-04-21T07:04:16.000Z | 2019-11-14T14:20:32.000Z | # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import itertools
import json
import numpy as np
import os
import PIL.Image
import tempfile
import time
import unittest
# Find the best implementation available
try:
from cStringIO import StringIO
except Imp... | 34.051357 | 120 | 0.629837 | from __future__ import absolute_import
import itertools
import json
import numpy as np
import os
import PIL.Image
import tempfile
import time
import unittest
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from bs4 import BeautifulSoup
from digits import extensions
from... | false | true |
08f3e02dfd125c6056727a6dcb5ddbd3902211da | 1,044 | py | Python | wavvy/data.py | john-patterson/wavvy | 5bbd330bd498c06d953c041930bd4e4b2cab67e9 | [
"MIT"
] | null | null | null | wavvy/data.py | john-patterson/wavvy | 5bbd330bd498c06d953c041930bd4e4b2cab67e9 | [
"MIT"
] | null | null | null | wavvy/data.py | john-patterson/wavvy | 5bbd330bd498c06d953c041930bd4e4b2cab67e9 | [
"MIT"
] | null | null | null | from wavvy import thermostat, app, weather, user
from wavvy.datalayer import adjust, get_current_setting
__all__ = ['current_room_temp', 'adjust_temp', 'current_outside_temp']
def kelvin_to_fahrenheit(k):
return (9 / 5) * (k - 273) + 32
def fahrenheit_to_celsius(f):
return (5 / 9) * (f - 32)
def celsius_... | 23.727273 | 70 | 0.70977 | from wavvy import thermostat, app, weather, user
from wavvy.datalayer import adjust, get_current_setting
__all__ = ['current_room_temp', 'adjust_temp', 'current_outside_temp']
def kelvin_to_fahrenheit(k):
return (9 / 5) * (k - 273) + 32
def fahrenheit_to_celsius(f):
return (5 / 9) * (f - 32)
def celsius_... | true | true |
08f3e18880a918e036a8f36a76200cb5d605dbf0 | 7,497 | py | Python | flask/lib/python3.4/site-packages/pip/commands/wheel.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | 10,056 | 2017-04-15T14:15:40.000Z | 2022-03-31T15:29:57.000Z | node_modules/gitbook-plugin-sitemap/node_modules/sitemap/env/lib/python2.7/site-packages/pip/commands/wheel.py | rootsongjc/handbook-template | 12fad305ea52030644c787d7f4ac4836177616b5 | [
"Apache-2.0"
] | 247 | 2017-04-14T13:37:59.000Z | 2022-03-31T11:16:33.000Z | node_modules/gitbook-plugin-sitemap/node_modules/sitemap/env/lib/python2.7/site-packages/pip/commands/wheel.py | rootsongjc/handbook-template | 12fad305ea52030644c787d7f4ac4836177616b5 | [
"Apache-2.0"
] | 2,892 | 2017-04-14T10:43:20.000Z | 2022-03-31T14:16:15.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sys
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirement... | 37.485 | 134 | 0.578631 | from __future__ import absolute_import
import os
import sys
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.util import n... | true | true |
08f3e260372896458d7cee6b7319d3157706280c | 1,003 | py | Python | ideotype/sql_index.py | jennhsiao/ideotype | 26406ddc66e091e918ceff212638a02e9cfbdb46 | [
"MIT"
] | 2 | 2021-01-08T03:21:48.000Z | 2021-04-08T00:21:32.000Z | ideotype/sql_index.py | jennhsiao/ideotype | 26406ddc66e091e918ceff212638a02e9cfbdb46 | [
"MIT"
] | null | null | null | ideotype/sql_index.py | jennhsiao/ideotype | 26406ddc66e091e918ceff212638a02e9cfbdb46 | [
"MIT"
] | null | null | null | """Make add-hoc indexes for DB."""
from sqlalchemy import create_engine
from sqlalchemy import Index
from ideotype.sql_declarative import Sims
def make_index(fpath_db):
"""
Create index for tables that already exist.
Add additional indexes other than pre-determined primary keys
to speed up queries.
... | 25.075 | 65 | 0.674975 | from sqlalchemy import create_engine
from sqlalchemy import Index
from ideotype.sql_declarative import Sims
def make_index(fpath_db):
engine = create_engine('sqlite:///' + fpath_db)
id_year = Index('id_year', Sims.year)
print('>> making id_year')
id_year.create(engine)
id_site = Index('id_site',... | true | true |
08f3e31f3910fa2d46f1b9ed2365a97b01c01340 | 3,550 | py | Python | ToDO/mnist_loader.py | NAM-IL/DeepLearningResearch | b4f35520df7ef7980132758c407356fca20c59f2 | [
"MIT"
] | null | null | null | ToDO/mnist_loader.py | NAM-IL/DeepLearningResearch | b4f35520df7ef7980132758c407356fca20c59f2 | [
"MIT"
] | null | null | null | ToDO/mnist_loader.py | NAM-IL/DeepLearningResearch | b4f35520df7ef7980132758c407356fca20c59f2 | [
"MIT"
] | null | null | null | """
mnist_loader
~~~~~~~~~~~~
A library to load the MNIST image data. For details of the data
structures that are returned, see the doc strings for ``load_data``
and ``load_data_wrapper``. In practice, ``load_data_wrapper`` is the
function usually called by our neural network code.
"""
#### Libraries
# S... | 40.804598 | 82 | 0.680563 |
import pickle
import gzip
import numpy as np
def load_data():
f = gzip.open('./data/mnist.pkl.gz', 'rb')
training_data, validation_data, test_data = pickle.load(f, encoding='latin1')
f.close()
return (training_data, validation_data, test_data)
def load_data_wrapper():
tr_d, va_d, te... | true | true |
08f3e3e58c50a5f2be4df693c60e2aea09d51121 | 7,313 | py | Python | authlib/jose/rfc7516/jwe.py | jonathanunderwood/authlib | 3834a2a80876a87cdaab4240d77185179970c3ab | [
"BSD-3-Clause"
] | 1 | 2021-12-09T07:11:05.000Z | 2021-12-09T07:11:05.000Z | authlib/jose/rfc7516/jwe.py | jonathanunderwood/authlib | 3834a2a80876a87cdaab4240d77185179970c3ab | [
"BSD-3-Clause"
] | null | null | null | authlib/jose/rfc7516/jwe.py | jonathanunderwood/authlib | 3834a2a80876a87cdaab4240d77185179970c3ab | [
"BSD-3-Clause"
] | 2 | 2021-05-24T20:34:12.000Z | 2022-03-26T07:46:17.000Z | from authlib.common.encoding import (
to_bytes, urlsafe_b64encode, json_b64encode
)
from authlib.jose.util import (
extract_header,
extract_segment,
prepare_algorithm_key,
)
from authlib.jose.errors import (
DecodeError,
MissingAlgorithmError,
UnsupportedAlgorithmError,
MissingEncryption... | 36.565 | 78 | 0.638726 | from authlib.common.encoding import (
to_bytes, urlsafe_b64encode, json_b64encode
)
from authlib.jose.util import (
extract_header,
extract_segment,
prepare_algorithm_key,
)
from authlib.jose.errors import (
DecodeError,
MissingAlgorithmError,
UnsupportedAlgorithmError,
MissingEncryption... | true | true |
08f3e489772cd103a08363c76292f739a4e1bdbf | 1,468 | py | Python | bin/cloze_task_example.py | XuhuiZhou/kb | 4c37bbccd6c871828aceb24b342841825d86df14 | [
"Apache-2.0"
] | 295 | 2019-11-04T16:01:03.000Z | 2022-03-31T15:34:53.000Z | bin/cloze_task_example.py | XuhuiZhou/kb | 4c37bbccd6c871828aceb24b342841825d86df14 | [
"Apache-2.0"
] | 30 | 2019-11-14T03:15:05.000Z | 2022-03-04T17:34:59.000Z | bin/cloze_task_example.py | XuhuiZhou/kb | 4c37bbccd6c871828aceb24b342841825d86df14 | [
"Apache-2.0"
] | 45 | 2019-11-08T06:14:01.000Z | 2022-03-14T06:16:37.000Z |
from kb.include_all import ModelArchiveFromParams
from kb.knowbert_utils import KnowBertBatchifier
from allennlp.common import Params
import torch
if __name__ == '__main__':
archive_file = 'https://allennlp.s3-us-west-2.amazonaws.com/knowbert/models/knowbert_wiki_wordnet_model.tar.gz'
params = Params({"archi... | 39.675676 | 165 | 0.735014 |
from kb.include_all import ModelArchiveFromParams
from kb.knowbert_utils import KnowBertBatchifier
from allennlp.common import Params
import torch
if __name__ == '__main__':
archive_file = 'https://allennlp.s3-us-west-2.amazonaws.com/knowbert/models/knowbert_wiki_wordnet_model.tar.gz'
params = Params({"archi... | true | true |
08f3e49c1d1abe002816822a23265589df0515d6 | 1,377 | py | Python | Controllers/UI.py | DeerChen/LRCPlayer | 5c6edbac62eca64d880611ae0270aaaf91d4fdbc | [
"MIT"
] | null | null | null | Controllers/UI.py | DeerChen/LRCPlayer | 5c6edbac62eca64d880611ae0270aaaf91d4fdbc | [
"MIT"
] | null | null | null | Controllers/UI.py | DeerChen/LRCPlayer | 5c6edbac62eca64d880611ae0270aaaf91d4fdbc | [
"MIT"
] | null | null | null | '''
Description:
Author: Senkita
Date: 2021-04-16 18:53:58
LastEditors: Senkita
LastEditTime: 2021-04-16 20:48:53
'''
from pathlib import Path
from typing import List
from .Player import Player
import os
from random import shuffle
class UI:
def __init__(self) -> None:
self.lrc_dir = Path(... | 25.981132 | 69 | 0.535948 | from pathlib import Path
from typing import List
from .Player import Player
import os
from random import shuffle
class UI:
def __init__(self) -> None:
self.lrc_dir = Path('./lrc')
self.lrc_files = self.__list_lrc_files()
def __list_lrc_files(self) -> List[str]:
lrc_files ... | true | true |
08f3e505a11ae5014e9036e8fae53a38f4c23adb | 40 | py | Python | data/__init__.py | silenceliang/Cascading-agents-hybridSum | 6c127df51bd8cc926878f62ebdb66bc1042bb58c | [
"MIT"
] | 1 | 2020-02-23T15:38:18.000Z | 2020-02-23T15:38:18.000Z | data/__init__.py | silenceliang/CascadingAgentsHybridSum | 6c127df51bd8cc926878f62ebdb66bc1042bb58c | [
"MIT"
] | null | null | null | data/__init__.py | silenceliang/CascadingAgentsHybridSum | 6c127df51bd8cc926878f62ebdb66bc1042bb58c | [
"MIT"
] | null | null | null | from batcher import *
from data import * | 20 | 21 | 0.775 | from batcher import *
from data import * | true | true |
08f3e5a998c9401a9d8211bf0ab509442877221a | 8,736 | py | Python | intersight/model/bios_token_settings_list_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/bios_token_settings_list_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/bios_token_settings_list_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 49.636364 | 1,678 | 0.639881 |
import re import sys
from intersight.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_... | true | true |
08f3e5ff1d7031a3e95dce6b3875ad03e095a97a | 28,021 | py | Python | _vendor/packaging/specifiers.py | IncoCura/Shapely | 5d18af283e485a427d121e05fbf8e9968db4a569 | [
"BSD-3-Clause"
] | 1 | 2019-07-02T03:59:07.000Z | 2019-07-02T03:59:07.000Z | _vendor/packaging/specifiers.py | AtrCheema/Shapely | 2c39f871341ddd82c24ec42f1ac1c5a16663729b | [
"BSD-3-Clause"
] | 1 | 2021-02-23T23:32:17.000Z | 2021-02-23T23:32:17.000Z | _vendor/packaging/specifiers.py | AtrCheema/Shapely | 2c39f871341ddd82c24ec42f1ac1c5a16663729b | [
"BSD-3-Clause"
] | 1 | 2020-05-22T02:52:54.000Z | 2020-05-22T02:52:54.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | 36.156129 | 79 | 0.574712 | from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat import string_types, with_metaclass
from .version import Version, LegacyVersion, parse
class InvalidSpecifier(ValueError):
class BaseSpecifier(with_metaclass(abc.ABCMeta, object)):... | true | true |
08f3e6007e9c80d68eec36a77f0cd6abe0d2b877 | 548 | py | Python | ScratchPad_PyDev/com.neustar.programming.contest/three/MyMainPyDev2.py | rsins/Scratchpad-Java | ed5593a1fa9afc62ef8d567f928001faae163880 | [
"Apache-2.0"
] | null | null | null | ScratchPad_PyDev/com.neustar.programming.contest/three/MyMainPyDev2.py | rsins/Scratchpad-Java | ed5593a1fa9afc62ef8d567f928001faae163880 | [
"Apache-2.0"
] | null | null | null | ScratchPad_PyDev/com.neustar.programming.contest/three/MyMainPyDev2.py | rsins/Scratchpad-Java | ed5593a1fa9afc62ef8d567f928001faae163880 | [
"Apache-2.0"
] | null | null | null |
totalDays = 0
totalDistance = 0
lastDayRun = 0
seventhDay = 0
while (totalDistance < (110 * 1000 * 1000 + 54 * 1000 + 30 + 2)):
totalDays = totalDays + 1
curDayRun = lastDayRun + 1
seventhDay = seventhDay + 1
totalDaysStr = str(totalDays)
if (seventhDay == 7):
curDayRun = 0
... | 24.909091 | 72 | 0.600365 |
totalDays = 0
totalDistance = 0
lastDayRun = 0
seventhDay = 0
while (totalDistance < (110 * 1000 * 1000 + 54 * 1000 + 30 + 2)):
totalDays = totalDays + 1
curDayRun = lastDayRun + 1
seventhDay = seventhDay + 1
totalDaysStr = str(totalDays)
if (seventhDay == 7):
curDayRun = 0
... | true | true |
08f3e6717cd4a30d94ee7a9d580b52d07d453093 | 6,009 | py | Python | app/main/views.py | Otybrian/blogpost | 518599019e11cd7ee11e01470c4d51dfb4583274 | [
"MIT"
] | null | null | null | app/main/views.py | Otybrian/blogpost | 518599019e11cd7ee11e01470c4d51dfb4583274 | [
"MIT"
] | null | null | null | app/main/views.py | Otybrian/blogpost | 518599019e11cd7ee11e01470c4d51dfb4583274 | [
"MIT"
] | null | null | null | from ..requests import get_quotes
from app.main.forms import UpdateProfile, PostForm, CommentForm, UploadForm
from flask import render_template,abort,redirect,flash,url_for,Blueprint,request
from . import main
from .. import db, create_app
import secrets
import os
from flask_login import login_user,logout_user,login_re... | 31.460733 | 122 | 0.680646 | from ..requests import get_quotes
from app.main.forms import UpdateProfile, PostForm, CommentForm, UploadForm
from flask import render_template,abort,redirect,flash,url_for,Blueprint,request
from . import main
from .. import db, create_app
import secrets
import os
from flask_login import login_user,logout_user,login_re... | true | true |
08f3e81cf5a23a9f56fdcd3f05c76af3235f6fb5 | 19,400 | py | Python | tests/scanner/audit/external_project_access_engine_test.py | daniel-infosec/forseti-security | 59c2262db4c6ace1289a2ebdbcc6131aca0f0d65 | [
"Apache-2.0"
] | null | null | null | tests/scanner/audit/external_project_access_engine_test.py | daniel-infosec/forseti-security | 59c2262db4c6ace1289a2ebdbcc6131aca0f0d65 | [
"Apache-2.0"
] | null | null | null | tests/scanner/audit/external_project_access_engine_test.py | daniel-infosec/forseti-security | 59c2262db4c6ace1289a2ebdbcc6131aca0f0d65 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 44.907407 | 108 | 0.622577 |
import unittest
import mock
from google.cloud.forseti.common.gcp_type.folder import Folder
from google.cloud.forseti.common.gcp_type.organization import Organization
from google.cloud.forseti.common.gcp_type.project import Project
from google.cloud.forseti.scanner.audit import external_project_access_rules_engine as ... | true | true |
08f3e881f6c35ac8d6a2cefb9fe7ff1fd68db930 | 4,527 | py | Python | ledger/basket/models.py | IndrayaniJadhav/ledger | 54e2d844f3efd923066ec9d7e5ee8fa7faad3e77 | [
"Apache-2.0"
] | null | null | null | ledger/basket/models.py | IndrayaniJadhav/ledger | 54e2d844f3efd923066ec9d7e5ee8fa7faad3e77 | [
"Apache-2.0"
] | 1 | 2018-09-20T03:17:03.000Z | 2018-09-20T03:17:03.000Z | ledger/basket/models.py | IndrayaniJadhav/ledger | 54e2d844f3efd923066ec9d7e5ee8fa7faad3e77 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket.abstract_models import AbstractBasket as CoreAbstractBasket, AbstractLine as CoreAbstractLine
from oscar.models.fields.slugfield import SlugField
from... | 39.365217 | 162 | 0.656285 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket.abstract_models import AbstractBasket as CoreAbstractBasket, AbstractLine as CoreAbstractLine
from oscar.models.fields.slugfield import SlugField
from... | true | true |
08f3e8f99f400dc62f614ed86d1b29d86ae16d3a | 4,963 | py | Python | api/graphqlutils.py | dariosky/flatdario | 57832d13d72b7bdf8d92c2b5d5986812aab3db03 | [
"Apache-2.0"
] | 1 | 2018-03-19T11:16:03.000Z | 2018-03-19T11:16:03.000Z | api/graphqlutils.py | dariosky/flatdario | 57832d13d72b7bdf8d92c2b5d5986812aab3db03 | [
"Apache-2.0"
] | 11 | 2018-06-30T12:04:39.000Z | 2022-03-08T22:08:46.000Z | api/graphqlutils.py | dariosky/flatdario | 57832d13d72b7bdf8d92c2b5d5986812aab3db03 | [
"Apache-2.0"
] | null | null | null | import logging
import graphene
import sqlalchemy
from graphene import NonNull, Argument, List
from graphene_sqlalchemy import SQLAlchemyConnectionField
from graphql import ResolveInfo
from graphql.language.ast import Variable
from sqlalchemy import inspect
logger = logging.getLogger(__name__)
def sort_enum_for(cls)... | 35.45 | 98 | 0.619786 | import logging
import graphene
import sqlalchemy
from graphene import NonNull, Argument, List
from graphene_sqlalchemy import SQLAlchemyConnectionField
from graphql import ResolveInfo
from graphql.language.ast import Variable
from sqlalchemy import inspect
logger = logging.getLogger(__name__)
def sort_enum_for(cls)... | true | true |
08f3ea533d896e96ba1caa3c27e73d106d1e7652 | 943 | py | Python | native_login/token_storage/token_storage.py | lliming/native-login | fd729c5189c67e401d355a54de769089b55f6939 | [
"Apache-2.0"
] | null | null | null | native_login/token_storage/token_storage.py | lliming/native-login | fd729c5189c67e401d355a54de769089b55f6939 | [
"Apache-2.0"
] | null | null | null | native_login/token_storage/token_storage.py | lliming/native-login | fd729c5189c67e401d355a54de769089b55f6939 | [
"Apache-2.0"
] | null | null | null | import os
class TokenStorage(object):
DEFAULT_FILENAME = os.path.expanduser('~/.globus-native-apps.cfg')
TOKEN_KEYS = [
"scope",
"access_token",
"refresh_token",
"token_type",
"expires_at_seconds",
"resource_server",
]
REQUIRED_KEYS = ["scope", "access_... | 23.575 | 70 | 0.626723 | import os
class TokenStorage(object):
DEFAULT_FILENAME = os.path.expanduser('~/.globus-native-apps.cfg')
TOKEN_KEYS = [
"scope",
"access_token",
"refresh_token",
"token_type",
"expires_at_seconds",
"resource_server",
]
REQUIRED_KEYS = ["scope", "access_... | true | true |
08f3eae9e91dde600e2781b52aa83909fff87587 | 1,560 | py | Python | prob_h.py | ShinjiKatoA16/icpc2017ucsy | de1954620036e8025b7b4c1b469e6b8c57af212e | [
"MIT"
] | null | null | null | prob_h.py | ShinjiKatoA16/icpc2017ucsy | de1954620036e8025b7b4c1b469e6b8c57af212e | [
"MIT"
] | null | null | null | prob_h.py | ShinjiKatoA16/icpc2017ucsy | de1954620036e8025b7b4c1b469e6b8c57af212e | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
2017 ICPC at UCSY
Problem-H: Sum Square
'''
import sys
class TestCase():
pass
def parse_tc(tc):
'''
Input: Test Case
Update:
Return: None
'''
x = list(map(int,tc.infile.readline().split()))
tc.dataset = x[0]
tc... | 16.956522 | 69 | 0.501923 |
import sys
class TestCase():
pass
def parse_tc(tc):
x = list(map(int,tc.infile.readline().split()))
tc.dataset = x[0]
tc.max_num = x[1]
tc.base = x[2]
tc.a0 = x[3]
return
def ssd(b, n):
val = 0
while n > 0:
val += (n % b) ** 2
n //= b
return val
def... | true | true |
08f3eb5e0d53ad4bb9b5cf93290d6da5ac8f15da | 867 | py | Python | squawkbus/io/data_packet.py | SquawkBus/SquawkBus-python | 2f342a854e48c930232ff39b899ae841656b43b2 | [
"Apache-2.0"
] | null | null | null | squawkbus/io/data_packet.py | SquawkBus/SquawkBus-python | 2f342a854e48c930232ff39b899ae841656b43b2 | [
"Apache-2.0"
] | null | null | null | squawkbus/io/data_packet.py | SquawkBus/SquawkBus-python | 2f342a854e48c930232ff39b899ae841656b43b2 | [
"Apache-2.0"
] | null | null | null | """DataPacket"""
from typing import Optional, Set
class DataPacket:
"""A data packet"""
def __init__(
self,
entitlements: Optional[Set[int]],
data: Optional[bytes]
) -> None:
"""Initialise a data packet.
Args:
entitlements (Optional[Set[in... | 24.771429 | 79 | 0.568627 |
from typing import Optional, Set
class DataPacket:
def __init__(
self,
entitlements: Optional[Set[int]],
data: Optional[bytes]
) -> None:
self.entitlements = entitlements
self.data = data
def __str__(self) -> str:
return f'entitlements={self.e... | true | true |
08f3eb64cbce4528d103f8afcbed33dc25ddd15d | 241,739 | py | Python | languages/languages_long.py | Edi31/django-language-field | a54b010a4ff9210655a1f8629a9624e8263fa12e | [
"MIT"
] | null | null | null | languages/languages_long.py | Edi31/django-language-field | a54b010a4ff9210655a1f8629a9624e8263fa12e | [
"MIT"
] | null | null | null | languages/languages_long.py | Edi31/django-language-field | a54b010a4ff9210655a1f8629a9624e8263fa12e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
LANGUAGES = (
("fr", _(u"French")),
("en", _(u"English")),
("de", _(u"German")),
("es", _(u"Spanish")),
("aa", _(u"Afar")),
("ab", _(u"Abkhazian")),
("ae", _(u"Avestan")),
("af", _(u"Afrikaans")),
("ak",... | 29.61399 | 61 | 0.447143 | from django.utils.translation import ugettext_lazy as _
LANGUAGES = (
("fr", _(u"French")),
("en", _(u"English")),
("de", _(u"German")),
("es", _(u"Spanish")),
("aa", _(u"Afar")),
("ab", _(u"Abkhazian")),
("ae", _(u"Avestan")),
("af", _(u"Afrikaans")),
("ak", _(u"Akan")),
("am",... | true | true |
08f3ed05a5f0c6b325995b8dc32862b04b3173e6 | 860 | py | Python | model-optimizer/extensions/front/caffe/reshape.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/extensions/front/caffe/reshape.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/extensions/front/caffe/reshape.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
from mo.front.extractor import FrontExtractorOp
from mo.ops.reshape import Reshape
class ReshapeFrontExtractor(FrontExtractorOp):
op = 'reshape'
enabled = True
@classmethod
def extract(cls, node)... | 27.741935 | 119 | 0.631395 |
import logging as log
from mo.front.extractor import FrontExtractorOp
from mo.ops.reshape import Reshape
class ReshapeFrontExtractor(FrontExtractorOp):
op = 'reshape'
enabled = True
@classmethod
def extract(cls, node):
param = node.pb.reshape_param
if param.axis != 0:
l... | true | true |
08f3ed2fdf51e9ef75fb056c73e49ece48eb99bb | 1,364 | py | Python | tests/integration/blueprints/admin/board/test_category_views.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 33 | 2018-01-16T02:04:51.000Z | 2022-03-22T22:57:29.000Z | tests/integration/blueprints/admin/board/test_category_views.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 7 | 2019-06-16T22:02:03.000Z | 2021-10-02T13:45:31.000Z | tests/integration/blueprints/admin/board/test_category_views.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 14 | 2019-06-01T21:39:24.000Z | 2022-03-14T17:56:43.000Z | """
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from byceps.services.board import (
category_command_service,
category_query_service,
)
def test_create_form(board_admin_client, board):
url = f'/admin/boards/categories/for_board/{board.id}/create'
... | 28.416667 | 79 | 0.719208 |
from byceps.services.board import (
category_command_service,
category_query_service,
)
def test_create_form(board_admin_client, board):
url = f'/admin/boards/categories/for_board/{board.id}/create'
response = board_admin_client.get(url)
assert response.status_code == 200
def test_create(board_... | true | true |
08f3ed78b9f8d0800cb8526f093a9d1ad07e03ed | 43,052 | py | Python | src/run_debias_mlm.py | kanekomasahiro/context-debias | 2161b38efcb03dd894690f54805686ed8b75939a | [
"MIT"
] | 12 | 2021-01-30T10:52:16.000Z | 2022-03-25T12:03:37.000Z | src/run_debias_mlm.py | kanekomasahiro/context-debias | 2161b38efcb03dd894690f54805686ed8b75939a | [
"MIT"
] | 1 | 2021-10-05T05:32:44.000Z | 2021-10-06T08:11:08.000Z | src/run_debias_mlm.py | kanekomasahiro/context-debias | 2161b38efcb03dd894690f54805686ed8b75939a | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 44.337796 | 217 | 0.651096 |
import argparse
import glob
import logging
import os
import pickle
import random
import re
import shutil
import copy
from typing import Dict, List, Tuple
import nltk
import numpy as np
import torch
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import DataLoader, Dataset, RandomSampler, Sequential... | true | true |
08f3ee68abdabb2203285c54ad59fcc8cecf6015 | 2,646 | py | Python | CIM16/IEC61970/LoadModel/__init__.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/IEC61970/LoadModel/__init__.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/IEC61970/LoadModel/__init__.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 1 | 2021-04-02T18:04:49.000Z | 2021-04-02T18:04:49.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | 54 | 290 | 0.82124 |
from CIM16.IEC61970.LoadModel.ConformLoad import ConformLoad
from CIM16.IEC61970.LoadModel.ConformLoadGroup import ConformLoadGroup
from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule
from CIM16.IEC61970.LoadModel.LoadGroup import LoadGroup
from CIM16.IEC61970.LoadModel.ConformLoadSchedul... | true | true |
08f3ef6dba8fa23cabb73a705978b45987def7c8 | 1,072 | py | Python | visyerres_sgdf_woob/__init__.py | cakeisalie5/visyerres_sgdf_woob | 6b4c31db3103ef535e8ee1e1bbb610f8bef7b71b | [
"MIT"
] | 4 | 2022-02-17T12:58:50.000Z | 2022-02-21T12:18:02.000Z | visyerres_sgdf_woob/__init__.py | cakeisalie5/visyerres_sgdf_woob | 6b4c31db3103ef535e8ee1e1bbb610f8bef7b71b | [
"MIT"
] | null | null | null | visyerres_sgdf_woob/__init__.py | cakeisalie5/visyerres_sgdf_woob | 6b4c31db3103ef535e8ee1e1bbb610f8bef7b71b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# *****************************************************************************
# Copyright (C) 2022 Thomas Touhey <thomas@touhey.fr>
#
# This software is licensed as described in the file LICENSE, which you
# should have received as part of this distribution.
#
# THE SOFTWARE IS PROVIDED “AS IS”,... | 39.703704 | 79 | 0.649254 |
from os.path import dirname as _dirname, join as _joinpaths
from .version import version
__all__ = ['MODULES_PATH', 'version']
MODULES_PATH = _joinpaths(_dirname(__file__), 'modules')
| true | true |
08f3efa947c1ba2536a6107c804462632bf78b87 | 12,403 | py | Python | renyigan_static_alpha.py | renyigan-lkgan/RenyiGAN | c4bbb86e6037e0b95ee4c00c18729a8a8a3d2946 | [
"MIT"
] | null | null | null | renyigan_static_alpha.py | renyigan-lkgan/RenyiGAN | c4bbb86e6037e0b95ee4c00c18729a8a8a3d2946 | [
"MIT"
] | 1 | 2020-09-25T22:37:05.000Z | 2020-09-25T22:37:05.000Z | renyigan_static_alpha.py | vincihb/RenyiGAN | c4bbb86e6037e0b95ee4c00c18729a8a8a3d2946 | [
"MIT"
] | 1 | 2020-10-07T19:14:21.000Z | 2020-10-07T19:14:21.000Z | import os
import time
import tensorflow as tf
from tensorflow.keras.initializers import RandomNormal
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, BatchNormalization, \
LeakyReLU, Conv2DTranspose, Conv2D, Dropout, Flatten, Reshape
import utils
import numpy as np
alpha_num, tria... | 46.981061 | 124 | 0.602919 | import os
import time
import tensorflow as tf
from tensorflow.keras.initializers import RandomNormal
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, BatchNormalization, \
LeakyReLU, Conv2DTranspose, Conv2D, Dropout, Flatten, Reshape
import utils
import numpy as np
alpha_num, tria... | true | true |
08f3f07736dff941bb1b78a5b39fd4bec9b4db98 | 6,459 | py | Python | GPT2/model.py | AeroXi/CPM-Generate-Pytorch | a1530ad2848a690c6e1557f996fe58538fe86884 | [
"Apache-2.0"
] | 30 | 2020-11-29T09:35:24.000Z | 2021-12-31T07:17:50.000Z | GPT2/model.py | unbuilt/CPM-Generate-Pytorch | 22bd2d7d59aa4907348f4b4b994b537c957e8eb4 | [
"Apache-2.0"
] | 8 | 2020-12-02T03:52:07.000Z | 2021-04-09T08:20:00.000Z | GPT2/model.py | unbuilt/CPM-Generate-Pytorch | 22bd2d7d59aa4907348f4b4b994b537c957e8eb4 | [
"Apache-2.0"
] | 3 | 2020-11-30T03:54:28.000Z | 2021-09-15T02:42:23.000Z | import math
import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, embedding_size):
super(MLP, self).__init__()
self.dense_h_to_4h = nn.Linear(embedding_size, embedding_size*4)
self.dense_4h_to_h = nn.Linear(embedding_size*4, embedding_size)
self.act = ... | 36.083799 | 133 | 0.582288 | import math
import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, embedding_size):
super(MLP, self).__init__()
self.dense_h_to_4h = nn.Linear(embedding_size, embedding_size*4)
self.dense_4h_to_h = nn.Linear(embedding_size*4, embedding_size)
self.act = ... | true | true |
08f3f175c7098c051cf2e9987739bfe058dddc43 | 810 | py | Python | setup.py | Synapt1x/PythonDataProcessor | 49f222cc9bcb5d52738ea1c588054ffc1209a695 | [
"MIT"
] | null | null | null | setup.py | Synapt1x/PythonDataProcessor | 49f222cc9bcb5d52738ea1c588054ffc1209a695 | [
"MIT"
] | null | null | null | setup.py | Synapt1x/PythonDataProcessor | 49f222cc9bcb5d52738ea1c588054ffc1209a695 | [
"MIT"
] | null | null | null | from cx_Freeze import setup, Executable
build_exe_options = {
"includes": ['numpy', 'pandas'],
"packages": [],
'excludes' : ['boto.compat.sys',
'boto.compat._sre',
'boto.compat._json',
'boto.compat._locale',
'boto.compat._struct',
'boto.comp... | 36.818182 | 216 | 0.620988 | from cx_Freeze import setup, Executable
build_exe_options = {
"includes": ['numpy', 'pandas'],
"packages": [],
'excludes' : ['boto.compat.sys',
'boto.compat._sre',
'boto.compat._json',
'boto.compat._locale',
'boto.compat._struct',
'boto.comp... | true | true |
08f3f2e4465c6a6949a3fd9161bdd5ea4995f0f5 | 6,033 | py | Python | scripts/ssesubsetremap.py | stivalaa/cuda_satabsearch | b947fb711f8b138e5a50c81e7331727c372eb87d | [
"MIT"
] | null | null | null | scripts/ssesubsetremap.py | stivalaa/cuda_satabsearch | b947fb711f8b138e5a50c81e7331727c372eb87d | [
"MIT"
] | null | null | null | scripts/ssesubsetremap.py | stivalaa/cuda_satabsearch | b947fb711f8b138e5a50c81e7331727c372eb87d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
#
# ssesubsetremap.py - Remap SSE mapping output of solns2ssemap.py for the
# case that one of the tableaux was a subset of the SSEs
# in the structure.
#
# See usage comment in ... | 35.075581 | 108 | 0.597547 |
import sys,os
import getopt
from time import strftime,localtime
from parsessemap import parse_ssemap,SearchMap,QuerySSEMap
def usage(progname):
sys.stderr.write("Usage: " +progname + " [-5] [-d domainid] sse_num_list\n")
sys.exit(1)
def main():
global verbose
verbose = False
d... | true | true |
08f3f2ff2ce6f095ee9bccf5a084552a1a56f1b5 | 73,334 | py | Python | dee/dee_model.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 15 | 2020-08-27T11:31:04.000Z | 2022-03-07T03:14:21.000Z | dee/dee_model.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 1 | 2020-08-24T07:56:38.000Z | 2022-03-18T01:26:57.000Z | dee/dee_model.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 2 | 2020-12-03T09:09:54.000Z | 2021-05-20T06:15:29.000Z | # -*- coding: utf-8 -*-
# AUTHOR: Shun Zheng
# DATE: 19-9-19
import torch
from torch import nn
import torch.nn.functional as F
import math
from collections import OrderedDict, namedtuple, defaultdict
import random
from . import transformer
from .ner_model import NERModel
DocSpanInfo = namedtuple(
'DocSpanInfo',... | 46.238335 | 135 | 0.651117 |
import torch
from torch import nn
import torch.nn.functional as F
import math
from collections import OrderedDict, namedtuple, defaultdict
import random
from . import transformer
from .ner_model import NERModel
DocSpanInfo = namedtuple(
'DocSpanInfo', (
'span_token_tup_list', 'span_dranges_list... | true | true |
08f3f37c821065f4dcb679e28faf1ce8657155a6 | 2,707 | py | Python | tools/helper_functions.py | FlowChamp/pyCourseManager | 2dd02c4cb0a25d6e92cc96f2b069874f983f80d8 | [
"Apache-2.0"
] | null | null | null | tools/helper_functions.py | FlowChamp/pyCourseManager | 2dd02c4cb0a25d6e92cc96f2b069874f983f80d8 | [
"Apache-2.0"
] | null | null | null | tools/helper_functions.py | FlowChamp/pyCourseManager | 2dd02c4cb0a25d6e92cc96f2b069874f983f80d8 | [
"Apache-2.0"
] | null | null | null | import requests, json
url = "https://ssh.marshhouse.tech:5500"
def make_headers(func):
def headers_from_input(*args):
headers=None
json_headers = {'content-type': 'application/json'}
auth_headers={'x-api-key': ''}
use_json = False
use_key = True
for x in args:
... | 31.476744 | 111 | 0.663835 | import requests, json
url = "https://ssh.marshhouse.tech:5500"
def make_headers(func):
def headers_from_input(*args):
headers=None
json_headers = {'content-type': 'application/json'}
auth_headers={'x-api-key': ''}
use_json = False
use_key = True
for x in args:
... | true | true |
08f3f3986ae7a00e9974a8989ee10f7e050da36a | 5,595 | py | Python | escalate/rest_api/tests/model_tests/workflow/workflowstep.py | darkreactions/ESCALATE | 0020da00b81a2dd80d1c9fd72d2edf92b519e605 | [
"MIT"
] | 11 | 2020-09-29T13:59:02.000Z | 2022-03-23T04:57:52.000Z | escalate/rest_api/tests/model_tests/workflow/workflowstep.py | darkreactions/ESCALATE | 0020da00b81a2dd80d1c9fd72d2edf92b519e605 | [
"MIT"
] | 95 | 2019-11-18T20:10:49.000Z | 2022-03-31T17:09:49.000Z | escalate/rest_api/tests/model_tests/workflow/workflowstep.py | darkreactions/ESCALATE | 0020da00b81a2dd80d1c9fd72d2edf92b519e605 | [
"MIT"
] | 2 | 2021-11-26T18:22:08.000Z | 2022-03-31T11:57:10.000Z | from ..model_tests_utils import (
status_codes,
DELETE,
PUT,
POST,
GET,
ERROR,
random_model_dict,
check_status_code,
compare_data,
createSystemtool
)
from core.models import (
ActionSequence,
Action,
ActionSequenceStep,
ActionSequenceObject,
)
workflowstep_test_d... | 29.919786 | 126 | 0.431099 | from ..model_tests_utils import (
status_codes,
DELETE,
PUT,
POST,
GET,
ERROR,
random_model_dict,
check_status_code,
compare_data,
createSystemtool
)
from core.models import (
ActionSequence,
Action,
ActionSequenceStep,
ActionSequenceObject,
)
workflowstep_test_d... | true | true |
08f3f4600e67a3058adbc4ba3669327450a9ad54 | 1,844 | py | Python | gnuradio-3.7.13.4/gr-analog/python/analog/qa_quadrature_demod.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gr-analog/python/analog/qa_quadrature_demod.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gr-analog/python/analog/qa_quadrature_demod.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | 28.8125 | 76 | 0.672993 |
import cmath
from gnuradio import gr, gr_unittest, analog, blocks
class test_quadrature_demod(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def test_quad_demod_001(self):
f = 1000.0
fs = 8000.0
src_data = []... | true | true |
08f3f64b570f4036ff0d81c84315f5163a52204d | 422 | py | Python | week1/1b/2_mean_of_a_set_of_signals/program.py | jensmcatanho/data-driven_astronomy | 46c32361378421079a7114e96c3c0fe8451748bb | [
"MIT"
] | null | null | null | week1/1b/2_mean_of_a_set_of_signals/program.py | jensmcatanho/data-driven_astronomy | 46c32361378421079a7114e96c3c0fe8451748bb | [
"MIT"
] | null | null | null | week1/1b/2_mean_of_a_set_of_signals/program.py | jensmcatanho/data-driven_astronomy | 46c32361378421079a7114e96c3c0fe8451748bb | [
"MIT"
] | null | null | null | import numpy as np
def mean_datasets(files):
datasets = []
for file in files:
datasets.append(np.loadtxt(file, delimiter=','))
result = np.mean(datasets, axis=0)
return np.round(result, decimals=1)
if __name__ == '__main__':
# Test Case 1
print(mean_datasets(['data1.csv', 'data2.csv'... | 23.444444 | 65 | 0.632701 | import numpy as np
def mean_datasets(files):
datasets = []
for file in files:
datasets.append(np.loadtxt(file, delimiter=','))
result = np.mean(datasets, axis=0)
return np.round(result, decimals=1)
if __name__ == '__main__':
print(mean_datasets(['data1.csv', 'data2.csv', 'data3.csv']... | true | true |
08f3f65ef5710f7cfd8cf481075a44f692b5ff2a | 1,201 | py | Python | testbook_json.py | prabal-collegedunia/csv_to_json | e4780caa0958a9e0f51824917511675b90f97c70 | [
"MIT"
] | null | null | null | testbook_json.py | prabal-collegedunia/csv_to_json | e4780caa0958a9e0f51824917511675b90f97c70 | [
"MIT"
] | null | null | null | testbook_json.py | prabal-collegedunia/csv_to_json | e4780caa0958a9e0f51824917511675b90f97c70 | [
"MIT"
] | null | null | null | import csv
import json
import sys
maxInt = sys.maxsize
def build_json(csv_file_path, json_file_path):
json_data ={}
# Open a csv reader called dict_reader
with open(csv_file_path, encoding = 'utf-8') as csvf:
csvReader = csv.DictReader(csvf,delimiter='|',quoting=csv.QUOTE_NONE)
... | 25.020833 | 80 | 0.652789 | import csv
import json
import sys
maxInt = sys.maxsize
def build_json(csv_file_path, json_file_path):
json_data ={}
with open(csv_file_path, encoding = 'utf-8') as csvf:
csvReader = csv.DictReader(csvf,delimiter='|',quoting=csv.QUOTE_NONE)
for rows in csvReader... | true | true |
08f3f6ba1e20a73449fcd933b6cdaa635371eedd | 4,370 | py | Python | satadd/satellogic_imagery.py | samapriya/satadd | 3ee89cf30a0a7c2df0585287dd54cfca766c8bb9 | [
"Apache-2.0"
] | 3 | 2019-07-16T07:03:26.000Z | 2020-01-20T07:11:37.000Z | satadd/satellogic_imagery.py | samapriya/satadd | 3ee89cf30a0a7c2df0585287dd54cfca766c8bb9 | [
"Apache-2.0"
] | null | null | null | satadd/satellogic_imagery.py | samapriya/satadd | 3ee89cf30a0a7c2df0585287dd54cfca766c8bb9 | [
"Apache-2.0"
] | null | null | null | import requests
import json
import time
import os
import csv
import sys
import configparser
from os.path import expanduser
from pySmartDL import SmartDL
os.chdir(os.path.dirname(os.path.realpath(__file__)))
home=os.path.dirname(os.path.realpath(__file__))
def satfile(sensor,geometry,target):
if geometry !=None an... | 44.141414 | 103 | 0.493135 | import requests
import json
import time
import os
import csv
import sys
import configparser
from os.path import expanduser
from pySmartDL import SmartDL
os.chdir(os.path.dirname(os.path.realpath(__file__)))
home=os.path.dirname(os.path.realpath(__file__))
def satfile(sensor,geometry,target):
if geometry !=None an... | true | true |
08f3f8b222107490b1af9b114a1d20a1d0be49a7 | 42,440 | py | Python | MinkowskiEngine/SparseTensor.py | kkkkeeee/MinkowskiEngineM | 456a8f12aa89449d75369760d9f0398a5a2e14cd | [
"MIT"
] | null | null | null | MinkowskiEngine/SparseTensor.py | kkkkeeee/MinkowskiEngineM | 456a8f12aa89449d75369760d9f0398a5a2e14cd | [
"MIT"
] | null | null | null | MinkowskiEngine/SparseTensor.py | kkkkeeee/MinkowskiEngineM | 456a8f12aa89449d75369760d9f0398a5a2e14cd | [
"MIT"
] | null | null | null | # Copyright (c) Chris Choy (chrischoy@ai.stanford.edu).
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, ... | 41.607843 | 352 | 0.619086 | # Networks", CVPR'19 (https://arxiv.org/abs/1904.08755) if you use any part
# of the code.
import os
import warnings
import torch
import copy
from enum import Enum
from typing import Union
from collections import Sequence
import numpy as np
from Common import convert_to_int_list
from MinkowskiCoords import CoordsKey, ... | true | true |
08f3f8bf32981f2ef0c66f0ce312b28e9d90b260 | 10,068 | py | Python | tensorflow/contrib/lite/python/convert.py | fortuin/tensorflow | 1b058574373555c8f6df056431e433f757573e81 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/lite/python/convert.py | fortuin/tensorflow | 1b058574373555c8f6df056431e433f757573e81 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/lite/python/convert.py | fortuin/tensorflow | 1b058574373555c8f6df056431e433f757573e81 | [
"Apache-2.0"
] | 1 | 2020-10-02T14:17:57.000Z | 2020-10-02T14:17:57.000Z | # Copyright 2018 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... | 43.396552 | 80 | 0.729837 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os as _os
import subprocess as _subprocess
import tempfile as _tempfile
from tensorflow.contrib.lite.python import lite_constants
from tensorflow.contrib.lite.toco import model_flags_pb2 as _model_flag... | true | true |
08f3fa2241997bf1e5bb33c73ca3b67b089c3bc9 | 2,939 | py | Python | tests/astarte/script/testcase_brown.py | coppelia517/orlov | d7ed6c061432b99ab2b75e0262db293e444fe6be | [
"MIT"
] | null | null | null | tests/astarte/script/testcase_brown.py | coppelia517/orlov | d7ed6c061432b99ab2b75e0262db293e444fe6be | [
"MIT"
] | null | null | null | tests/astarte/script/testcase_brown.py | coppelia517/orlov | d7ed6c061432b99ab2b75e0262db293e444fe6be | [
"MIT"
] | null | null | null | """ Script base for orlov astarte browndust packages """
import os
import glob
import logging
# flake8: noqa
# pylint: disable=no-name-in-module
# pylint: disable=unused-import
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from orlov.libs.picture import Picture
# pylint: disable=E0401
from... | 26.00885 | 83 | 0.574685 | import os
import glob
import logging
from orlov.libs.picture import Picture
from astarte.utility import TIMEOUT
from astarte.script.testcase import Astarte
logging = logging.getLogger(__name__)
class BrownDust(Astarte):
def debug(self):
return self.orlov_debug
def login(self):
self.adb.s... | true | true |
08f3fa5c070eab44c1798bf2d13761914daa70cd | 1,127 | py | Python | netcfg_grep/cli/cli.py | jeremyschulman/netcfg-grep | 7a87ff9b37611e09a645e6fe5d236de7ff36054e | [
"Apache-2.0"
] | 8 | 2020-10-07T03:38:18.000Z | 2022-02-28T12:11:53.000Z | netcfg_grep/cli/cli.py | jeremyschulman/netcfg-grep | 7a87ff9b37611e09a645e6fe5d236de7ff36054e | [
"Apache-2.0"
] | null | null | null | netcfg_grep/cli/cli.py | jeremyschulman/netcfg-grep | 7a87ff9b37611e09a645e6fe5d236de7ff36054e | [
"Apache-2.0"
] | 1 | 2021-07-07T18:07:31.000Z | 2021-07-07T18:07:31.000Z | import sys
from importlib import metadata
import click
import yaml
from netcfg_grep.grep import grep
VERSION = metadata.version("netcfg-grep")
@click.command()
@click.version_option(version=VERSION)
@click.option(
"-g", "--grep-config", help="netcfg-grep configuration YAML file", type=click.File()
)
@click.op... | 23.479167 | 88 | 0.661934 | import sys
from importlib import metadata
import click
import yaml
from netcfg_grep.grep import grep
VERSION = metadata.version("netcfg-grep")
@click.command()
@click.version_option(version=VERSION)
@click.option(
"-g", "--grep-config", help="netcfg-grep configuration YAML file", type=click.File()
)
@click.op... | true | true |
08f3fc3740cd454196f1cf742b61a1ded2c2cd97 | 121 | py | Python | criaenvio/envio.py | peixoto3/python-criaenvio | 79e62e64b0370e90434421ca1126accef7b62ca0 | [
"MIT"
] | 1 | 2020-08-19T00:55:30.000Z | 2020-08-19T00:55:30.000Z | criaenvio/envio.py | peixoto3/python-criaenvio | 79e62e64b0370e90434421ca1126accef7b62ca0 | [
"MIT"
] | null | null | null | criaenvio/envio.py | peixoto3/python-criaenvio | 79e62e64b0370e90434421ca1126accef7b62ca0 | [
"MIT"
] | null | null | null | from criaenvio.cliente import APIClienteCriaEnvio
class EnvioCriaEnvioAPI(APIClienteCriaEnvio):
RECURSO = 'envios'
| 20.166667 | 49 | 0.818182 | from criaenvio.cliente import APIClienteCriaEnvio
class EnvioCriaEnvioAPI(APIClienteCriaEnvio):
RECURSO = 'envios'
| true | true |
08f3fcb3ed42c015d76e48f51b34f051c5c85547 | 2,198 | py | Python | src/_dependencies/checks/loops.py | nicoddemus/dependencies | 74180e2c6098d8ad03bc53c5703bdf8dc61c3ed9 | [
"BSD-2-Clause"
] | null | null | null | src/_dependencies/checks/loops.py | nicoddemus/dependencies | 74180e2c6098d8ad03bc53c5703bdf8dc61c3ed9 | [
"BSD-2-Clause"
] | null | null | null | src/_dependencies/checks/loops.py | nicoddemus/dependencies | 74180e2c6098d8ad03bc53c5703bdf8dc61c3ed9 | [
"BSD-2-Clause"
] | null | null | null | from _dependencies.exceptions import DependencyError
from _dependencies.markers import injectable
from _dependencies.markers import nested_injector
from _dependencies.markers import this
def check_loops(class_name, dependencies):
for attrname, spec in dependencies.items():
if spec[0] is this:
... | 30.109589 | 88 | 0.643767 | from _dependencies.exceptions import DependencyError
from _dependencies.markers import injectable
from _dependencies.markers import nested_injector
from _dependencies.markers import this
def check_loops(class_name, dependencies):
for attrname, spec in dependencies.items():
if spec[0] is this:
... | true | true |
08f3fd6f641eeed0dd550ec8bd38ba1e7f8e9fbe | 789 | py | Python | IPython/frontend/html/notebook/tests/test_kernelsession.py | tinyclues/ipython | 71e32606b0242772b81c9be0d40751ba47d95f2c | [
"BSD-3-Clause-Clear"
] | 1 | 2016-05-26T10:57:18.000Z | 2016-05-26T10:57:18.000Z | IPython/frontend/html/notebook/tests/test_kernelsession.py | adgaudio/ipython | a924f50c0f7b84127391f1c396326258c2b303e2 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/frontend/html/notebook/tests/test_kernelsession.py | adgaudio/ipython | a924f50c0f7b84127391f1c396326258c2b303e2 | [
"BSD-3-Clause-Clear"
] | null | null | null | """Tests for the notebook kernel and session manager."""
from unittest import TestCase
from IPython.frontend.html.notebook.kernelmanager import KernelManager
class TestKernelManager(TestCase):
def test_km_lifecycle(self):
km = KernelManager()
kid = km.start_kernel()
self.assert_(kid in k... | 29.222222 | 70 | 0.670469 |
from unittest import TestCase
from IPython.frontend.html.notebook.kernelmanager import KernelManager
class TestKernelManager(TestCase):
def test_km_lifecycle(self):
km = KernelManager()
kid = km.start_kernel()
self.assert_(kid in km)
self.assertEquals(len(km),1)
km.kill_k... | true | true |
08f3fdd098720b1deaa1e16fdebc852c68fdeace | 2,280 | py | Python | docs/conf.py | sjackson4430/my_awesome_project | ae4cbf2fbef66de12d761a5dfdb8306d74136197 | [
"MIT"
] | null | null | null | docs/conf.py | sjackson4430/my_awesome_project | ae4cbf2fbef66de12d761a5dfdb8306d74136197 | [
"MIT"
] | null | null | null | docs/conf.py | sjackson4430/my_awesome_project | ae4cbf2fbef66de12d761a5dfdb8306d74136197 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 36.190476 | 79 | 0.666667 |
import os
import sys
import django
if os.getenv("READTHEDOCS", default=False) == "True":
sys.path.insert(0, os.path.abspath(".."))
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
os.environ["USE_DOCKER"] = "no"
else:
sys.path.insert(0, os.path.abspath(".."))
os.environ["DATABASE_URL"] = "sqlite:///r... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.