hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f5eda99e3950bc0e18d183778fcbcc24d6fee5 | 515 | py | Python | 1977.py | dayaelee/baekjoon | cf0e2b8b29dcd759c90f4736f6c26dd1982c72a3 | [
"MIT"
] | null | null | null | 1977.py | dayaelee/baekjoon | cf0e2b8b29dcd759c90f4736f6c26dd1982c72a3 | [
"MIT"
] | null | null | null | 1977.py | dayaelee/baekjoon | cf0e2b8b29dcd759c90f4736f6c26dd1982c72a3 | [
"MIT"
] | null | null | null | short=int(input())
max=int(input())
start = 1
sum=0
bb=[]
while(1):
n_start = start * start
if(n_start<short):
start=start+1
continue
elif(n_start>=short and n_start<=max):
sum=n_start+sum
bb.append(int(sum))
start=1+start
a=n_start
continue
elif... | 17.166667 | 42 | 0.475728 | short=int(input())
max=int(input())
start = 1
sum=0
bb=[]
while(1):
n_start = start * start
if(n_start<short):
start=start+1
continue
elif(n_start>=short and n_start<=max):
sum=n_start+sum
bb.append(int(sum))
start=1+start
a=n_start
continue
elif... | true | true |
f7f5ee4e0e6ca15330849bf2d391b8ca5cf2a707 | 7,384 | py | Python | p2pfs/ui/terminal.py | yxwangcs/p2pfs | 57e90d8f911de36da70f5977822cde609d1c3561 | [
"MIT"
] | 2 | 2020-07-02T12:09:19.000Z | 2020-08-26T15:48:15.000Z | p2pfs/ui/terminal.py | RyanWangGit/p2pfs | adcbf999010289e46c041aecc9af5c734c6de25e | [
"MIT"
] | null | null | null | p2pfs/ui/terminal.py | RyanWangGit/p2pfs | adcbf999010289e46c041aecc9af5c734c6de25e | [
"MIT"
] | 2 | 2020-07-19T04:15:53.000Z | 2021-01-16T20:31:48.000Z | import os
from asyncio import IncompleteReadError
from beautifultable import BeautifulTable
from p2pfs.core.tracker import Tracker
from p2pfs.core.peer import Peer
from p2pfs.core.exceptions import *
import p2pfs.ui.aiocmd as aiocmd
from aioconsole.stream import get_standard_streams
import logging
class TrackerTermin... | 41.022222 | 117 | 0.605228 | import os
from asyncio import IncompleteReadError
from beautifultable import BeautifulTable
from p2pfs.core.tracker import Tracker
from p2pfs.core.peer import Peer
from p2pfs.core.exceptions import *
import p2pfs.ui.aiocmd as aiocmd
from aioconsole.stream import get_standard_streams
import logging
class TrackerTermin... | true | true |
f7f5ee92b7d313e61274a3c6c4b2cede1c3cf934 | 1,244 | py | Python | usocketio/protocol.py | eliclement/uwebsockets | 440edabe31f85fced35d652c18d9ac26509f8bb6 | [
"MIT"
] | 119 | 2016-09-07T00:11:49.000Z | 2022-03-26T08:19:12.000Z | nodemcu/usocketio/protocol.py | juergs/bme680_nodemcu_socketio | 1d2264b593bf70c5248c3db8fbbaa34d8f15f50e | [
"MIT"
] | 17 | 2016-09-23T20:53:01.000Z | 2022-03-06T02:42:48.000Z | nodemcu/usocketio/protocol.py | juergs/bme680_nodemcu_socketio | 1d2264b593bf70c5248c3db8fbbaa34d8f15f50e | [
"MIT"
] | 37 | 2016-12-20T09:35:55.000Z | 2022-01-16T20:38:27.000Z | """
Socket.io/Engine.io protocol constructs
"""
PAYLOAD_STRING = const(0)
PAYLOAD_BINARY = const(1)
PACKET_OPEN = const(0)
PACKET_CLOSE = const(1)
PACKET_PING = const(2)
PACKET_PONG = const(3)
PACKET_MESSAGE = const(4)
PACKET_UPGRADE = const(5)
PACKET_NOOP = const(6)
MESSAGE_CONNECT = const(0)
MESSAGE_DISCONNECT = c... | 19.4375 | 46 | 0.589228 |
PAYLOAD_STRING = const(0)
PAYLOAD_BINARY = const(1)
PACKET_OPEN = const(0)
PACKET_CLOSE = const(1)
PACKET_PING = const(2)
PACKET_PONG = const(3)
PACKET_MESSAGE = const(4)
PACKET_UPGRADE = const(5)
PACKET_NOOP = const(6)
MESSAGE_CONNECT = const(0)
MESSAGE_DISCONNECT = const(1)
MESSAGE_EVENT = const(2)
MESSAGE_ACK = c... | true | true |
f7f5eea2333115caf27e5a8df0623525ea435756 | 5,751 | py | Python | oeml-sdk/python/openapi_client/api/balances_api.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | 1 | 2020-07-23T05:47:52.000Z | 2020-07-23T05:47:52.000Z | oeml-sdk/python/openapi_client/api/balances_api.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | oeml-sdk/python/openapi_client/api/balances_api.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> # noqa: E501
The version... | 38.597315 | 261 | 0.604069 |
from __future__ import absolute_import
import re
import six
from openapi_client.api_client import ApiClient
from openapi_client.exceptions import (
ApiTypeError,
ApiValueError
)
class BalancesApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_clie... | true | true |
f7f5eee62e5e147c0608594bf082fab2159288f4 | 17 | py | Python | py3status/version.py | saengowp/py3status | 65a609261095f7502fc2814e9a6feb478845a69c | [
"BSD-3-Clause"
] | null | null | null | py3status/version.py | saengowp/py3status | 65a609261095f7502fc2814e9a6feb478845a69c | [
"BSD-3-Clause"
] | null | null | null | py3status/version.py | saengowp/py3status | 65a609261095f7502fc2814e9a6feb478845a69c | [
"BSD-3-Clause"
] | null | null | null | version = "3.18"
| 8.5 | 16 | 0.588235 | version = "3.18"
| true | true |
f7f5eef9f8c971b1407b13153918a5f69b8d2b84 | 1,100 | py | Python | awards/urls.py | francismuk/Awards | 8b37b1cffb8ab28275fbdf7f648ec30c0c1d24b6 | [
"MIT"
] | null | null | null | awards/urls.py | francismuk/Awards | 8b37b1cffb8ab28275fbdf7f648ec30c0c1d24b6 | [
"MIT"
] | 6 | 2020-02-12T03:02:55.000Z | 2021-09-08T01:11:26.000Z | awards/urls.py | francismuk/Awards | 8b37b1cffb8ab28275fbdf7f648ec30c0c1d24b6 | [
"MIT"
] | null | null | null | """awards URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 35.483871 | 79 | 0.698182 | from django.conf.urls import url,include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('award.urls')),
url(r'^accounts/', include('registra... | true | true |
f7f5f08a25874160189facb7f6341772ad2dd45f | 95 | py | Python | lowercase.py | voussoir/cmd | 9ecfc43751c42d4cdd288b8a1b28ba3a7fa6c650 | [
"BSD-3-Clause"
] | 6 | 2020-01-30T13:36:53.000Z | 2022-02-05T08:14:56.000Z | lowercase.py | voussoir/cmd | 9ecfc43751c42d4cdd288b8a1b28ba3a7fa6c650 | [
"BSD-3-Clause"
] | null | null | null | lowercase.py | voussoir/cmd | 9ecfc43751c42d4cdd288b8a1b28ba3a7fa6c650 | [
"BSD-3-Clause"
] | 1 | 2020-01-30T13:36:33.000Z | 2020-01-30T13:36:33.000Z | from voussoirkit import pipeable
for line in pipeable.go():
pipeable.stdout(line.lower())
| 19 | 33 | 0.747368 | from voussoirkit import pipeable
for line in pipeable.go():
pipeable.stdout(line.lower())
| true | true |
f7f5f10fa1d85b4d2c5c69b518ffb9e2f23ce246 | 391 | py | Python | python_fishc/3.1.py | iisdd/Courses | a47d202e0d7e1ba85a38c6fe3dd9619eceb1045c | [
"MIT"
] | 1 | 2020-11-29T14:42:01.000Z | 2020-11-29T14:42:01.000Z | python_fishc/3.1.py | iisdd/Courses | a47d202e0d7e1ba85a38c6fe3dd9619eceb1045c | [
"MIT"
] | null | null | null | python_fishc/3.1.py | iisdd/Courses | a47d202e0d7e1ba85a38c6fe3dd9619eceb1045c | [
"MIT"
] | null | null | null | '''
1. 关于最后提到的长字符串(三重引号字符串)
其实在 Python3 还可以这么写,不妨试试,然后比较下哪种更方便?
>>> string = (
"我爱鱼C,\n"
"正如我爱小甲鱼,\n"
"他那呱唧呱唧的声音,\n"
"总缠绕于我的脑海,\n"
"久久不肯散去……\n")
'''
str1 = '''又是一个深夜凌晨我不想睡
多久才能够买房还要赚多少出场费
玩说唱怎么养活自己也许你说的对
可谁想当个没有出息的窝囊废
'''
str2 = (
'我想过很多种的死法但我现在依然活着\n'
'没人相信我能做音乐我自己就是伯乐\n'
'不想朝九晚五你就说我顽固走弯路... | 17 | 36 | 0.629156 | str1 = '''又是一个深夜凌晨我不想睡
多久才能够买房还要赚多少出场费
玩说唱怎么养活自己也许你说的对
可谁想当个没有出息的窝囊废
'''
str2 = (
'我想过很多种的死法但我现在依然活着\n'
'没人相信我能做音乐我自己就是伯乐\n'
'不想朝九晚五你就说我顽固走弯路\n'
'你只在乎我的收入不会在乎我的专注\n')
print (str1 , end = '')
print (str2)
| true | true |
f7f5f1c2e5e28de4c28b3200d0e7b1411916fbe5 | 2,840 | py | Python | realsense_face_detection.py | kylelscott/Face-Recognition-with-Intel-D435i | c48530a1bdcd6de23f1b6c02d5a2f60f290b23d8 | [
"Apache-2.0"
] | 3 | 2021-02-04T14:06:26.000Z | 2022-02-02T02:57:17.000Z | realsense_face_detection.py | kylelscott/Face-Recognition-with-Intel-D435i | c48530a1bdcd6de23f1b6c02d5a2f60f290b23d8 | [
"Apache-2.0"
] | null | null | null | realsense_face_detection.py | kylelscott/Face-Recognition-with-Intel-D435i | c48530a1bdcd6de23f1b6c02d5a2f60f290b23d8 | [
"Apache-2.0"
] | 1 | 2021-02-12T22:47:05.000Z | 2021-02-12T22:47:05.000Z | ## License: Apache 2.0. See LICENSE file in root directory.
## Copyright(c) 2015-2017 Intel Corporation. All Rights Reserved.
###############################################
## Open CV and Numpy integration ##
###############################################
import pyrealsense2 as rs
import numpy as np
imp... | 34.634146 | 111 | 0.601408 | false | true | |
f7f5f1d3ef99d5b8072e48178de1228ee5b15b3f | 653 | py | Python | financial/views/user.py | dritux/financial-tools | 0e55e84b3590e86e11d52cd3db1d1a1a83adc236 | [
"MIT"
] | null | null | null | financial/views/user.py | dritux/financial-tools | 0e55e84b3590e86e11d52cd3db1d1a1a83adc236 | [
"MIT"
] | null | null | null | financial/views/user.py | dritux/financial-tools | 0e55e84b3590e86e11d52cd3db1d1a1a83adc236 | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify, request
from financial.models import User, users_schema
from financial import db
user = Blueprint('user', __name__, url_prefix='')
@user.route("/user", methods=['GET'])
def get():
users = User.query.all()
result = users_schema.dump(users)
return jsonify(user=result.... | 21.064516 | 49 | 0.655436 | from flask import Blueprint, jsonify, request
from financial.models import User, users_schema
from financial import db
user = Blueprint('user', __name__, url_prefix='')
@user.route("/user", methods=['GET'])
def get():
users = User.query.all()
result = users_schema.dump(users)
return jsonify(user=result.... | true | true |
f7f5f2f6e66691b739c6240d21fe317ff8fb95ce | 510 | py | Python | spacq/devices/rohde_schwarz/mock/tests/test_mock_smf100a.py | bleutooth65/SpanishAcquisition3 | 50d1445c57f7ecf3bbf03a2cb28befedba1bd57a | [
"BSD-2-Clause"
] | 1 | 2020-09-30T15:52:48.000Z | 2020-09-30T15:52:48.000Z | spacq/devices/rohde_schwarz/mock/tests/test_mock_smf100a.py | bleutooth65/SpanishAcquisition3 | 50d1445c57f7ecf3bbf03a2cb28befedba1bd57a | [
"BSD-2-Clause"
] | null | null | null | spacq/devices/rohde_schwarz/mock/tests/test_mock_smf100a.py | bleutooth65/SpanishAcquisition3 | 50d1445c57f7ecf3bbf03a2cb28befedba1bd57a | [
"BSD-2-Clause"
] | 3 | 2019-06-13T20:59:13.000Z | 2021-02-07T03:23:11.000Z | from unittest import main
from ... import smf100a
from .. import mock_smf100a
from ...tests.server.test_smf100a import SMF100ATest
# Don't lose the real device.
real_SMF100A = smf100a.SMF100A
is_mock = SMF100ATest.mock
def setup():
# Run the tests with a fake device.
smf100a.SMF100A = mock_smf100a.MockSMF100A
... | 18.888889 | 52 | 0.754902 | from unittest import main
from ... import smf100a
from .. import mock_smf100a
from ...tests.server.test_smf100a import SMF100ATest
real_SMF100A = smf100a.SMF100A
is_mock = SMF100ATest.mock
def setup():
# Run the tests with a fake device.
smf100a.SMF100A = mock_smf100a.MockSMF100A
SMF100ATest.mock = True
def ... | true | true |
f7f5f32b1f82bfd1da20a8353dc12f669657358a | 749 | py | Python | benchmarks/time_render.py | bdice/conda-build | f12b838b827b2581925ca65f9a856e82dc467e0d | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:18:39.000Z | 2021-09-13T20:18:39.000Z | benchmarks/time_render.py | bdice/conda-build | f12b838b827b2581925ca65f9a856e82dc467e0d | [
"BSD-3-Clause"
] | 6 | 2016-07-05T19:08:39.000Z | 2017-10-23T10:59:14.000Z | benchmarks/time_render.py | mingwandroid/conda-build | 3543ae8220167a600b0a6816f529e15edf7e19b0 | [
"BSD-3-Clause"
] | 2 | 2020-01-07T08:34:25.000Z | 2020-01-07T09:10:29.000Z | import os
from conda_build import api
# god-awful hack to get data from the test recipes
import sys
_thisdir = os.path.dirname(__file__)
sys.path.append(os.path.dirname(_thisdir))
from tests.utils import metadata_dir
variant_dir = os.path.join(metadata_dir, '..', 'variants')
def time_simple_render():
api.rend... | 26.75 | 78 | 0.738318 | import os
from conda_build import api
import sys
_thisdir = os.path.dirname(__file__)
sys.path.append(os.path.dirname(_thisdir))
from tests.utils import metadata_dir
variant_dir = os.path.join(metadata_dir, '..', 'variants')
def time_simple_render():
api.render(os.path.join(metadata_dir, 'python_run'), final... | true | true |
f7f5f3d8eaef67d7372d8c0b39b63c81881e5971 | 9,115 | py | Python | vsts/vsts/release/v4_0/models/release_environment.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/release/v4_0/models/release_environment.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/release/v4_0/models/release_environment.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 62.431507 | 669 | 0.696544 |
from msrest.serialization import Model
class ReleaseEnvironment(Model):
_attribute_map = {
'conditions': {'key': 'conditions', 'type': '[ReleaseCondition]'},
'created_on': {'key': 'createdOn', 'type': 'iso-8601'},
'definition_environment_id': {'key': 'definitionEnvironmentId', 'ty... | true | true |
f7f5f3e176e46aa576fbd0625f24ac72a0e7c51a | 15,503 | py | Python | tests/python/contrib/test_hexagon/test_benchmark_elemwise_add.py | gayatripk1/tvm | 8bf6cd5800daaf42935fd69cbd63180c97bef262 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/contrib/test_hexagon/test_benchmark_elemwise_add.py | gayatripk1/tvm | 8bf6cd5800daaf42935fd69cbd63180c97bef262 | [
"Apache-2.0"
] | 2,863 | 2017-08-17T19:55:50.000Z | 2019-11-04T17:18:41.000Z | tests/python/contrib/test_hexagon/test_benchmark_elemwise_add.py | gayatripk1/tvm | 8bf6cd5800daaf42935fd69cbd63180c97bef262 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.137529 | 100 | 0.632329 |
import os
import os.path
import sys
import pytest
import numpy as np
import logging
import tempfile
import tvm.testing
import tvm.script
from tvm.script import tir as T
from tvm import te
from tvm.contrib.hexagon.build import HexagonLauncherRPC
from . import benchmark_util as bu
_SHOULD_SKIP_BENCHMAR... | true | true |
f7f5f4c038040284d3c8fafbf7385c60829b0f9a | 2,333 | py | Python | appliances/main.py | Aleksey-Voko/Avito_autoload | c94851f2f5d0f0903321c6a2ad4c8a3d94421791 | [
"MIT"
] | 2 | 2022-01-12T12:29:57.000Z | 2022-01-13T05:17:35.000Z | appliances/main.py | Aleksey-Voko/Avito_autoload | c94851f2f5d0f0903321c6a2ad4c8a3d94421791 | [
"MIT"
] | null | null | null | appliances/main.py | Aleksey-Voko/Avito_autoload | c94851f2f5d0f0903321c6a2ad4c8a3d94421791 | [
"MIT"
] | 1 | 2022-01-12T12:29:58.000Z | 2022-01-12T12:29:58.000Z | from datetime import datetime, timedelta
from pathlib import Path
from pytils.translit import slugify
from appliances.data import (COMPANY_NAME, MANAGER_NAME, CONTACT_PHONE,
ADDRESS, CATEGORY, GOODS_TYPE, AD_TYPE,
get_description, CONDITION, PHOTO_STORAGE,
... | 35.892308 | 77 | 0.572225 | from datetime import datetime, timedelta
from pathlib import Path
from pytils.translit import slugify
from appliances.data import (COMPANY_NAME, MANAGER_NAME, CONTACT_PHONE,
ADDRESS, CATEGORY, GOODS_TYPE, AD_TYPE,
get_description, CONDITION, PHOTO_STORAGE,
... | true | true |
f7f5f56d0ed5ebf08fd9e820536d724b22f301ad | 3,979 | py | Python | mypy/patterns.py | cibinmathew/mypy | 49825a9057d8c52603e91f6b99e4de94ca3d8a66 | [
"PSF-2.0"
] | 4 | 2022-01-21T08:35:40.000Z | 2022-02-18T07:19:38.000Z | mypy/patterns.py | cibinmathew/mypy | 49825a9057d8c52603e91f6b99e4de94ca3d8a66 | [
"PSF-2.0"
] | 183 | 2021-10-21T23:30:15.000Z | 2022-03-29T00:05:26.000Z | mypy/patterns.py | cibinmathew/mypy | 49825a9057d8c52603e91f6b99e4de94ca3d8a66 | [
"PSF-2.0"
] | 3 | 2021-11-11T00:35:34.000Z | 2022-01-18T07:33:23.000Z | """Classes for representing match statement patterns."""
from typing import TypeVar, List, Optional, Union
from mypy_extensions import trait
from mypy.nodes import Node, RefExpr, NameExpr, Expression
from mypy.visitor import PatternVisitor
T = TypeVar('T')
@trait
class Pattern(Node):
"""A pattern node."""
... | 28.833333 | 99 | 0.660216 | from typing import TypeVar, List, Optional, Union
from mypy_extensions import trait
from mypy.nodes import Node, RefExpr, NameExpr, Expression
from mypy.visitor import PatternVisitor
T = TypeVar('T')
@trait
class Pattern(Node):
__slots__ = ()
def accept(self, visitor: PatternVisitor[T]) -> T:
ra... | true | true |
f7f5f57afe4d606a3ea72be29d94d51dd8a1a03a | 12,204 | py | Python | .history/src/Simulador_20200710105647.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200710105647.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200710105647.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix
class Simulador():
... | 41.369492 | 145 | 0.649705 | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix
class Simulador():
... | true | true |
f7f5f5981972a23bade957895f383213a96a34b1 | 8,253 | py | Python | ray/rllib/test/test_nested_spaces.py | hyyh28/tesp | 8109b39011e05545453950c918b14da07e70fad3 | [
"MIT"
] | 29 | 2019-05-18T12:18:34.000Z | 2022-03-30T01:46:48.000Z | ray/rllib/test/test_nested_spaces.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-08-15T05:42:10.000Z | 2021-05-21T09:41:15.000Z | ray/rllib/test/test_nested_spaces.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-07-15T22:36:20.000Z | 2020-08-09T07:03:26.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pickle
from gym import spaces
from gym.envs.registration import EnvSpec
import gym
import tensorflow.contrib.slim as slim
import tensorflow as tf
import unittest
import ray
from ray.rllib.agents.pg imp... | 33.012 | 77 | 0.592996 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pickle
from gym import spaces
from gym.envs.registration import EnvSpec
import gym
import tensorflow.contrib.slim as slim
import tensorflow as tf
import unittest
import ray
from ray.rllib.agents.pg imp... | true | true |
f7f5f60ff05545d42c50ea3f9b168149ed27046b | 849 | py | Python | plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/__init__.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-05-19T05:04:30.000Z | 2016-09-07T00:33:17.000Z | plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/__init__.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2020-11-16T20:46:14.000Z | 2022-02-01T01:06:16.000Z | plugins/hypervisors/baremetal/resources/security_group_agent/security_group_agent/__init__.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2017-07-07T14:49:03.000Z | 2018-07-31T06:38:42.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 44.684211 | 62 | 0.771496 | true | true | |
f7f5f68d0463bf2c16e7e6eb15df13ada49da6f4 | 17,283 | py | Python | plugins/modules/oci_dns_steering_policy_attachment.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_dns_steering_policy_attachment.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_dns_steering_policy_attachment.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 36.308824 | 129 | 0.648556 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_dns_steering_policy_attachment
short_description: Manage a SteeringPolic... | true | true |
f7f5f6eaae516b2a98bd07ca9376aebaf2aff1c1 | 492 | py | Python | src/logger.py | PJUllrich/bunq-pinsparen | 6f22b1d5c1c66533007f3823e628f9014ee88cdc | [
"MIT"
] | 3 | 2018-05-15T05:39:27.000Z | 2018-07-07T17:45:38.000Z | src/logger.py | PJUllrich/bunq-pinsparen | 6f22b1d5c1c66533007f3823e628f9014ee88cdc | [
"MIT"
] | 1 | 2021-06-01T22:21:05.000Z | 2021-06-01T22:21:05.000Z | src/logger.py | PJUllrich/bunq-pinsparen | 6f22b1d5c1c66533007f3823e628f9014ee88cdc | [
"MIT"
] | null | null | null | import logging
def setup_logger(filename):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
fh = logging.FileHandler(filename)
fh.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
sh.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)... | 22.363636 | 89 | 0.689024 | import logging
def setup_logger(filename):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
fh = logging.FileHandler(filename)
fh.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
sh.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)... | true | true |
f7f5f70b80620a4ed543fe9dcb18197caced5576 | 11,274 | py | Python | trac/versioncontrol/tests/diff.py | haskell-infra/trac | 5e086948718893ede9965ea4ce3625da32676730 | [
"BSD-3-Clause"
] | null | null | null | trac/versioncontrol/tests/diff.py | haskell-infra/trac | 5e086948718893ede9965ea4ce3625da32676730 | [
"BSD-3-Clause"
] | 1 | 2019-03-20T19:13:53.000Z | 2019-08-14T20:15:09.000Z | trac/versioncontrol/tests/diff.py | haskell-infra/trac | 5e086948718893ede9965ea4ce3625da32676730 | [
"BSD-3-Clause"
] | 2 | 2019-03-20T01:23:30.000Z | 2019-12-06T16:13:07.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | 42.86692 | 79 | 0.553131 |
from trac.versioncontrol import diff
import unittest
def get_opcodes(*args, **kwargs):
for hunk in diff.get_filtered_hunks(*args, **kwargs):
for opcode in hunk:
yield opcode
class DiffTestCase(unittest.TestCase):
def testget_change_extent(self):
self.assertEqual((3, ... | true | true |
f7f5f799ce97fc0833ffb356c643821b217b8978 | 473 | py | Python | tests/Pyro4-4.17/tests/run_suite.py | nelmiux/CS347-Data_Management | 1e9d87097b5a373f9312b0d6b413198e495fd6c0 | [
"CNRI-Jython"
] | null | null | null | tests/Pyro4-4.17/tests/run_suite.py | nelmiux/CS347-Data_Management | 1e9d87097b5a373f9312b0d6b413198e495fd6c0 | [
"CNRI-Jython"
] | null | null | null | tests/Pyro4-4.17/tests/run_suite.py | nelmiux/CS347-Data_Management | 1e9d87097b5a373f9312b0d6b413198e495fd6c0 | [
"CNRI-Jython"
] | null | null | null | """
Run the complete test suite.
This requires nose and coverage to be installed.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
import sys
import os
import nose
dirname = os.path.dirname(__file__)
if dirname:
print("chdir to "+dirname)
os.chdir(dirname)
sys.path.inser... | 21.5 | 105 | 0.699789 |
import sys
import os
import nose
dirname = os.path.dirname(__file__)
if dirname:
print("chdir to "+dirname)
os.chdir(dirname)
sys.path.insert(0,"../src")
nose.main(argv=["noserunner", "--cover-erase","--with-coverage","--cover-package=Pyro4", "--with-xunit"])
| true | true |
f7f5f7eca844e35718ef9a9eae00cd58cee25d96 | 300 | py | Python | edgeql_queries/typing.py | refi64/edgeql-queries | f4734545a250f6e8718a9f1da08d22dcd04605c5 | [
"BSD-2-Clause-FreeBSD"
] | 8 | 2020-04-23T14:24:02.000Z | 2022-03-24T22:57:32.000Z | edgeql_queries/typing.py | refi64/edgeql-queries | f4734545a250f6e8718a9f1da08d22dcd04605c5 | [
"BSD-2-Clause-FreeBSD"
] | 160 | 2020-04-11T00:43:55.000Z | 2022-03-20T12:20:02.000Z | edgeql_queries/typing.py | refi64/edgeql-queries | f4734545a250f6e8718a9f1da08d22dcd04605c5 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2022-03-19T16:49:43.000Z | 2022-03-19T16:49:43.000Z | """Definition for aliases for complex types from typing."""
from typing import Dict, Union
from edgeql_queries.models import Query
# mypy has limitation on understanding cyclic types
# https://github.com/python/mypy/issues/7069
QueriesTree = Dict[str, Union[Query, "QueriesTree"]] # type: ignore
| 30 | 68 | 0.77 |
from typing import Dict, Union
from edgeql_queries.models import Query
QueriesTree = Dict[str, Union[Query, "QueriesTree"]]
| true | true |
f7f5f80a953a80ba62f329d6e30bba461774ca45 | 947 | py | Python | model/prediction.py | Ajithsj96/RealTimeFRuseDeep | 50dd67856d178e7f2540922e8328241b9c79dbc0 | [
"MIT"
] | 275 | 2017-01-02T16:20:14.000Z | 2022-03-22T20:55:52.000Z | model/prediction.py | jamalmahfuz/Face-Recognition | a5ebfc1137bc3e8530ffa4423842d3b2ba13954a | [
"MIT"
] | 14 | 2017-05-29T09:33:53.000Z | 2019-03-09T19:01:56.000Z | model/prediction.py | jamalmahfuz/Face-Recognition | a5ebfc1137bc3e8530ffa4423842d3b2ba13954a | [
"MIT"
] | 125 | 2017-01-08T11:24:10.000Z | 2021-12-08T13:32:43.000Z | import argparse
import feature_utility as fu
import myVGG
import cv2
import numpy as np
parser = argparse.ArgumentParser(description=("Testing Prediction"))
parser.add_argument('--image', help=('Input an image to test model prediction'))
parser.add_argument('--dataset', help=('Input a directory to test model predict... | 27.852941 | 85 | 0.659979 | import argparse
import feature_utility as fu
import myVGG
import cv2
import numpy as np
parser = argparse.ArgumentParser(description=("Testing Prediction"))
parser.add_argument('--image', help=('Input an image to test model prediction'))
parser.add_argument('--dataset', help=('Input a directory to test model predict... | true | true |
f7f5f92d30e182bcda0915196f2c853e00370e73 | 5,597 | py | Python | frl/data.py | ThirstyScholar/trading-bitcoin-with-reinforcement-learning | e2163e954b1f5f656c49fbfb560ddd4635548a91 | [
"MIT"
] | 99 | 2018-05-16T11:51:26.000Z | 2022-01-23T16:37:25.000Z | frl/data.py | ThirstyScholar/BTCwithRL | e2163e954b1f5f656c49fbfb560ddd4635548a91 | [
"MIT"
] | 7 | 2018-07-31T17:40:16.000Z | 2022-03-04T15:36:52.000Z | frl/data.py | ThirstyScholar/BTCwithRL | e2163e954b1f5f656c49fbfb560ddd4635548a91 | [
"MIT"
] | 33 | 2018-07-17T18:42:58.000Z | 2022-03-21T17:46:13.000Z | import numpy as np
import pandas as pd
class Data(object):
def __init__(self, csv_path):
self.csv_path = csv_path
self.data = pd.read_csv(csv_path) # read CSV into DataFrame
self.feat = None
def __len__(self):
return len(self.data)
def remove_outlier(self):
idx ... | 30.418478 | 98 | 0.571556 | import numpy as np
import pandas as pd
class Data(object):
def __init__(self, csv_path):
self.csv_path = csv_path
self.data = pd.read_csv(csv_path)
self.feat = None
def __len__(self):
return len(self.data)
def remove_outlier(self):
idx = pd.datetime(2017, 4, 15... | true | true |
f7f5f94b8026b5e9c70f1d9432e2c1ee8576e32d | 3,321 | py | Python | python/8.web/2.Django/base_demo/base_demo/settings.py | lotapp/BaseCode | 0255f498e1fe67ed2b3f66c84c96e44ef1f7d320 | [
"Apache-2.0"
] | 25 | 2018-06-13T08:13:44.000Z | 2020-11-19T14:02:11.000Z | python/8.web/2.Django/base_demo/base_demo/settings.py | lotapp/BaseCode | 0255f498e1fe67ed2b3f66c84c96e44ef1f7d320 | [
"Apache-2.0"
] | null | null | null | python/8.web/2.Django/base_demo/base_demo/settings.py | lotapp/BaseCode | 0255f498e1fe67ed2b3f66c84c96e44ef1f7d320 | [
"Apache-2.0"
] | 13 | 2018-06-13T08:13:38.000Z | 2022-01-06T06:45:07.000Z | """
Django settings for base_demo project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... | 26.357143 | 87 | 0.681421 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '(=nl3ovw%-1t4^8%x9ue(r41%k@6wju0nu&#o3n%27%@)#hc1j'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentty... | true | true |
f7f5f957f34a770e5dd6487886b6a08f91233a30 | 1,427 | py | Python | tinyms/app/__init__.py | xinwenh/tinyms | a7db052d6820ba1001b9a2be00b1fd108decd853 | [
"Apache-2.0"
] | null | null | null | tinyms/app/__init__.py | xinwenh/tinyms | a7db052d6820ba1001b9a2be00b1fd108decd853 | [
"Apache-2.0"
] | null | null | null | tinyms/app/__init__.py | xinwenh/tinyms | a7db052d6820ba1001b9a2be00b1fd108decd853 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.032258 | 115 | 0.766643 |
from . import object_detection
from .object_detection.object_detector import object_detection_predict, ObjectDetector
from .object_detection.utils.view_util import visualize_boxes_on_image, draw_boxes_on_image, save_image
from .object_detection.utils.config_util import load_and_parse_config
object_detec... | true | true |
f7f5fa3abae8d535ea8b1869b40c521aa1ee888c | 352 | py | Python | Download/copy_bin.py | ShareCat/zigbee_offline_programmer | fe46200c5d74f88f6831524cc030ae36877c0d38 | [
"MIT"
] | 4 | 2022-01-26T05:57:14.000Z | 2022-03-03T08:11:14.000Z | Download/copy_bin.py | ShareCat/zigbee_offline_programmer | fe46200c5d74f88f6831524cc030ae36877c0d38 | [
"MIT"
] | null | null | null | Download/copy_bin.py | ShareCat/zigbee_offline_programmer | fe46200c5d74f88f6831524cc030ae36877c0d38 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# import shutil & os
import shutil,os
print("coping bin file...");
# copy the .bin file
shutil.copy(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))+"\\Project\\RVMDK\\Output\\LHD8006_application.bin",os.path.abspath(os.path.dirname(__file__)))
print("copy done!");
# add "python ./..... | 25.142857 | 167 | 0.698864 |
import shutil,os
print("coping bin file...");
shutil.copy(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))+"\\Project\\RVMDK\\Output\\LHD8006_application.bin",os.path.abspath(os.path.dirname(__file__)))
print("copy done!");
| true | true |
f7f5faa049aa7d515608e843d764b36a7479491d | 568 | py | Python | front/migrations/0003_auto_20161024_1533.py | ahemery/ezreports | 9ff0f472ff0f0efd06c8315b99084bd723b0e2f9 | [
"Apache-2.0"
] | null | null | null | front/migrations/0003_auto_20161024_1533.py | ahemery/ezreports | 9ff0f472ff0f0efd06c8315b99084bd723b0e2f9 | [
"Apache-2.0"
] | null | null | null | front/migrations/0003_auto_20161024_1533.py | ahemery/ezreports | 9ff0f472ff0f0efd06c8315b99084bd723b0e2f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-24 13:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('front', '0002_lien_disabled'),
]
operations = [
... | 25.818182 | 140 | 0.653169 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('front', '0002_lien_disabled'),
]
operations = [
migrations.AlterField(
model_name='lien',
... | true | true |
f7f5fb1477e0d06a0238672c9d24e3e6d8693c3e | 6,251 | py | Python | test/implementation/implementation_autograd.py | jabader97/backpack | 089daafa0d611e13901fd7ecf8a0d708ce7a5928 | [
"MIT"
] | 395 | 2019-10-04T09:37:52.000Z | 2022-03-29T18:00:56.000Z | test/implementation/implementation_autograd.py | jabader97/backpack | 089daafa0d611e13901fd7ecf8a0d708ce7a5928 | [
"MIT"
] | 78 | 2019-10-11T18:56:43.000Z | 2022-03-23T01:49:54.000Z | test/implementation/implementation_autograd.py | jabader97/backpack | 089daafa0d611e13901fd7ecf8a0d708ce7a5928 | [
"MIT"
] | 50 | 2019-10-03T16:31:10.000Z | 2022-03-15T19:36:14.000Z | import torch
from backpack.hessianfree.ggnvp import ggn_vector_product_from_plist
from backpack.hessianfree.hvp import hessian_vector_product
from backpack.hessianfree.rop import R_op
from backpack.utils.convert_parameters import vector_to_parameter_list
from .implementation import Implementation
class AutogradImpl... | 33.789189 | 88 | 0.595265 | import torch
from backpack.hessianfree.ggnvp import ggn_vector_product_from_plist
from backpack.hessianfree.hvp import hessian_vector_product
from backpack.hessianfree.rop import R_op
from backpack.utils.convert_parameters import vector_to_parameter_list
from .implementation import Implementation
class AutogradImpl... | true | true |
f7f5fb4f1fbf92e0e3cdde451db21747259e0df8 | 122 | py | Python | account/admin.py | HarshilShrivastava/TrueCaller-Backend | 8303fbd1ac6ddc79a50803da6b682deb5b9dddfe | [
"MIT"
] | null | null | null | account/admin.py | HarshilShrivastava/TrueCaller-Backend | 8303fbd1ac6ddc79a50803da6b682deb5b9dddfe | [
"MIT"
] | null | null | null | account/admin.py | HarshilShrivastava/TrueCaller-Backend | 8303fbd1ac6ddc79a50803da6b682deb5b9dddfe | [
"MIT"
] | null | null | null | from django.contrib import admin
from account.models import User
admin.site.register(User)
# Register your models here.
| 24.4 | 33 | 0.803279 | from django.contrib import admin
from account.models import User
admin.site.register(User)
| true | true |
f7f5fd92a7d3810e1cd7f038ab2a83ce83eadd73 | 387 | py | Python | students/K33422/Smolenskaya Tatyana/Lr4/lab_3/asgi.py | agentofknowledge/ITMO_ICT_WebDevelopment_2020-2021 | 7d5eab0d68af378083f21473cbbd5e5def6aa60a | [
"MIT"
] | null | null | null | students/K33422/Smolenskaya Tatyana/Lr4/lab_3/asgi.py | agentofknowledge/ITMO_ICT_WebDevelopment_2020-2021 | 7d5eab0d68af378083f21473cbbd5e5def6aa60a | [
"MIT"
] | null | null | null | students/K33422/Smolenskaya Tatyana/Lr4/lab_3/asgi.py | agentofknowledge/ITMO_ICT_WebDevelopment_2020-2021 | 7d5eab0d68af378083f21473cbbd5e5def6aa60a | [
"MIT"
] | null | null | null | """
ASGI config for lab_3 project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lab_3.settings')
application = get_asgi_application()
| true | true |
f7f5feac18d8be5171c374b058a7c66d5ff83842 | 1,788 | py | Python | tests/modules/jmeter/__init__.py | 3dgiordano/taurus | 77cb31b6f0e5c27545094f600ac2b595fa76d992 | [
"Apache-2.0"
] | 1 | 2018-02-17T16:00:34.000Z | 2018-02-17T16:00:34.000Z | tests/modules/jmeter/__init__.py | 3dgiordano/taurus | 77cb31b6f0e5c27545094f600ac2b595fa76d992 | [
"Apache-2.0"
] | 5 | 2018-03-10T20:50:24.000Z | 2021-08-20T15:07:32.000Z | tests/modules/jmeter/__init__.py | 3dgiordano/taurus | 77cb31b6f0e5c27545094f600ac2b595fa76d992 | [
"Apache-2.0"
] | 1 | 2018-05-04T23:06:15.000Z | 2018-05-04T23:06:15.000Z | import logging
from tests.mocks import EngineEmul
from bzt.modules.jmeter import JMeter, JMeterExecutor
from bzt.utils import get_full_path
class MockJMeter(JMeter):
def __init__(self, has_ctg=None, reaction=None):
jmeter_version = JMeterExecutor.JMETER_VER
jmeter_path = "~/.bzt/jmeter-taurus/{ve... | 33.111111 | 120 | 0.64877 | import logging
from tests.mocks import EngineEmul
from bzt.modules.jmeter import JMeter, JMeterExecutor
from bzt.utils import get_full_path
class MockJMeter(JMeter):
def __init__(self, has_ctg=None, reaction=None):
jmeter_version = JMeterExecutor.JMETER_VER
jmeter_path = "~/.bzt/jmeter-taurus/{ve... | true | true |
f7f5ff252bbdfd7f2dfe8e3d880cf0c0cf3dc444 | 866 | py | Python | Lectures/tex/codes/lecture9.py | josh-gree/NumericalMethods | 03cb91114b3f5eb1b56916920ad180d371fe5283 | [
"CC-BY-3.0"
] | 76 | 2015-02-12T19:51:52.000Z | 2022-03-26T15:34:11.000Z | Lectures/tex/codes/lecture9.py | josh-gree/NumericalMethods | 03cb91114b3f5eb1b56916920ad180d371fe5283 | [
"CC-BY-3.0"
] | 2 | 2017-05-24T19:49:52.000Z | 2018-01-23T21:40:42.000Z | Lectures/tex/codes/lecture9.py | josh-gree/NumericalMethods | 03cb91114b3f5eb1b56916920ad180d371fe5283 | [
"CC-BY-3.0"
] | 41 | 2015-01-05T13:30:47.000Z | 2022-02-15T09:59:39.000Z | import numpy
def functional_iteration(f, x0, max_steps=100, tol=1e-10):
x = numpy.zeros(max_steps+1)
x[0] = x0
step = 0
g = lambda x : x - f(x)
while abs(f(x[step])) > tol and step < max_steps:
step = step + 1
x[step] = g(x[step-1])
return x[:step+1]
if __name__=="__main__"... | 32.074074 | 58 | 0.564665 | import numpy
def functional_iteration(f, x0, max_steps=100, tol=1e-10):
x = numpy.zeros(max_steps+1)
x[0] = x0
step = 0
g = lambda x : x - f(x)
while abs(f(x[step])) > tol and step < max_steps:
step = step + 1
x[step] = g(x[step-1])
return x[:step+1]
if __name__=="__main__"... | true | true |
f7f60009cec16f6905e0c64c19b1b099693ea817 | 730 | py | Python | src/tele_muninn/message_processor.py | namuan/tele-muninn | 9252b035881dd7618de09530c8494192dc2c00a0 | [
"MIT"
] | null | null | null | src/tele_muninn/message_processor.py | namuan/tele-muninn | 9252b035881dd7618de09530c8494192dc2c00a0 | [
"MIT"
] | null | null | null | src/tele_muninn/message_processor.py | namuan/tele-muninn | 9252b035881dd7618de09530c8494192dc2c00a0 | [
"MIT"
] | null | null | null | import logging
from dataclasses import dataclass
async def download_web_page(url: str) -> None:
logging.info("Downloading web page: %s", url)
def _handle_web_page(web_page_url: str) -> str:
return f"✅ Processed web page: {web_page_url}"
def _process_message(update_message_text: str) -> str:
if update_... | 25.172414 | 61 | 0.756164 | import logging
from dataclasses import dataclass
async def download_web_page(url: str) -> None:
logging.info("Downloading web page: %s", url)
def _handle_web_page(web_page_url: str) -> str:
return f"✅ Processed web page: {web_page_url}"
def _process_message(update_message_text: str) -> str:
if update_... | true | true |
f7f60080b35f974b2a1f446edb633a4b007370e8 | 2,556 | py | Python | test/programytest/parser/template/node_tests/test_first.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 5 | 2018-08-21T00:13:45.000Z | 2018-09-01T20:00:55.000Z | test/programytest/parser/template/node_tests/test_first.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 1 | 2018-09-12T18:30:17.000Z | 2018-09-12T18:30:17.000Z | test/programytest/parser/template/node_tests/test_first.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 5 | 2018-08-21T00:08:36.000Z | 2018-09-23T06:11:04.000Z | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.first import TemplateFirstNode
from programy.parser.template.nodes.word import TemplateWordNode
from programytest.parser.base import ParserTestsBaseClass
class MockTemplateFirstNode(Te... | 30.795181 | 84 | 0.666667 | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.first import TemplateFirstNode
from programy.parser.template.nodes.word import TemplateWordNode
from programytest.parser.base import ParserTestsBaseClass
class MockTemplateFirstNode(Te... | true | true |
f7f600a85b26969b7b63010c250c42a7dbeb92da | 9,869 | py | Python | pdftools/_cli.py | jrhawley/pdftools | febb6e7bf6894d5be15d850828e7cc03671ee6d2 | [
"MIT"
] | 59 | 2018-05-04T11:05:33.000Z | 2022-02-07T23:22:22.000Z | pdftools/_cli.py | jrhawley/pdftools | febb6e7bf6894d5be15d850828e7cc03671ee6d2 | [
"MIT"
] | 13 | 2018-04-10T16:38:32.000Z | 2022-01-17T21:31:18.000Z | pdftools/_cli.py | jrhawley/pdftools | febb6e7bf6894d5be15d850828e7cc03671ee6d2 | [
"MIT"
] | 17 | 2019-01-23T02:41:03.000Z | 2022-03-02T20:34:03.000Z | import os.path as path
import argparse
import re
from . import __version__
def main():
PARSER = argparse.ArgumentParser(
description="Python-based command line tool for manipulating PDFs. It is based on the PyPdf2 package.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
# global... | 33.914089 | 147 | 0.594082 | import os.path as path
import argparse
import re
from . import __version__
def main():
PARSER = argparse.ArgumentParser(
description="Python-based command line tool for manipulating PDFs. It is based on the PyPdf2 package.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
PAR... | true | true |
f7f60181f40c19cf1253e09f332b7c856b23c7ee | 4,058 | py | Python | source/GUIscripts/plot2DEQ.py | plasmapotential/HEAT | 864c932fac616a59d4b2d07a9b45dfb137f7e6b8 | [
"MIT"
] | 29 | 2020-07-17T15:18:57.000Z | 2022-02-07T02:23:12.000Z | source/GUIscripts/plot2DEQ.py | HongLouyemeng/HEAT | bee84ceffbfc022cdc202ef67c87e469ff6b9e91 | [
"MIT"
] | 6 | 2020-10-02T12:24:43.000Z | 2022-03-29T14:25:51.000Z | source/GUIscripts/plot2DEQ.py | HongLouyemeng/HEAT | bee84ceffbfc022cdc202ef67c87e469ff6b9e91 | [
"MIT"
] | 5 | 2021-02-01T07:41:44.000Z | 2022-03-07T15:18:27.000Z | #plotEQ.py
#Description: Plots Equilibrium (2D) from gfile for pyqt5 application
#Engineer: T Looby
#Date: 20190916
import matplotlib.pyplot as plt
import numpy as np
import MDSplus
import EFIT.equilParams_class as EP
from scipy import interpolate
from scipy.interpolate import interp1d
def EQ2Dplot(ep,... | 41.408163 | 107 | 0.542632 |
import matplotlib.pyplot as plt
import numpy as np
import MDSplus
import EFIT.equilParams_class as EP
from scipy import interpolate
from scipy.interpolate import interp1d
def EQ2Dplot(ep,shot,t,MachFlag,height=None):
rbdry = ep.g['lcfs'][:,0]
zbdry = ep.g['lcfs'][:,1]
if MachFlag == 'nstx':
... | true | true |
f7f601eacdf0d3968221b99c81a51e8970172226 | 5,870 | py | Python | models/setting.py | usmbc00/iosconfig | 3e67041ece413cc01f40a0b05ce75c187c0ab61a | [
"Apache-2.0"
] | 15 | 2015-01-14T21:13:05.000Z | 2021-10-12T01:19:14.000Z | models/setting.py | usmbc00/iosconfig | 3e67041ece413cc01f40a0b05ce75c187c0ab61a | [
"Apache-2.0"
] | null | null | null | models/setting.py | usmbc00/iosconfig | 3e67041ece413cc01f40a0b05ce75c187c0ab61a | [
"Apache-2.0"
] | 20 | 2015-01-29T02:52:26.000Z | 2022-02-25T00:07:11.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 40.763889 | 80 | 0.759114 |
import logging
from wtforms import validators
from google.appengine.ext import ndb
_LOG = logging.getLogger('google_password_generator.setting')
class Setting(ndb.Model):
create_new_password_message = ndb.StringProperty(required=True)
default_password_length = ndb.IntegerProperty(required=True)
... | true | true |
f7f601f6566afc46b1aebb5186b9ee2fbfee1f0d | 2,614 | py | Python | gears/jobs.py | xordspar0/gearhead-caramel | 1dc64fc3324d81bcb905a1b6e49f78ea48cdc150 | [
"Apache-2.0"
] | null | null | null | gears/jobs.py | xordspar0/gearhead-caramel | 1dc64fc3324d81bcb905a1b6e49f78ea48cdc150 | [
"Apache-2.0"
] | null | null | null | gears/jobs.py | xordspar0/gearhead-caramel | 1dc64fc3324d81bcb905a1b6e49f78ea48cdc150 | [
"Apache-2.0"
] | null | null | null | import glob
import json
import pbge
from . import stats
import random
SINGLETON_TYPES = dict()
ALL_JOBS = dict()
class Job(object):
def __init__(self,name="Job",skills=(),tags=(),always_combatant=False,skill_modifiers=None,local_requirements=()):
self.name = name
self.skills = set()
for sk... | 36.816901 | 139 | 0.60329 | import glob
import json
import pbge
from . import stats
import random
SINGLETON_TYPES = dict()
ALL_JOBS = dict()
class Job(object):
def __init__(self,name="Job",skills=(),tags=(),always_combatant=False,skill_modifiers=None,local_requirements=()):
self.name = name
self.skills = set()
for sk... | true | true |
f7f60283610af628ee4fd8c21818314d6b973916 | 6,836 | py | Python | manu_dede/db/db.py | jcd717/manu-dede | 8d6418a4d9330efccb9b5a2afb3e4262cd6031ef | [
"Unlicense"
] | null | null | null | manu_dede/db/db.py | jcd717/manu-dede | 8d6418a4d9330efccb9b5a2afb3e4262cd6031ef | [
"Unlicense"
] | null | null | null | manu_dede/db/db.py | jcd717/manu-dede | 8d6418a4d9330efccb9b5a2afb3e4262cd6031ef | [
"Unlicense"
] | null | null | null | import os
import requests
import sqlite3,csv
import click
from flask import current_app
#from flask import cli (inutile ?)
from flask.cli import with_appcontext
'''
Mode BOURRIN
Je fais une connection globale pour l'application, contrairement au tuto qui fait une connexion dans g (donc si j'ai bien compris par reques... | 30.114537 | 190 | 0.633996 | import os
import requests
import sqlite3,csv
import click
from flask import current_app
from flask.cli import with_appcontext
def get_db():
if current_app.config.get('db') is None:
current_app.config['db'] = sqlite3.connect(
current_app.DB_FILE,
detect_types=sqlite3.PARSE_D... | true | true |
f7f602edd39ee04a3b98e7ae3219cbf20882da94 | 1,865 | py | Python | docuploader/credentials.py | renovate-bot/docuploader | 64cb69e2a2f50f96a0b992ccbd78336eddc3c420 | [
"Apache-2.0"
] | 7 | 2019-06-18T12:07:31.000Z | 2021-05-31T05:48:57.000Z | docuploader/credentials.py | renovate-bot/docuploader | 64cb69e2a2f50f96a0b992ccbd78336eddc3c420 | [
"Apache-2.0"
] | 56 | 2019-03-07T23:15:58.000Z | 2022-01-19T14:34:30.000Z | docuploader/credentials.py | renovate-bot/docuploader | 64cb69e2a2f50f96a0b992ccbd78336eddc3c420 | [
"Apache-2.0"
] | 4 | 2019-06-18T07:31:07.000Z | 2021-05-04T05:11:57.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.57377 | 82 | 0.724397 |
import os
from typing import List, Optional
from google.oauth2 import service_account
import google.auth
_WELL_KNOWN_LOCATIONS: List[str] = []
if "KOKORO_KEYSTORE_DIR" in os.environ:
_WELL_KNOWN_LOCATIONS.append(
os.path.join(
os.environ["KOKORO_KEYSTORE_DIR"], "73713_docupload... | true | true |
f7f603a9304c71ceb36c928b87382cc026476665 | 5,826 | py | Python | ethereum/transactions.py | c-castillo/pyethereum | 6e0e9a937c16d67faed16c5fce9a21bdef5a58ee | [
"MIT"
] | null | null | null | ethereum/transactions.py | c-castillo/pyethereum | 6e0e9a937c16d67faed16c5fce9a21bdef5a58ee | [
"MIT"
] | null | null | null | ethereum/transactions.py | c-castillo/pyethereum | 6e0e9a937c16d67faed16c5fce9a21bdef5a58ee | [
"MIT"
] | null | null | null | from bitcoin import encode_pubkey, N, P
try:
from c_secp256k1 import ecdsa_raw_sign, ecdsa_raw_recover
except ImportError:
from bitcoin import ecdsa_raw_sign, ecdsa_raw_recover
import rlp
from rlp.sedes import big_endian_int, binary
from rlp.utils import decode_hex, encode_hex
from ethereum import bloom
from et... | 35.096386 | 95 | 0.618778 | from bitcoin import encode_pubkey, N, P
try:
from c_secp256k1 import ecdsa_raw_sign, ecdsa_raw_recover
except ImportError:
from bitcoin import ecdsa_raw_sign, ecdsa_raw_recover
import rlp
from rlp.sedes import big_endian_int, binary
from rlp.utils import decode_hex, encode_hex
from ethereum import bloom
from et... | true | true |
f7f604520a4b79ffe1a606bacdcb748abbd4e508 | 1,656 | py | Python | frameworks/helloworld/tests/test_pre_reserved_sidecar.py | elezar/dcos-commons | b7b3aeec1d5b6dc9073ba07000d4e48784143846 | [
"Apache-2.0"
] | 7 | 2017-11-02T05:26:40.000Z | 2020-01-27T19:33:52.000Z | frameworks/helloworld/tests/test_pre_reserved_sidecar.py | elezar/dcos-commons | b7b3aeec1d5b6dc9073ba07000d4e48784143846 | [
"Apache-2.0"
] | 14 | 2017-09-20T22:47:48.000Z | 2020-09-11T19:54:25.000Z | frameworks/helloworld/tests/test_pre_reserved_sidecar.py | AlexRogalskiy/dcos-commons | 85711f05bc94172aabb6837f9ff529721437d20c | [
"Apache-2.0"
] | 9 | 2017-11-14T19:43:07.000Z | 2022-01-06T12:44:49.000Z | import logging
import pytest
import retrying
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
import sdk_utils
from tests import config
log = logging.getLogger(__name__)
pytestmark = pytest.mark.skipif(
sdk_utils.is_strict_mode() and sdk_utils.dcos_version_less_than('1.11'),
reason="se... | 27.147541 | 100 | 0.716184 | import logging
import pytest
import retrying
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
import sdk_utils
from tests import config
log = logging.getLogger(__name__)
pytestmark = pytest.mark.skipif(
sdk_utils.is_strict_mode() and sdk_utils.dcos_version_less_than('1.11'),
reason="se... | true | true |
f7f604b4a41308c3a63999cb5082a40c7e2df948 | 3,153 | py | Python | datasets/data_prefetcher.py | Tarandro/TransTrack | 81c12d0737125052f3eb2773ac47be60144f6ccb | [
"MIT"
] | 466 | 2020-12-31T02:53:51.000Z | 2022-03-28T08:55:35.000Z | datasets/data_prefetcher.py | Tarandro/TransTrack | 81c12d0737125052f3eb2773ac47be60144f6ccb | [
"MIT"
] | 59 | 2021-01-01T06:27:55.000Z | 2022-03-30T10:28:23.000Z | datasets/data_prefetcher.py | Tarandro/TransTrack | 81c12d0737125052f3eb2773ac47be60144f6ccb | [
"MIT"
] | 90 | 2021-01-01T08:56:07.000Z | 2022-03-30T09:38:31.000Z | # ------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
import torch
def... | 45.042857 | 110 | 0.572154 |
import torch
def to_cuda(samples, targets, device):
samples = samples.to(device, non_blocking=True)
targets = [{k: v.to(device, non_blocking=True) for k, v in t.items()} for t in targets]
return samples, targets
class data_prefetcher():
def __init__(self, loader, device, prefetch=True):
... | true | true |
f7f6055ac8fa209475c1ae141e56a9189206bcf9 | 935 | py | Python | www/src/web_workers/test_worker.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 5,926 | 2015-01-01T07:45:08.000Z | 2022-03-31T12:34:38.000Z | www/src/web_workers/test_worker.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 1,728 | 2015-01-01T01:09:12.000Z | 2022-03-30T23:25:22.000Z | www/src/web_workers/test_worker.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 574 | 2015-01-02T01:36:10.000Z | 2022-03-26T10:18:48.000Z | """
An example of a simple worker
Run as follows:
from browser import webworker as ww
w = ww.WorkerParent('web_workers/test_worker.py',[1,2,3],{"test":"Ahoj"})
m = ww.Message('ping',"ahoj")
r = w.post_message(m,want_reply=True)
w.post_message(ww.Message('quit',N... | 29.21875 | 85 | 0.660963 | from browser.webworker import current_worker, Message
from browser import console
from sys import argv
from os import environ
def pong(self, message, **_):
print('Web worker received message (',message.id,')', message.name, message.data)
current_worker.post_reply(message, Message('pong', message.data))
... | true | true |
f7f606ac7779bb6b68b85c5fc253535bb673dbc0 | 243 | py | Python | itscsapp/carrers/models/__init__.py | danyRivC/itscsapp | 485309f41f477fcebf66899740a0b4a954f4b98b | [
"MIT"
] | null | null | null | itscsapp/carrers/models/__init__.py | danyRivC/itscsapp | 485309f41f477fcebf66899740a0b4a954f4b98b | [
"MIT"
] | null | null | null | itscsapp/carrers/models/__init__.py | danyRivC/itscsapp | 485309f41f477fcebf66899740a0b4a954f4b98b | [
"MIT"
] | null | null | null | from itscsapp.carrers.models.semesters import *
from itscsapp.carrers.models.carrer import *
from itscsapp.carrers.models.informations import *
from itscsapp.carrers.models.categories import *
from itscsapp.carrers.models.asignatures import *
| 40.5 | 50 | 0.835391 | from itscsapp.carrers.models.semesters import *
from itscsapp.carrers.models.carrer import *
from itscsapp.carrers.models.informations import *
from itscsapp.carrers.models.categories import *
from itscsapp.carrers.models.asignatures import *
| true | true |
f7f607330315df560da32c1258c9a8b9e09d78dd | 9,132 | py | Python | featuretools/computational_backends/feature_set.py | ridicolos/featuretools | 0af409da206e0b691ec64a3e0e618a43f1701dd9 | [
"BSD-3-Clause"
] | 942 | 2020-11-10T02:59:39.000Z | 2022-03-31T16:34:33.000Z | featuretools/computational_backends/feature_set.py | 167rgc911/featuretools | bbad3f7392b203b7b9c250a93465052e7fc06bbc | [
"BSD-3-Clause"
] | 721 | 2020-11-09T23:12:06.000Z | 2022-03-31T22:33:35.000Z | featuretools/computational_backends/feature_set.py | 167rgc911/featuretools | bbad3f7392b203b7b9c250a93465052e7fc06bbc | [
"BSD-3-Clause"
] | 127 | 2020-11-10T10:12:30.000Z | 2022-03-27T08:55:05.000Z | import itertools
import logging
from collections import defaultdict
from featuretools.entityset.relationship import RelationshipPath
from featuretools.feature_base import (
AggregationFeature,
FeatureOutputSlice,
GroupByTransformFeature,
TransformFeature
)
from featuretools.utils import Trie
logger = ... | 39.704348 | 107 | 0.633377 | import itertools
import logging
from collections import defaultdict
from featuretools.entityset.relationship import RelationshipPath
from featuretools.feature_base import (
AggregationFeature,
FeatureOutputSlice,
GroupByTransformFeature,
TransformFeature
)
from featuretools.utils import Trie
logger = ... | true | true |
f7f60830f317e8a79c8a9db2ca16560bb484746e | 3,345 | py | Python | pyalgotrade/optimizer/local.py | gbecedatxapo/pyalgotrade | b1015f2f20714ae02f834a90f25376e40c6f8ab9 | [
"Apache-2.0"
] | 1 | 2020-07-06T18:38:38.000Z | 2020-07-06T18:38:38.000Z | pyalgotrade/optimizer/local.py | gbecedatxapo/pyalgotrade | b1015f2f20714ae02f834a90f25376e40c6f8ab9 | [
"Apache-2.0"
] | null | null | null | pyalgotrade/optimizer/local.py | gbecedatxapo/pyalgotrade | b1015f2f20714ae02f834a90f25376e40c6f8ab9 | [
"Apache-2.0"
] | null | null | null | # PyAlgoTrade
#
# Copyright 2011-2014 Gabriel Martin Becedillas Ruiz
#
# 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... | 32.163462 | 158 | 0.686099 |
import multiprocessing
import threading
import logging
import socket
import random
import os
from pyalgotrade.optimizer import server
from pyalgotrade.optimizer import worker
def server_thread(srv, barFeed, strategyParameters, port):
srv.serve(barFeed, strategyParameters)
def worker_process(st... | true | true |
f7f608e1afa0a7b744c0bcc7829f50cc2a075ca4 | 2,497 | py | Python | website/conferences/model.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | null | null | null | website/conferences/model.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | 13 | 2020-03-24T15:29:41.000Z | 2022-03-11T23:15:28.000Z | website/conferences/model.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import bson
from modularodm import fields, Q
from modularodm.exceptions import ModularOdmException
from framework.mongo import StoredObject
from website.conferences.exceptions import ConferenceError
class Conference(StoredObject):
#: Determines the email address for submission and the O... | 40.274194 | 87 | 0.686424 |
import bson
from modularodm import fields, Q
from modularodm.exceptions import ModularOdmException
from framework.mongo import StoredObject
from website.conferences.exceptions import ConferenceError
class Conference(StoredObject):
endpoint = fields.StringField(primary=True, required=True, ... | true | true |
f7f60a19681ac9fb722fc906bd1313a2b340af29 | 4,950 | py | Python | vr_optimizers/opts.py | SamuelHorvath/Variance_Reduced_Optimizers_Pytorch | f75da9c53408df2403a5521b634e5d25ffd4a8dc | [
"Apache-2.0"
] | 1 | 2021-07-11T11:17:49.000Z | 2021-07-11T11:17:49.000Z | vr_optimizers/opts.py | SamuelHorvath/Variance_Reduced_Optimizers_Pytorch | f75da9c53408df2403a5521b634e5d25ffd4a8dc | [
"Apache-2.0"
] | null | null | null | vr_optimizers/opts.py | SamuelHorvath/Variance_Reduced_Optimizers_Pytorch | f75da9c53408df2403a5521b634e5d25ffd4a8dc | [
"Apache-2.0"
] | 1 | 2021-07-13T05:09:27.000Z | 2021-07-13T05:09:27.000Z | import argparse
from datetime import datetime
import os
def parse_args(args):
parser = initialise_arg_parser(args, 'Variance Reduction.')
parser.add_argument(
"--total-runs",
type=int,
default=3,
help="Number of times to redo run, we increase seed by 1 if deterministic",
)... | 25.91623 | 109 | 0.56 | import argparse
from datetime import datetime
import os
def parse_args(args):
parser = initialise_arg_parser(args, 'Variance Reduction.')
parser.add_argument(
"--total-runs",
type=int,
default=3,
help="Number of times to redo run, we increase seed by 1 if deterministic",
)... | true | true |
f7f60a75acdd9326848b43492463db3bfa171e55 | 5,541 | py | Python | IPython/frontend/html/notebook/azurenbmanager.py | 3kwa/ipython | a5922fd39ed4b2067d64b285125278a850bb129f | [
"BSD-3-Clause-Clear"
] | 1 | 2022-03-13T23:06:43.000Z | 2022-03-13T23:06:43.000Z | IPython/frontend/html/notebook/azurenbmanager.py | andreasjansson/ipython | 09b4311726f46945b936c699f7a6489d74d7397f | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/frontend/html/notebook/azurenbmanager.py | andreasjansson/ipython | 09b4311726f46945b936c699f7a6489d74d7397f | [
"BSD-3-Clause-Clear"
] | null | null | null | """A notebook manager that uses Azure blob storage.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distrib... | 38.479167 | 118 | 0.608554 |
import datetime
import azure
from azure.storage import BlobService
from tornado import web
from .nbmanager import NotebookManager
from IPython.nbformat import current
from IPython.utils.traitlets import Unicode, Instance
class AzureNotebookManager(NotebookManager):
account_name = Unicode('', c... | true | true |
f7f60b62d5a1159087e0cfa1e581c8142c64677a | 9,448 | py | Python | pyro/infer/importance.py | patrickeganfoley/pyro | 3bd5e099e85f3686c66fc3b53476c3b009a77a02 | [
"Apache-2.0"
] | 2 | 2020-06-05T20:40:50.000Z | 2020-09-05T15:39:48.000Z | pyro/infer/importance.py | patrickeganfoley/pyro | 3bd5e099e85f3686c66fc3b53476c3b009a77a02 | [
"Apache-2.0"
] | 1 | 2020-05-12T16:26:21.000Z | 2020-05-12T17:23:13.000Z | pyro/infer/importance.py | patrickeganfoley/pyro | 3bd5e099e85f3686c66fc3b53476c3b009a77a02 | [
"Apache-2.0"
] | 1 | 2021-04-11T21:37:25.000Z | 2021-04-11T21:37:25.000Z | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import warnings
import torch
import pyro
import pyro.poutine as poutine
from pyro.ops.stats import fit_generalized_pareto
from .abstract_infer import TracePosterior
from .enum import get_importance_trace
class Impo... | 43.141553 | 106 | 0.662257 |
import math
import warnings
import torch
import pyro
import pyro.poutine as poutine
from pyro.ops.stats import fit_generalized_pareto
from .abstract_infer import TracePosterior
from .enum import get_importance_trace
class Importance(TracePosterior):
def __init__(self, model, guide=None, num_samples=None):
... | true | true |
f7f60b9cee51f3d268a030062f033bd33c469b0b | 924 | py | Python | docs/conf.py | datadesk/python-muckrock | fcea70270e9ff596e18d03892f60bfc98e171d30 | [
"MIT"
] | 4 | 2019-01-29T15:41:29.000Z | 2019-12-03T18:07:13.000Z | docs/conf.py | datadesk/python-muckrock | fcea70270e9ff596e18d03892f60bfc98e171d30 | [
"MIT"
] | 8 | 2019-01-29T16:56:23.000Z | 2019-02-07T04:17:05.000Z | docs/conf.py | datadesk/python-muckrock | fcea70270e9ff596e18d03892f60bfc98e171d30 | [
"MIT"
] | 1 | 2019-01-29T15:42:06.000Z | 2019-01-29T15:42:06.000Z | """Configure Sphinx configuration."""
import os
import sys
from datetime import datetime
# Insert the parent directory into the path
sys.path.insert(0, os.path.abspath(".."))
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinxcontrib.napoleon",
"sphinx_click",
]
templates_path = ["_templates"]... | 19.659574 | 58 | 0.649351 | import os
import sys
from datetime import datetime
sys.path.insert(0, os.path.abspath(".."))
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinxcontrib.napoleon",
"sphinx_click",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "python-muckrock"
year = ... | true | true |
f7f60bcda4ea0152233fd99b1b9eeda41b0a4739 | 3,056 | py | Python | quantum/tests/unit/test_quantum_manager.py | ericwanghp/quantum | 1c0d543552c38a5eac6dd08580b73725c5757876 | [
"Apache-2.0"
] | 1 | 2021-04-18T15:23:19.000Z | 2021-04-18T15:23:19.000Z | quantum/tests/unit/test_quantum_manager.py | ericwanghp/quantum | 1c0d543552c38a5eac6dd08580b73725c5757876 | [
"Apache-2.0"
] | null | null | null | quantum/tests/unit/test_quantum_manager.py | ericwanghp/quantum | 1c0d543552c38a5eac6dd08580b73725c5757876 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 36.380952 | 78 | 0.64627 |
import os
import types
import fixtures
from oslo.config import cfg
from quantum.common import config
from quantum.common.test_lib import test_config
from quantum.manager import QuantumManager
from quantum.openstack.common import log as logging
from quantum.plugins.common import constants
from quantu... | true | true |
f7f60da0e90f8c3d5929c7b3c497a48882ce112c | 4,709 | py | Python | datasets/binary.py | shuxiaobo/TextTransferLearning | 6fb93bd43dde7012ece1bbe7a5beee0a991ccc43 | [
"MIT"
] | null | null | null | datasets/binary.py | shuxiaobo/TextTransferLearning | 6fb93bd43dde7012ece1bbe7a5beee0a991ccc43 | [
"MIT"
] | null | null | null | datasets/binary.py | shuxiaobo/TextTransferLearning | 6fb93bd43dde7012ece1bbe7a5beee0a991ccc43 | [
"MIT"
] | null | null | null | '''
Binary classifier and corresponding datasets : MR, CR, SUBJ, MPQA...
'''
from __future__ import absolute_import, division, unicode_literals
import io
import os
import logging
from utils.util import logger
from torch.utils.data import Dataset
from utils.util import prepare_dictionary
from tensorflow.python.keras.pr... | 38.284553 | 143 | 0.62285 | from __future__ import absolute_import, division, unicode_literals
import io
import os
import logging
from utils.util import logger
from torch.utils.data import Dataset
from utils.util import prepare_dictionary
from tensorflow.python.keras.preprocessing import sequence
class BinaryClassifierEval(Dataset):
def __... | true | true |
f7f60dcda64a6130fe6bd3fb40b538c0c91ba495 | 43 | py | Python | tests/__init__.py | DavidVinicius/python_artmap | 358d4258a80ebaf0418d48f6dd5370832774f07f | [
"MIT"
] | 2 | 2021-11-17T13:21:04.000Z | 2022-03-30T01:58:14.000Z | tests/__init__.py | DavidVinicius/python_artmap | 358d4258a80ebaf0418d48f6dd5370832774f07f | [
"MIT"
] | null | null | null | tests/__init__.py | DavidVinicius/python_artmap | 358d4258a80ebaf0418d48f6dd5370832774f07f | [
"MIT"
] | 2 | 2021-12-21T00:43:58.000Z | 2022-03-07T09:34:12.000Z | """Unit test package for python_artmap."""
| 21.5 | 42 | 0.72093 | true | true | |
f7f60e058067e9ff91e5a961528a3bbd7aa12b7d | 1,012 | py | Python | stubs.min/System/ComponentModel/__init___parts/EditorBrowsableState.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/ComponentModel/__init___parts/EditorBrowsableState.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/ComponentModel/__init___parts/EditorBrowsableState.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class EditorBrowsableState(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the browsable state of a property or method from within an editor.
enum EditorBrowsableState,values: Advanced (2),Always (0),Never (1)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq_... | 28.914286 | 215 | 0.670949 | class EditorBrowsableState(Enum,IComparable,IFormattable,IConvertible):
pass
""" __format__(formattable: IFormattable,format: str) -> str """
pass
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) ini... | true | true |
f7f60f1a930ca663a148143743590384100e3f24 | 8,621 | py | Python | tests/test_data_loaders.py | ammokhov/cloudformation-cli | 419d22a2b9aaaa8b12ec2b4cd0d6b04058b9f8f5 | [
"Apache-2.0"
] | null | null | null | tests/test_data_loaders.py | ammokhov/cloudformation-cli | 419d22a2b9aaaa8b12ec2b4cd0d6b04058b9f8f5 | [
"Apache-2.0"
] | null | null | null | tests/test_data_loaders.py | ammokhov/cloudformation-cli | 419d22a2b9aaaa8b12ec2b4cd0d6b04058b9f8f5 | [
"Apache-2.0"
] | null | null | null | # fixture and parameter have the same name
# pylint: disable=redefined-outer-name
# pylint: disable=import-outside-toplevel
import json
from contextlib import contextmanager
from io import BytesIO, StringIO
from pathlib import Path
from subprocess import check_output
from unittest.mock import ANY, create_autospec, patc... | 30.143357 | 86 | 0.702239 |
import json
from contextlib import contextmanager
from io import BytesIO, StringIO
from pathlib import Path
from subprocess import check_output
from unittest.mock import ANY, create_autospec, patch
import pytest
import yaml
from jsonschema.exceptions import RefResolutionError, ValidationError
from pytest_localserve... | true | true |
f7f610cb2c1f36ae5aef88883cea356ae96bd09a | 1,174 | py | Python | runtests.py | StreetVoice/django-celery-ses | db25ad23b0ea01d9054e7d3f2481387488dcb809 | [
"MIT"
] | 18 | 2015-05-14T09:54:15.000Z | 2022-03-08T06:59:32.000Z | runtests.py | StreetVoice/django-celery-ses | db25ad23b0ea01d9054e7d3f2481387488dcb809 | [
"MIT"
] | 14 | 2017-02-23T08:49:17.000Z | 2021-03-26T07:22:52.000Z | runtests.py | StreetVoice/django-celery-ses | db25ad23b0ea01d9054e7d3f2481387488dcb809 | [
"MIT"
] | 9 | 2015-06-15T09:31:36.000Z | 2021-12-25T08:49:05.000Z | #!/usr/bin/env python
import sys
from os.path import dirname, abspath
from django.conf import settings
import django
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
MIDDLEWARE_CLASSES=[],
INSTALLED_... | 23.48 | 73 | 0.653322 |
import sys
from os.path import dirname, abspath
from django.conf import settings
import django
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
MIDDLEWARE_CLASSES=[],
INSTALLED_APPS=[
'djang... | true | true |
f7f6112f0313a638854d1e74f9eb0e36796d4115 | 5,828 | py | Python | codes/torch2onnx.py | sanchitvohra/EGVSR | c8927c3aa876fac8ce2508b00c6ed3a3d6df226c | [
"MIT"
] | 709 | 2021-04-27T12:12:32.000Z | 2022-03-31T02:02:29.000Z | codes/torch2onnx.py | sanchitvohra/EGVSR | c8927c3aa876fac8ce2508b00c6ed3a3d6df226c | [
"MIT"
] | 14 | 2021-07-13T12:04:42.000Z | 2022-03-17T12:10:51.000Z | codes/torch2onnx.py | riverlight/egvsr | 3c0b478179f772d7fe7521655008a2d79a6b6185 | [
"MIT"
] | 90 | 2021-07-07T18:35:18.000Z | 2022-03-30T07:01:44.000Z | import os
import os.path as osp
import argparse
import yaml
import time
import torch
from data import create_dataloader, prepare_data
from models import define_model
from models.networks import define_generator
from utils import base_utils, data_utils
from metrics.model_summary import register, profile_model
def test... | 34.081871 | 123 | 0.579444 | import os
import os.path as osp
import argparse
import yaml
import time
import torch
from data import create_dataloader, prepare_data
from models import define_model
from models.networks import define_generator
from utils import base_utils, data_utils
from metrics.model_summary import register, profile_model
def test... | true | true |
f7f611790b6f8332813be1710663a28bfb2d2f53 | 122 | py | Python | CodeChef/life_the_universe_and_everything.py | pybae/etc | ba3d6291ed5dd8e6b6ee18b186a09600def56505 | [
"MIT"
] | null | null | null | CodeChef/life_the_universe_and_everything.py | pybae/etc | ba3d6291ed5dd8e6b6ee18b186a09600def56505 | [
"MIT"
] | null | null | null | CodeChef/life_the_universe_and_everything.py | pybae/etc | ba3d6291ed5dd8e6b6ee18b186a09600def56505 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
num = int(input())
while (num != 42):
print num
num = int(input())
| 15.25 | 23 | 0.532787 |
num = int(input())
while (num != 42):
print num
num = int(input())
| false | true |
f7f6117cd34c38631d51b40d275abe103ca922f6 | 221 | py | Python | recommender/recommender/utils.py | cnam0203/trivi-backend | d6a4c6c600bdf22fd45c72c25c7ab55281339a0c | [
"MIT"
] | 1 | 2020-06-24T04:44:33.000Z | 2020-06-24T04:44:33.000Z | recommender/recommender/utils.py | cnam0203/trivi-backend | d6a4c6c600bdf22fd45c72c25c7ab55281339a0c | [
"MIT"
] | 23 | 2020-08-15T15:18:32.000Z | 2022-02-26T13:49:05.000Z | recommender/recommender/utils.py | cnam0203/trivi-backend | d6a4c6c600bdf22fd45c72c25c7ab55281339a0c | [
"MIT"
] | 1 | 2021-05-12T19:08:52.000Z | 2021-05-12T19:08:52.000Z | from core.serializers import UserSerializer
def my_jwt_response_handler(token, user=None, request=None):
return {
'token': token,
'user': UserSerializer(user, context={'request': request}).data
} | 27.625 | 71 | 0.687783 | from core.serializers import UserSerializer
def my_jwt_response_handler(token, user=None, request=None):
return {
'token': token,
'user': UserSerializer(user, context={'request': request}).data
} | true | true |
f7f6122f701a186a7b0edb689dc21091a0299482 | 2,469 | py | Python | simple_weather_bot/api.py | hexfaker/simple-weather-bot | 330a4bc2fcf1b7892f514ee5a198d62a9f7b4039 | [
"MIT"
] | 2 | 2020-08-15T04:54:01.000Z | 2020-08-15T07:37:35.000Z | simple_weather_bot/api.py | hexfaker/simple-weather-bot | 330a4bc2fcf1b7892f514ee5a198d62a9f7b4039 | [
"MIT"
] | 5 | 2020-08-17T06:05:13.000Z | 2020-09-07T05:52:24.000Z | simple_weather_bot/api.py | hexfaker/simple-weather-bot | 330a4bc2fcf1b7892f514ee5a198d62a9f7b4039 | [
"MIT"
] | null | null | null | import datetime as dt
from datetime import datetime
from typing import List, Tuple
import httpx
import pytz
from pydantic import BaseModel, Extra
class Coords(BaseModel):
lat: float
lng: float
class Temp(BaseModel):
day: float
min: float
max: float
night: float
eve: float
morn: floa... | 22.044643 | 80 | 0.594168 | import datetime as dt
from datetime import datetime
from typing import List, Tuple
import httpx
import pytz
from pydantic import BaseModel, Extra
class Coords(BaseModel):
lat: float
lng: float
class Temp(BaseModel):
day: float
min: float
max: float
night: float
eve: float
morn: floa... | true | true |
f7f6130f1583680d3c8dfebc6cfa38c56942fa01 | 2,801 | py | Python | scripts/shrink_multiframe.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | 197 | 2016-04-05T15:24:23.000Z | 2022-03-25T17:37:10.000Z | scripts/shrink_multiframe.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | 102 | 2017-05-12T07:08:48.000Z | 2022-03-22T00:21:54.000Z | scripts/shrink_multiframe.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | 60 | 2016-12-13T22:11:56.000Z | 2022-03-30T22:55:52.000Z | # -*- coding: utf-8 -*-
"""
dicom2nifti
@author: abrys
"""
import dicom
import os
import logging
import numpy
import dicom2nifti.compressed_dicom as compressed_dicom
from dicom2nifti.convert_philips import _is_multiframe_diffusion_imaging, _is_multiframe_4d
import dicom2nifti.common as common
def shrink_multifram... | 37.346667 | 118 | 0.706176 |
import dicom
import os
import logging
import numpy
import dicom2nifti.compressed_dicom as compressed_dicom
from dicom2nifti.convert_philips import _is_multiframe_diffusion_imaging, _is_multiframe_4d
import dicom2nifti.common as common
def shrink_multiframe(input_file, output_file=None, slice_count=8, timepoint_co... | true | true |
f7f613558782a2fe3923d40460c1a5481f291029 | 1,748 | py | Python | examples/libs_and_modules_usage_example.py | dariaomelkina/UCU-Semester-Homework | c980d467e9eba3ab64c4db36c66c20ac92c7ba00 | [
"MIT"
] | 1 | 2020-05-19T09:03:46.000Z | 2020-05-19T09:03:46.000Z | examples/libs_and_modules_usage_example.py | dariaomelkina/UCU-Semester-Homework | c980d467e9eba3ab64c4db36c66c20ac92c7ba00 | [
"MIT"
] | 3 | 2020-04-04T17:17:29.000Z | 2020-05-19T09:24:51.000Z | examples/libs_and_modules_usage_example.py | dariaomelkina/UCU-Semester-Homework | c980d467e9eba3ab64c4db36c66c20ac92c7ba00 | [
"MIT"
] | 1 | 2020-05-19T09:20:06.000Z | 2020-05-19T09:20:06.000Z | import json
import dash
import urllib.request
import urllib.parse
import dash_core_components as dcc
import dash_html_components as html
import pandas
import plotly.express as px
BASE_URL = "https://api.nasa.gov/insight_weather/?api_key=DEMO_KEY&feedtype=json&ver=1.0"
def get_data_from_URL(base_url):
with urllib... | 26.089552 | 109 | 0.64016 | import json
import dash
import urllib.request
import urllib.parse
import dash_core_components as dcc
import dash_html_components as html
import pandas
import plotly.express as px
BASE_URL = "https://api.nasa.gov/insight_weather/?api_key=DEMO_KEY&feedtype=json&ver=1.0"
def get_data_from_URL(base_url):
with urllib... | true | true |
f7f613613fa113d1598211dd71d00a197d13b649 | 1,032 | py | Python | vdgnn/options/train_options.py | HCY123902/visdial-gnn | c38090c672cdf04a4fabe139f96d944fd82cb123 | [
"MIT"
] | 44 | 2019-04-24T22:44:52.000Z | 2022-03-15T07:09:38.000Z | vdgnn/options/train_options.py | HCY123902/visdial-gnn | c38090c672cdf04a4fabe139f96d944fd82cb123 | [
"MIT"
] | 1 | 2019-06-18T15:38:10.000Z | 2020-01-14T01:13:26.000Z | vdgnn/options/train_options.py | HCY123902/visdial-gnn | c38090c672cdf04a4fabe139f96d944fd82cb123 | [
"MIT"
] | 5 | 2019-04-25T07:13:49.000Z | 2021-06-22T16:33:54.000Z | from .base_options import BaseOptions
class TrainOptions(BaseOptions):
"""Training Options"""
def initialize(self, parser):
paser = BaseOptions.initialize(self, parser)
# Optimization settings
parser.add_argument_group('Optimization specific arguments')
parser.add_argument('--n... | 51.6 | 117 | 0.697674 | from .base_options import BaseOptions
class TrainOptions(BaseOptions):
def initialize(self, parser):
paser = BaseOptions.initialize(self, parser)
parser.add_argument_group('Optimization specific arguments')
parser.add_argument('--num_epochs', default=20, type=int, help='maximum ep... | true | true |
f7f6140a72358545584918dc768ff8897df5c7b2 | 1,921 | py | Python | src/paralleling/train_predict/cross_validation.py | tpinhoda/Graph-Based_Spatial_Cross_Validation | 19300a715d3d03580232926bbc1f6ea8800b23e3 | [
"MIT"
] | null | null | null | src/paralleling/train_predict/cross_validation.py | tpinhoda/Graph-Based_Spatial_Cross_Validation | 19300a715d3d03580232926bbc1f6ea8800b23e3 | [
"MIT"
] | null | null | null | src/paralleling/train_predict/cross_validation.py | tpinhoda/Graph-Based_Spatial_Cross_Validation | 19300a715d3d03580232926bbc1f6ea8800b23e3 | [
"MIT"
] | null | null | null | import contextlib
import os
import sys
import pandas as pd
import geopandas as gpd
from weka.core import jvm
from src import utils
from src.pipeline import Pipeline
from src.visualization.performance import VizMetrics
from src.visualization.dependence import VizDependence
# Set pipeline switchers
SWITCHERS = {
"sc... | 25.276316 | 98 | 0.665799 | import contextlib
import os
import sys
import pandas as pd
import geopandas as gpd
from weka.core import jvm
from src import utils
from src.pipeline import Pipeline
from src.visualization.performance import VizMetrics
from src.visualization.dependence import VizDependence
SWITCHERS = {
"scv": False,
"fs": Fal... | true | true |
f7f615c49cc2c48e234c32557bb12b8ab262ca77 | 3,573 | py | Python | util/kalman2d.py | jingliinpurdue/Fast-and-Robust-UAV-to-UAV-Detection-and-Tracking | 317e85a03f5c374ef8ec53b543208ec36655fa07 | [
"BSD-3-Clause"
] | 7 | 2020-02-12T15:34:20.000Z | 2022-02-26T19:57:22.000Z | util/kalman2d.py | jingliinpurdue/Fast-and-Robust-UAV-to-UAV-Detection-and-Tracking | 317e85a03f5c374ef8ec53b543208ec36655fa07 | [
"BSD-3-Clause"
] | null | null | null | util/kalman2d.py | jingliinpurdue/Fast-and-Robust-UAV-to-UAV-Detection-and-Tracking | 317e85a03f5c374ef8ec53b543208ec36655fa07 | [
"BSD-3-Clause"
] | 9 | 2019-08-30T00:44:37.000Z | 2021-11-22T07:16:26.000Z | # Opencv 2---Version
# -*- coding: utf-8 -*-
'''
kalman2d - 2D Kalman filter using OpenCV
Based on http://jayrambhia.wordpress.com/2012/07/26/kalman-filter/
Copyright (C) 2014 Simon D. Levy
This code is free software: you can redistribute it and/or modify
it under the terms of the GNU... | 41.068966 | 141 | 0.623286 |
import cv2
import numpy as np
class Kalman2D(object):
def __init__(self, processNoiseCovariance=1e-4, measurementNoiseCovariance=1e-1, errorCovariancePost=0.1):
self.kalman = cv2.KalmanFilter(4, 2, 0)
self.kalman_measurement = np.array([[1.],[1.]],np.float32)
... | true | true |
f7f615c5498020c52d6fd362f6b4133390c793ea | 14,407 | py | Python | pavement.py | illume/numpy3k | 42171a679b0ef24932fe08fc88cce039abf6de2b | [
"BSD-3-Clause"
] | 2 | 2020-07-03T12:00:29.000Z | 2021-04-18T06:54:30.000Z | pavement.py | plaes/numpy | 209866bc55eee56e92692307c4437af024bae87d | [
"BSD-3-Clause"
] | null | null | null | pavement.py | plaes/numpy | 209866bc55eee56e92692307c4437af024bae87d | [
"BSD-3-Clause"
] | null | null | null | """
This paver file is intented to help with the release process as much as
possible. It relies on virtualenv to generate 'bootstrap' environments as
independent from the user system as possible (e.g. to make sure the sphinx doc
is built against the built numpy, not an installed one).
Building a fancy dmg from scratch... | 31.873894 | 116 | 0.66669 | """
This paver file is intented to help with the release process as much as
possible. It relies on virtualenv to generate 'bootstrap' environments as
independent from the user system as possible (e.g. to make sure the sphinx doc
is built against the built numpy, not an installed one).
Building a fancy dmg from scratch... | false | true |
f7f6174e028a850a6d5030423ba6a670970fd734 | 3,413 | py | Python | ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py | rivamarco/alexa-apis-for-python | 62e3a9057a26003e836fa09aa12a2e1c8b62d6e0 | [
"Apache-2.0"
] | 2 | 2021-10-30T06:52:48.000Z | 2021-11-16T12:34:16.000Z | ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py | Shreyas-vgr/alexa-apis-for-python | 74ea73b3b6a03fd9cb735fb8c1fb2bd961faab54 | [
"Apache-2.0"
] | null | null | null | ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py | Shreyas-vgr/alexa-apis-for-python | 74ea73b3b6a03fd9cb735fb8c1fb2bd961faab54 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 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 "lice... | 29.422414 | 96 | 0.570173 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
class ValueCatalog(object):
deserialized_types = {
'id': 'str',
'version': 'str'
}
attr... | true | true |
f7f61882ca348a1ea42673283d7a4047a053d4fe | 2,501 | py | Python | src/wi/urls/user/public_ip.py | cc1-cloud/cc1 | 8113673fa13b6fe195cea99dedab9616aeca3ae8 | [
"Apache-2.0"
] | 11 | 2015-05-06T14:16:54.000Z | 2022-02-08T23:21:31.000Z | src/wi/urls/user/public_ip.py | fortress-shell/cc1 | 8113673fa13b6fe195cea99dedab9616aeca3ae8 | [
"Apache-2.0"
] | 1 | 2015-10-30T21:08:11.000Z | 2015-10-30T21:08:11.000Z | src/wi/urls/user/public_ip.py | fortress-shell/cc1 | 8113673fa13b6fe195cea99dedab9616aeca3ae8 | [
"Apache-2.0"
] | 5 | 2016-02-12T22:01:38.000Z | 2021-12-06T16:56:54.000Z | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | 43.12069 | 141 | 0.676529 |
from django.conf.urls import patterns, url, include
from django.utils.translation import ugettext_lazy as _
from wi.utils.decorators import user_permission
from wi.utils.views import direct_to_template, get_list_generic, simple_generic, simple_generic_id
resources_patterns = patterns('wi.views.us... | true | true |
f7f61928737aa0f7253f968e5d6b948b5441f4c1 | 258 | py | Python | LeetCode/Palindrome Number/solution.py | anirbandey303/Hack-Codes | a75555e439529aa3e37a0fe59b1d4a4644625eec | [
"MIT"
] | 15 | 2021-10-06T07:34:15.000Z | 2022-01-25T06:58:59.000Z | LeetCode/Palindrome Number/solution.py | anirbandey303/Hack-Codes | a75555e439529aa3e37a0fe59b1d4a4644625eec | [
"MIT"
] | 55 | 2021-10-01T19:23:51.000Z | 2021-10-06T04:29:41.000Z | LeetCode/Palindrome Number/solution.py | anirbandey303/Hack-Codes | a75555e439529aa3e37a0fe59b1d4a4644625eec | [
"MIT"
] | 41 | 2021-10-01T19:30:51.000Z | 2021-10-05T19:36:15.000Z | # Author : thepmsquare
# Question Link : https://leetcode.com/problems/palindrome-number/
class Solution:
def isPalindrome(self, x: int) -> bool:
tempList = list(str(x))
tempList.reverse()
return str(x)=="".join(tempList)
| 32.25 | 66 | 0.627907 |
class Solution:
def isPalindrome(self, x: int) -> bool:
tempList = list(str(x))
tempList.reverse()
return str(x)=="".join(tempList)
| true | true |
f7f619864c8f96a2be2e0c7df6e83578cce34cf3 | 2,440 | py | Python | prototype/migrations/0001_initial.py | benthomasson/fsm-designer-svg | a1edbde3ac7e497e3700e38ed4741da75d376e6f | [
"BSD-3-Clause"
] | null | null | null | prototype/migrations/0001_initial.py | benthomasson/fsm-designer-svg | a1edbde3ac7e497e3700e38ed4741da75d376e6f | [
"BSD-3-Clause"
] | 7 | 2020-01-03T14:37:56.000Z | 2021-06-10T20:39:35.000Z | prototype/migrations/0001_initial.py | benthomasson/fsm-designer-svg | a1edbde3ac7e497e3700e38ed4741da75d376e6f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('client_id', models.AutoFiel... | 36.41791 | 104 | 0.547951 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('client_id', models.AutoField(serialize=False, prim... | true | true |
f7f619b71ac85a55e2e7dbdda5f259471ca00f73 | 6,500 | py | Python | tests/test_train_utils.py | lzamparo/SeqDemote | 3eaf18e88c9dc6a3d1a69444ecdba9f9b5d9682a | [
"MIT"
] | 1 | 2019-04-16T12:25:09.000Z | 2019-04-16T12:25:09.000Z | tests/test_train_utils.py | lzamparo/SeqDemote | 3eaf18e88c9dc6a3d1a69444ecdba9f9b5d9682a | [
"MIT"
] | null | null | null | tests/test_train_utils.py | lzamparo/SeqDemote | 3eaf18e88c9dc6a3d1a69444ecdba9f9b5d9682a | [
"MIT"
] | null | null | null | import os
import numpy as np
from nose.tools import eq_, ok_
import torch
import utils.train_utils as tr_utils
import utils.torch_model_construction_utils as tmu
def flip_random(data, num_labels):
''' return a column of 0,1 labels with num_labels flipped '''
length = data.shape[0]
flip_positions = np.ran... | 37.572254 | 134 | 0.680615 | import os
import numpy as np
from nose.tools import eq_, ok_
import torch
import utils.train_utils as tr_utils
import utils.torch_model_construction_utils as tmu
def flip_random(data, num_labels):
length = data.shape[0]
flip_positions = np.random.randint(0,length,num_labels)
for position in flip_position... | true | true |
f7f61ac219d2200b7e65d0eae4084e04ebd39cfb | 24 | py | Python | code/abc011_1_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc011_1_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc011_1_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | print(int(input())%12+1) | 24 | 24 | 0.666667 | print(int(input())%12+1) | true | true |
f7f61af76a6a9b609a1164d84c74f64ac50a6624 | 2,502 | py | Python | src/experiment/model_management.py | jp2011/spatial-poisson-mixtures | 9e535a636e710a9fa146cbbd4613ece70ec90791 | [
"MIT"
] | 3 | 2020-06-18T10:57:47.000Z | 2022-03-07T12:13:04.000Z | src/experiment/model_management.py | jp2011/spatial-poisson-mixtures | 9e535a636e710a9fa146cbbd4613ece70ec90791 | [
"MIT"
] | null | null | null | src/experiment/model_management.py | jp2011/spatial-poisson-mixtures | 9e535a636e710a9fa146cbbd4613ece70ec90791 | [
"MIT"
] | null | null | null | def build_lgcp_uid(*, prefix='LGCP-MATERN',
chain_no=None,
c_type='burglary',
t_period='12015-122015',
cov_interpolation='weighted',
model_spec=None,
... | 55.6 | 156 | 0.489608 | def build_lgcp_uid(*, prefix='LGCP-MATERN',
chain_no=None,
c_type='burglary',
t_period='12015-122015',
cov_interpolation='weighted',
model_spec=None,
... | true | true |
f7f61bdf68268541e60328e74350d25de8671d0f | 3,230 | py | Python | example_new_surface.py | gerph/cairo-vnc | 505d12e4404954d59c879a34c5f2c427aa4fe354 | [
"MIT"
] | 3 | 2020-12-29T20:53:03.000Z | 2020-12-30T19:50:49.000Z | example_new_surface.py | gerph/cairo-vnc | 505d12e4404954d59c879a34c5f2c427aa4fe354 | [
"MIT"
] | null | null | null | example_new_surface.py | gerph/cairo-vnc | 505d12e4404954d59c879a34c5f2c427aa4fe354 | [
"MIT"
] | null | null | null | """
Demonstrate that we can change the surface, and its size, as we go.
Run a simple animation in the Cairo surface, on a thread.
Then run a server on localhost:5902 / localhost:2 which should display the animation.
Every 20 frames, the surface is recreated at a different size.
Each time it is recreated, we must noti... | 28.584071 | 87 | 0.614241 |
import math
import threading
import time
import cairo
import cairovnc
class Screen(object):
surface_change_func = None
def __init__(self):
self.width = 200
self.height = 200
self.seq = 0
self.setup_surface()
def setup_surface(self):
self.surface = cairo.ImageSu... | true | true |
f7f61be8f8402c2241c0bd4880a84e01f0b1528c | 27,622 | py | Python | main_dasalc.py | albpurpura/PLTR | e21d3eb24fb0d269abd68ba23677501c30bb08eb | [
"CC0-1.0"
] | 1 | 2022-02-16T02:00:17.000Z | 2022-02-16T02:00:17.000Z | main_dasalc.py | albpurpura/PLTR | e21d3eb24fb0d269abd68ba23677501c30bb08eb | [
"CC0-1.0"
] | null | null | null | main_dasalc.py | albpurpura/PLTR | e21d3eb24fb0d269abd68ba23677501c30bb08eb | [
"CC0-1.0"
] | null | null | null | import argparse
import logging
import os
import time
import uuid
import numpy as np
import pyltr
import tensorflow as tf
from evaluation import compute_mean_ndcg, compute_perf_metrics, create_trec_eval_format_run_qrels
from lambdamart import compute_lambdamart_preds
# from model import ReRanker
from dasalc_model impo... | 47.297945 | 126 | 0.644269 | import argparse
import logging
import os
import time
import uuid
import numpy as np
import pyltr
import tensorflow as tf
from evaluation import compute_mean_ndcg, compute_perf_metrics, create_trec_eval_format_run_qrels
from lambdamart import compute_lambdamart_preds
from dasalc_model import ReRanker
from simulate_u... | true | true |
f7f61d2a04987f6fe04d2820f1e8691e461e18dd | 101,179 | py | Python | tensorflow/python/keras/engine/training.py | tatatodd/tensorflow | e469ccf50312fef277eb0fe55b04992f7974a35e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/engine/training.py | tatatodd/tensorflow | e469ccf50312fef277eb0fe55b04992f7974a35e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/engine/training.py | tatatodd/tensorflow | e469ccf50312fef277eb0fe55b04992f7974a35e | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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.517849 | 99 | 0.646379 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import weakref
import numpy as np
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.ops import iterator_ops
from tensorflow.python.eager import context
from tensorflo... | true | true |
f7f61f880dcad8ecfd1738ddd2e109a7c334617b | 4,606 | py | Python | py3plex/algorithms/multilayer_algorithms/entanglement.py | awesome-archive/Py3plex | a099acb992441c1630208ba13694acb8e2a38895 | [
"BSD-3-Clause"
] | null | null | null | py3plex/algorithms/multilayer_algorithms/entanglement.py | awesome-archive/Py3plex | a099acb992441c1630208ba13694acb8e2a38895 | [
"BSD-3-Clause"
] | null | null | null | py3plex/algorithms/multilayer_algorithms/entanglement.py | awesome-archive/Py3plex | a099acb992441c1630208ba13694acb8e2a38895 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Authors: Benjamin Renoust (github.com/renoust)
Date: 2018/02/13
Description: Loads a Detangler JSON format graph and compute unweighted entanglement analysis with Py3Plex
"""
import sys
print(sys.version)
import networkx as nx
from scipy.sparse.csgraph import cs... | 30.104575 | 112 | 0.649587 |
import sys
print(sys.version)
import networkx as nx
from scipy.sparse.csgraph import csgraph_from_dense, connected_components
from scipy import spatial
import numpy as np
import itertools
import math
def build_occurrence_matrix(network):
multiedges = network.get_edges()
layers = []
edge_list = []
... | true | true |
f7f61f99b14ff05744c7eb403d860339bcd27eae | 3,970 | py | Python | auth/decorators.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | auth/decorators.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | auth/decorators.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | import logging
from functools import wraps
from flask import request, session
from prometheus_client import Counter
from auth.basic import validate_basic_auth
from auth.oauth import validate_bearer_auth
from auth.cookie import validate_session_cookie
from auth.signedgrant import validate_signed_grant
from util.http ... | 35.446429 | 101 | 0.668766 | import logging
from functools import wraps
from flask import request, session
from prometheus_client import Counter
from auth.basic import validate_basic_auth
from auth.oauth import validate_bearer_auth
from auth.cookie import validate_session_cookie
from auth.signedgrant import validate_signed_grant
from util.http ... | true | true |
f7f61fb1356bf9e8bfac36908160f8966f6e6289 | 2,026 | py | Python | research/mobilenet/mobilenet_v2.py | luotigerlsx/models_archive | c6578521ae61df7298003b42526b03e78d2d0d4b | [
"Apache-2.0"
] | null | null | null | research/mobilenet/mobilenet_v2.py | luotigerlsx/models_archive | c6578521ae61df7298003b42526b03e78d2d0d4b | [
"Apache-2.0"
] | null | null | null | research/mobilenet/mobilenet_v2.py | luotigerlsx/models_archive | c6578521ae61df7298003b42526b03e78d2d0d4b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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 applicable ... | 30.238806 | 79 | 0.701382 |
import logging
import tensorflow as tf
from research.mobilenet import common_modules
from research.mobilenet.configs import archs
layers = tf.keras.layers
MobileNetV2Config = archs.MobileNetV2Config
def mobilenet_v2(config: MobileNetV2Config = MobileNetV2Config()
) -> tf.keras.mode... | true | true |
f7f61fb47b9b9567919108098fa7b08c5a6188c7 | 1,419 | py | Python | test/programytest/clients/restful/test_client.py | whackur/chatbot | bb4b4dace89f1f8aae2b6377bf7d2601e66af7a7 | [
"MIT"
] | 2 | 2018-06-16T09:32:22.000Z | 2019-07-21T13:16:00.000Z | test/programytest/clients/restful/test_client.py | whackur/chatbot | bb4b4dace89f1f8aae2b6377bf7d2601e66af7a7 | [
"MIT"
] | 3 | 2020-07-16T04:00:42.000Z | 2021-03-31T18:52:22.000Z | test/programytest/clients/restful/test_client.py | whackur/chatbot | bb4b4dace89f1f8aae2b6377bf7d2601e66af7a7 | [
"MIT"
] | 4 | 2018-06-29T23:50:44.000Z | 2020-11-05T08:13:47.000Z | import unittest
import unittest.mock
import os
from programy.clients.restful.client import RestBotClient
from programy.clients.restful.config import RestConfiguration
from programytest.clients.arguments import MockArgumentParser
class RestBotClientTests(unittest.TestCase):
def test_init(self):
arguments... | 38.351351 | 133 | 0.731501 | import unittest
import unittest.mock
import os
from programy.clients.restful.client import RestBotClient
from programy.clients.restful.config import RestConfiguration
from programytest.clients.arguments import MockArgumentParser
class RestBotClientTests(unittest.TestCase):
def test_init(self):
arguments... | true | true |
f7f61fda483a69cbbb1c7b5f71d1d2b4aed05efb | 5,420 | py | Python | configtree/formatter.py | Cottonwood-Technology/ConfigTree | ce7d92a4e536ba0104b92a9ce871819279f5b63a | [
"BSD-2-Clause"
] | null | null | null | configtree/formatter.py | Cottonwood-Technology/ConfigTree | ce7d92a4e536ba0104b92a9ce871819279f5b63a | [
"BSD-2-Clause"
] | null | null | null | configtree/formatter.py | Cottonwood-Technology/ConfigTree | ce7d92a4e536ba0104b92a9ce871819279f5b63a | [
"BSD-2-Clause"
] | null | null | null | """
The module provides formatters of :class:`configtree.tree.Tree` objects
.. data:: map
Dictionary that stores map of formatters. It is filled using
`entry points`_ named ``configtree.formatter``. But can be also modified
within ``loaderconf.py`` module to add ad hoc formatter.
See :mod:`configtr... | 29.139785 | 87 | 0.586347 |
import json
from os import linesep
from pkg_resources import iter_entry_points
from numbers import Number
from .tree import rarefy
from .compat.types import string, chars
from .compat.colabc import Mapping, Sequence
def option(name, **kw):
def decorator(f):
if not hasattr(f, "__options__"):
... | true | true |
f7f6205dc7b35a9a40fd2de82c28be05ca417e97 | 398 | py | Python | backend/personal_area/logout.py | DuMoH112/cloud_strorage | f995f9a71c9317493e3092a7ec31108afbdc8e05 | [
"MIT"
] | null | null | null | backend/personal_area/logout.py | DuMoH112/cloud_strorage | f995f9a71c9317493e3092a7ec31108afbdc8e05 | [
"MIT"
] | null | null | null | backend/personal_area/logout.py | DuMoH112/cloud_strorage | f995f9a71c9317493e3092a7ec31108afbdc8e05 | [
"MIT"
] | null | null | null | from flask import Blueprint, request, jsonify
from Database.redis import Redis_db
from app.auth_utils import auth_user
logout_bp = Blueprint('logout', __name__)
@logout_bp.route('/back/logout', methods=['GET'])
@auth_user(name_func='logout')
def logout(user):
"""Logout Page"""
r = Redis_db()
r.del_user... | 23.411765 | 58 | 0.71608 | from flask import Blueprint, request, jsonify
from Database.redis import Redis_db
from app.auth_utils import auth_user
logout_bp = Blueprint('logout', __name__)
@logout_bp.route('/back/logout', methods=['GET'])
@auth_user(name_func='logout')
def logout(user):
r = Redis_db()
r.del_user(user.get_token())
... | true | true |
f7f6211b797e00065bc1601dcbb284e1adc5b5af | 2,631 | py | Python | setup.py | zyfra/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 270 | 2019-11-14T15:46:08.000Z | 2021-09-17T16:43:03.000Z | setup.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 14 | 2019-11-29T11:49:39.000Z | 2022-02-10T00:23:59.000Z | setup.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 18 | 2019-11-22T13:15:14.000Z | 2021-09-01T13:36:12.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
# allow setup.py to run from another directory
here = os.path.di... | 30.241379 | 96 | 0.607754 |
from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
here = os.path.dirname(__file__)
here and os.chdir(here)
def read(*names, **kwargs):
with io.open(
... | true | true |
f7f6216882e151130b9369db9dec41cc28f56169 | 258 | py | Python | publicdata/chis/__init__.py | CivicKnowledge/publicdata | 37210e3c3b89cf8068feb79a2f12923b3cb5c336 | [
"MIT"
] | 2 | 2017-10-10T18:53:40.000Z | 2020-05-28T21:49:01.000Z | publicdata/chis/__init__.py | CivicKnowledge/publicdata | 37210e3c3b89cf8068feb79a2f12923b3cb5c336 | [
"MIT"
] | 7 | 2018-10-02T15:53:22.000Z | 2019-01-27T23:06:32.000Z | publicdata/chis/__init__.py | CivicKnowledge/publicdata | 37210e3c3b89cf8068feb79a2f12923b3cb5c336 | [
"MIT"
] | 2 | 2018-08-31T15:46:52.000Z | 2019-09-18T05:31:28.000Z | # Copyright (c) 2017 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE
"""
Functions for preparing a chis dataset
"""
from .prepare import *
from .estimate import *
from .recode import *
| 21.5 | 82 | 0.748062 |
from .prepare import *
from .estimate import *
from .recode import *
| true | true |
f7f621887740e725fb50e66b26597cdd9e419226 | 25,090 | py | Python | espnet/tts/pytorch_backend/tts.py | kokeshing/espnet | 9e2bfc5cdecbb8846f5c6cb26d22010b06e98c40 | [
"Apache-2.0"
] | null | null | null | espnet/tts/pytorch_backend/tts.py | kokeshing/espnet | 9e2bfc5cdecbb8846f5c6cb26d22010b06e98c40 | [
"Apache-2.0"
] | null | null | null | espnet/tts/pytorch_backend/tts.py | kokeshing/espnet | 9e2bfc5cdecbb8846f5c6cb26d22010b06e98c40 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Nagoya University (Tomoki Hayashi)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""E2E-TTS training / decoding functions."""
import copy
import json
import logging
import math
import os
import time
import chainer
import kaldiio
import nu... | 39.080997 | 110 | 0.60004 |
import copy
import json
import logging
import math
import os
import time
import chainer
import kaldiio
import numpy as np
import torch
from chainer import training
from chainer.training import extensions
from espnet.asr.asr_utils import get_model_conf
from espnet.asr.asr_utils import snapshot_object
from espn... | true | true |
f7f6220819e6f4f96c45892c8c216ab4d391c4d5 | 9,326 | py | Python | scripts/2d_recon.py | JulianKnodt/nerf_atlas | 6866713c498cea026cb215260a779a2c6c13246c | [
"Apache-2.0"
] | 57 | 2021-05-25T12:57:16.000Z | 2022-03-30T06:27:44.000Z | scripts/2d_recon.py | JulianKnodt/nerf_atlas | 6866713c498cea026cb215260a779a2c6c13246c | [
"Apache-2.0"
] | 9 | 2021-07-26T22:28:40.000Z | 2021-11-29T20:51:59.000Z | scripts/2d_recon.py | JulianKnodt/nerf_atlas | 6866713c498cea026cb215260a779a2c6c13246c | [
"Apache-2.0"
] | 12 | 2021-05-25T12:36:45.000Z | 2022-01-28T04:20:12.000Z | import sys
sys.path[0] = sys.path[0][:-len("scripts/")] # hacky way to treat it as root directory
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision as tv
from src.neural_blocks import ( SkipConnMLP, FourierEncoder )
from src.utils import ( fat_sigmoid )
from tqdm impor... | 33.188612 | 96 | 0.63768 | import sys
sys.path[0] = sys.path[0][:-len("scripts/")]
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision as tv
from src.neural_blocks import ( SkipConnMLP, FourierEncoder )
from src.utils import ( fat_sigmoid )
from tqdm import trange
ts = 100
epochs = 20_000
SCALE ... | true | true |
f7f62309a2f4b85e6994a7539ff6dee29a8fb9ef | 2,576 | py | Python | finetune.py | ytian81/CarND-Behavioral-Cloning-P3 | df912ae149035330f4e6be8a6c76a3271d522611 | [
"MIT"
] | null | null | null | finetune.py | ytian81/CarND-Behavioral-Cloning-P3 | df912ae149035330f4e6be8a6c76a3271d522611 | [
"MIT"
] | null | null | null | finetune.py | ytian81/CarND-Behavioral-Cloning-P3 | df912ae149035330f4e6be8a6c76a3271d522611 | [
"MIT"
] | null | null | null | from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.layers import Activation, Conv2D, Cropping2D, Dense, Dropout, Flatten, Lambda, MaxPool2D
from keras.models import Sequential
from keras.regularizers import l2
from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.models import load_mo... | 35.287671 | 104 | 0.707686 | from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.layers import Activation, Conv2D, Cropping2D, Dense, Dropout, Flatten, Lambda, MaxPool2D
from keras.models import Sequential
from keras.regularizers import l2
from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.models import load_mo... | true | true |
f7f6233350d37c396d4bbf276e3b86cc1cc9dd2f | 11,352 | py | Python | ml/rl/training/sac_trainer.py | johncliu/Horizon | cfa7a873ada5de3bb01e78e2f237d9849b8270b2 | [
"BSD-3-Clause"
] | null | null | null | ml/rl/training/sac_trainer.py | johncliu/Horizon | cfa7a873ada5de3bb01e78e2f237d9849b8270b2 | [
"BSD-3-Clause"
] | 1 | 2021-08-25T16:13:32.000Z | 2021-08-25T16:13:32.000Z | ml/rl/training/sac_trainer.py | johncliu/Horizon | cfa7a873ada5de3bb01e78e2f237d9849b8270b2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
from typing import Optional
import ml.rl.types as rlt
import numpy as np
import torch
import torch.nn.functional as F
from ml.rl.tensorboardX import SummaryWriterContext
from ml.rl.thrift.core.ttypes import S... | 38.351351 | 88 | 0.656889 |
import logging
from typing import Optional
import ml.rl.types as rlt
import numpy as np
import torch
import torch.nn.functional as F
from ml.rl.tensorboardX import SummaryWriterContext
from ml.rl.thrift.core.ttypes import SACModelParameters
from ml.rl.training._parametric_dqn_predictor import _ParametricDQNPredicto... | true | true |
f7f623553cd305bdd22a56c07eddc9471f94fad5 | 18,112 | py | Python | python/graphscope/nx/tests/classes/test_reportviews.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | 1 | 2021-12-30T02:55:16.000Z | 2021-12-30T02:55:16.000Z | python/graphscope/nx/tests/classes/test_reportviews.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | python/graphscope/nx/tests/classes/test_reportviews.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | #
# This file is referred and derived from project NetworkX
#
# which has the following license:
#
# Copyright (C) 2004-2020, NetworkX Developers
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
#
# This file is part of NetworkX.
#
# NetworkX is... | 29.450407 | 87 | 0.561396 |
import os
import networkx
import pytest
from networkx.classes.reportviews import NodeDataView
from networkx.classes.tests.test_reportviews import TestDegreeView as _TestDegreeView
from networkx.classes.tests.test_reportviews import \
TestEdgeDataView as _TestEdgeDataView
from networkx.classes.tes... | true | true |
f7f6237fc7a77c65b100bd358433e664552c0ec9 | 12,055 | py | Python | nilearn/_utils/niimg_conversions.py | agramfort/nilearn | f075440e6d97b5bf359bb25e9197dbcbbc26e5f2 | [
"BSD-2-Clause"
] | null | null | null | nilearn/_utils/niimg_conversions.py | agramfort/nilearn | f075440e6d97b5bf359bb25e9197dbcbbc26e5f2 | [
"BSD-2-Clause"
] | null | null | null | nilearn/_utils/niimg_conversions.py | agramfort/nilearn | f075440e6d97b5bf359bb25e9197dbcbbc26e5f2 | [
"BSD-2-Clause"
] | null | null | null | """
Conversion utilities.
"""
# Author: Gael Varoquaux, Alexandre Abraham, Philippe Gervais
# License: simplified BSD
import warnings
import numpy as np
import itertools
from sklearn.externals.joblib import Memory
from .cache_mixin import cache
from .niimg import _safe_get_data, load_niimg, new_img_like
from .compat ... | 36.865443 | 87 | 0.630942 |
import warnings
import numpy as np
import itertools
from sklearn.externals.joblib import Memory
from .cache_mixin import cache
from .niimg import _safe_get_data, load_niimg, new_img_like
from .compat import _basestring
def _check_fov(img, affine, shape):
img = check_niimg(img)
return (img.shape[:3] == sha... | true | true |
f7f6241ec5ac3f557a9cf8ec0c104e3f5bcfc370 | 3,780 | py | Python | advanced_filters/views.py | Bersam/django-advanced-filters | f1bcd00ed0320fd905112b72610143d1fa9a9c33 | [
"MIT"
] | null | null | null | advanced_filters/views.py | Bersam/django-advanced-filters | f1bcd00ed0320fd905112b72610143d1fa9a9c33 | [
"MIT"
] | null | null | null | advanced_filters/views.py | Bersam/django-advanced-filters | f1bcd00ed0320fd905112b72610143d1fa9a9c33 | [
"MIT"
] | 1 | 2017-01-23T19:14:35.000Z | 2017-01-23T19:14:35.000Z | from operator import itemgetter
import logging
try:
from django.apps import apps
get_model = apps.get_model
except ImportError:
# django < 1.7 support
from django.db.models import get_model
from django.conf import settings
try:
from django.contrib.admin.utils import get_fields_from_path
except Impo... | 43.448276 | 80 | 0.626984 | from operator import itemgetter
import logging
try:
from django.apps import apps
get_model = apps.get_model
except ImportError:
from django.db.models import get_model
from django.conf import settings
try:
from django.contrib.admin.utils import get_fields_from_path
except ImportError:
from... | true | true |
f7f6247b8658fcb1b45d043bf87da4f954719256 | 954 | py | Python | settings.py | jin-cc/bastion-test | 9feecbe927e5446213ab25b4da4a5eca23cf6bae | [
"Apache-2.0"
] | 8 | 2021-12-23T03:33:10.000Z | 2022-03-29T03:29:01.000Z | settings.py | jin-cc/bastion-test | 9feecbe927e5446213ab25b4da4a5eca23cf6bae | [
"Apache-2.0"
] | null | null | null | settings.py | jin-cc/bastion-test | 9feecbe927e5446213ab25b4da4a5eca23cf6bae | [
"Apache-2.0"
] | 6 | 2021-12-23T03:33:05.000Z | 2022-03-03T11:11:23.000Z | # -*- coding: utf-8 -*-
"""
请不要修改该文件
如果你需要对settings里的内容做修改,config/default.py 文件中 添加即可
如有任何疑问,请联系 【蓝鲸助手】
"""
import os
run_env = ""
# V3判断环境的环境变量为BKPAAS_ENVIRONMENT
if 'BKPAAS_ENVIRONMENT' in os.environ:
ENVIRONMENT = os.getenv('BKPAAS_ENVIRONMENT', 'dev')
run_env = "dev"
# V2判断环境的环境变量为BK_ENV
else:
PAAS_V2... | 27.257143 | 77 | 0.660377 |
import os
run_env = ""
if 'BKPAAS_ENVIRONMENT' in os.environ:
ENVIRONMENT = os.getenv('BKPAAS_ENVIRONMENT', 'dev')
run_env = "dev"
else:
PAAS_V2_ENVIRONMENT = os.environ.get('BK_ENV', 'development')
ENVIRONMENT = {
'development': 'dev',
'testing': 'stag',
'production': 'prod... | true | true |
f7f624ef07680af5bcea54f212e0eb11ddb2c121 | 2,480 | py | Python | yt/data_objects/tests/test_points.py | kastalpes/yt | b1e197ca84433fbd61eaf44b28ff5cdb37981d4c | [
"BSD-3-Clause-Clear"
] | 1 | 2021-11-29T21:59:06.000Z | 2021-11-29T21:59:06.000Z | yt/data_objects/tests/test_points.py | kastalpes/yt | b1e197ca84433fbd61eaf44b28ff5cdb37981d4c | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/data_objects/tests/test_points.py | kastalpes/yt | b1e197ca84433fbd61eaf44b28ff5cdb37981d4c | [
"BSD-3-Clause-Clear"
] | 1 | 2020-07-17T02:55:58.000Z | 2020-07-17T02:55:58.000Z | import numpy as np
import yt
from yt.testing import \
fake_random_ds, \
assert_equal, \
requires_file
def setup():
from yt.config import ytcfg
ytcfg["yt","__withintesting"] = "True"
def test_point_creation():
ds = fake_random_ds(16)
p1 = ds.point(ds.domain_center)
p2 = ds.point([0.5, ... | 31.794872 | 75 | 0.7 | import numpy as np
import yt
from yt.testing import \
fake_random_ds, \
assert_equal, \
requires_file
def setup():
from yt.config import ytcfg
ytcfg["yt","__withintesting"] = "True"
def test_point_creation():
ds = fake_random_ds(16)
p1 = ds.point(ds.domain_center)
p2 = ds.point([0.5, ... | true | true |
f7f625ae8448b77e1d829ba8037dc8d8f88e4f5c | 9,355 | py | Python | hw_asr/trainer/trainer.py | Mrrrat/asr_project_template | 50d264684d90bc45c59f3e9be5766fabaf090d25 | [
"MIT"
] | null | null | null | hw_asr/trainer/trainer.py | Mrrrat/asr_project_template | 50d264684d90bc45c59f3e9be5766fabaf090d25 | [
"MIT"
] | null | null | null | hw_asr/trainer/trainer.py | Mrrrat/asr_project_template | 50d264684d90bc45c59f3e9be5766fabaf090d25 | [
"MIT"
] | null | null | null | import random
from random import shuffle
import PIL
import torch
import torch.nn.functional as F
from torch.nn.utils import clip_grad_norm_
from torchvision.transforms import ToTensor
from tqdm import tqdm
from hw_asr.base import BaseTrainer
from hw_asr.logger.utils import plot_spectrogram_to_buf
from hw_asr.metric.u... | 35.570342 | 85 | 0.560128 | import random
from random import shuffle
import PIL
import torch
import torch.nn.functional as F
from torch.nn.utils import clip_grad_norm_
from torchvision.transforms import ToTensor
from tqdm import tqdm
from hw_asr.base import BaseTrainer
from hw_asr.logger.utils import plot_spectrogram_to_buf
from hw_asr.metric.u... | true | true |
f7f6277f21241662b4f6f990c90a88a716d3314b | 1,282 | py | Python | samples/interactive-tutorials/search/search_simple_query_test.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | 1 | 2022-02-11T14:00:31.000Z | 2022-02-11T14:00:31.000Z | samples/interactive-tutorials/search/search_simple_query_test.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | null | null | null | samples/interactive-tutorials/search/search_simple_query_test.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | 2 | 2022-01-28T09:53:16.000Z | 2022-02-07T14:27:38.000Z | # Copyright 2022 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33.736842 | 86 | 0.74415 |
import re
import subprocess
from search_simple_query import search
def test_search_simple_query_pass():
output = str(subprocess.check_output("python search_simple_query.py", shell=True))
assert re.match(".*search request.*", output)
assert re.match(".*search response.*", output)
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.