hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6137dc7efb5b1bd40ca51e8305b3b76ee890341d | 5,139 | py | Python | projects/python_projects/blockChain/block_chain.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 1 | 2019-11-25T07:23:42.000Z | 2019-11-25T07:23:42.000Z | projects/python_projects/blockChain/block_chain.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 13 | 2020-01-07T16:09:47.000Z | 2022-03-02T12:51:44.000Z | projects/python_projects/blockChain/block_chain.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
import hashlib
import json
import time
from urllib.parse import urlparse
from uuid import uuid4
from flask import Flask, jsonify, request
class BlockChain(object):
def __init__(self):
self.chains = [] # 储存区块链
self.current_tran... | 28.55 | 96 | 0.590971 |
cf3c4c3b6521a7b3f9fdf0d660d31cc009d3e8b1 | 481 | py | Python | openstudiocore/python/testpath.py | Acidburn0zzz/OpenStudio | 8d7aa85fe5df7987cb6983984d4ce8698f1bd0bd | [
"MIT"
] | 4 | 2015-05-02T21:04:15.000Z | 2015-10-28T09:47:22.000Z | openstudiocore/python/testpath.py | Acidburn0zzz/OpenStudio | 8d7aa85fe5df7987cb6983984d4ce8698f1bd0bd | [
"MIT"
] | 11 | 2015-05-05T16:16:33.000Z | 2017-08-10T08:15:50.000Z | openstudiocore/python/testpath.py | Acidburn0zzz/OpenStudio | 8d7aa85fe5df7987cb6983984d4ce8698f1bd0bd | [
"MIT"
] | 1 | 2020-11-12T21:52:36.000Z | 2020-11-12T21:52:36.000Z | import openstudio
print openstudio.toString(openstudio.runmanager.RunManager().dbPath())
# workspace test
workspace = openstudio.Workspace()
zone = workspace.addObject(openstudio.IdfObject(openstudio.IddObjectType("Zone")))
zone = zone.get()
zone.setName("New Zone")
for obj in workspace.objects():
print obj
# mod... | 22.904762 | 82 | 0.769231 |
333d3e9737b1573cb23da84affb328c9ee2d17b0 | 662 | py | Python | day1.py | unidavemeyer/aoc2020 | eabe6cb4143ac76a5d4047143665ee3bc0335275 | [
"MIT"
] | null | null | null | day1.py | unidavemeyer/aoc2020 | eabe6cb4143ac76a5d4047143665ee3bc0335275 | [
"MIT"
] | null | null | null | day1.py | unidavemeyer/aoc2020 | eabe6cb4143ac76a5d4047143665ee3bc0335275 | [
"MIT"
] | null | null | null | import day1in
def PairFindSum(lN, n):
# find two entries in the list that sum to n, dumb simple version
for n0 in lN:
for n1 in lN:
if n0 + n1 == n:
return (n0, n1)
return (0, 0)
def TripleFindSum(lN, n):
for n0 in lN:
for n1 in lN:
for n2 in ... | 22.827586 | 77 | 0.522659 |
b9718859b14732571666754c7e6967d78d7bc173 | 5,545 | py | Python | main.py | RomashkaGang/Update_Checker | 1763ec5d8110462a72f5015abdc5c5be3e3c9498 | [
"MIT"
] | null | null | null | main.py | RomashkaGang/Update_Checker | 1763ec5d8110462a72f5015abdc5c5be3e3c9498 | [
"MIT"
] | null | null | null | main.py | RomashkaGang/Update_Checker | 1763ec5d8110462a72f5015abdc5c5be3e3c9498 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
from argparse import ArgumentParser
import time
import traceback
import sys
from requests import exceptions
from config import DEBUG_ENABLE, ENABLE_SENDMESSAGE, LOOP_CHECK_INTERVAL
from check_init import ErrorCode
from check_list import CHECK_LIST, PE_PAGE_BS_CACHE
from datab... | 35.318471 | 113 | 0.627953 |
b200190eb3d761c7e90ce80defbd3fe12db4f318 | 500 | py | Python | miniprogram_api/migrations/0004_auto_20190924_0005.py | ti-technology/django_miniprogram_api | 187dfa489e3555b6d657fce4ac70d9e48b417174 | [
"BSD-3-Clause"
] | 49 | 2019-09-27T15:20:53.000Z | 2022-02-27T07:37:44.000Z | miniprogram_api/migrations/0004_auto_20190924_0005.py | TinchyChing/django_miniprogram_api | 187dfa489e3555b6d657fce4ac70d9e48b417174 | [
"BSD-3-Clause"
] | null | null | null | miniprogram_api/migrations/0004_auto_20190924_0005.py | TinchyChing/django_miniprogram_api | 187dfa489e3555b6d657fce4ac70d9e48b417174 | [
"BSD-3-Clause"
] | 12 | 2019-11-08T08:10:56.000Z | 2021-10-17T00:47:25.000Z | # Generated by Django 2.2.5 on 2019-09-24 00:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('miniprogram_api', '0003_auto_20190923_2346'),
]
operations = [
migrations.RemoveField(
model_name='payorder',
name='... | 21.73913 | 55 | 0.578 |
7d88061725294742ad94d8c17e687b0641a792fd | 11,572 | py | Python | suzieq/engines/pandas/bgp.py | LucaNicosia/suzieq | c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd | [
"Apache-2.0"
] | null | null | null | suzieq/engines/pandas/bgp.py | LucaNicosia/suzieq | c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd | [
"Apache-2.0"
] | null | null | null | suzieq/engines/pandas/bgp.py | LucaNicosia/suzieq | c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from suzieq.engines.pandas.engineobj import SqPandasEngine
from suzieq.shared.utils import build_query_str, humanize_timestamp
class BgpObj(SqPandasEngine):
'''Backend class to handle manipulating BGP table with pandas'''
@staticmethod
def table_name():
'''... | 39.630137 | 79 | 0.512703 |
998e663438f23b335269d7a1c439af77142e0b80 | 6,117 | py | Python | tests/attributions/test_lime.py | DavidPetiteau/xplique | 34ed027e1f47fdc88a87f6bb783b253327e77f54 | [
"MIT"
] | 72 | 2021-09-27T10:09:40.000Z | 2022-03-24T06:33:41.000Z | tests/attributions/test_lime.py | DavidPetiteau/xplique | 34ed027e1f47fdc88a87f6bb783b253327e77f54 | [
"MIT"
] | 32 | 2021-09-30T09:37:16.000Z | 2022-03-17T11:00:16.000Z | tests/attributions/test_lime.py | DavidPetiteau/xplique | 34ed027e1f47fdc88a87f6bb783b253327e77f54 | [
"MIT"
] | 4 | 2021-10-02T16:50:45.000Z | 2022-01-11T08:26:55.000Z | """
Tests for Lime Module
"""
import numpy as np
import tensorflow as tf
from sklearn import linear_model
from xplique.attributions import Lime
from ..utils import generate_data, generate_model, almost_equal
def test_pertub_func():
"""Ensure the default pertub function has the right output"""
num_features = 1... | 35.358382 | 87 | 0.639529 |
a166523b82c1f9f05f10cea9bd886b6efb3f0275 | 646 | py | Python | whyattend/alembic/versions/5a5fa1c1dc8e_add_table_for_internal_bookkeeping.py | chipsi007/World-of-Tanks-Attendance-Tracker | 576b32586c402a843b88c49bf432a3e8cb3c62dd | [
"BSD-2-Clause"
] | null | null | null | whyattend/alembic/versions/5a5fa1c1dc8e_add_table_for_internal_bookkeeping.py | chipsi007/World-of-Tanks-Attendance-Tracker | 576b32586c402a843b88c49bf432a3e8cb3c62dd | [
"BSD-2-Clause"
] | null | null | null | whyattend/alembic/versions/5a5fa1c1dc8e_add_table_for_internal_bookkeeping.py | chipsi007/World-of-Tanks-Attendance-Tracker | 576b32586c402a843b88c49bf432a3e8cb3c62dd | [
"BSD-2-Clause"
] | null | null | null | """add table for internal bookkeeping
Revision ID: 5a5fa1c1dc8e
Revises: 3a763038a0c9
Create Date: 2013-12-14 23:56:27.650187
"""
# revision identifiers, used by Alembic.
revision = '5a5fa1c1dc8e'
down_revision = '3a763038a0c9'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
de... | 23.071429 | 68 | 0.732198 |
c13e7f9e9ec4701c23222fa99357db33cc33fcf0 | 685 | py | Python | clients/python-experimental/generated/openapi_client/api/version_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-experimental/generated/openapi_client/api/version_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-experimental/generated/openapi_client/api/version_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | # coding: utf-8
"""
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 20220523
Generated by: https://openapi-generator.tech
"""
from openapi_client.api_client import ApiClient
from openapi_client.... | 25.37037 | 124 | 0.753285 |
753d9e514993cc7745a7f776d6001422a9fdd7dd | 1,726 | py | Python | tests/rules/test_ifconfig_device_not_found.py | frankhli843/thedarn | 9e00f854c248156fba820f39b2834e8273583984 | [
"MIT"
] | null | null | null | tests/rules/test_ifconfig_device_not_found.py | frankhli843/thedarn | 9e00f854c248156fba820f39b2834e8273583984 | [
"MIT"
] | null | null | null | tests/rules/test_ifconfig_device_not_found.py | frankhli843/thedarn | 9e00f854c248156fba820f39b2834e8273583984 | [
"MIT"
] | null | null | null | import pytest
from six import BytesIO
from thedarn.rules.ifconfig_device_not_found import match, get_new_command
from thedarn.types import Command
output = '{}: error fetching interface information: Device not found'
stdout = b'''
wlp2s0 Link encap:Ethernet HWaddr 5c:51:4f:7c:58:5d
inet addr:192.168.0.... | 31.962963 | 74 | 0.691773 |
bbf8a39fe34495cbc0d5d911caebcc510075a71f | 6,605 | py | Python | annealing/libbase/entry.py | amphc/amphc | ec7a6ca91913ca1fe6c6b6f33111c2c763477aca | [
"MIT"
] | null | null | null | annealing/libbase/entry.py | amphc/amphc | ec7a6ca91913ca1fe6c6b6f33111c2c763477aca | [
"MIT"
] | null | null | null | annealing/libbase/entry.py | amphc/amphc | ec7a6ca91913ca1fe6c6b6f33111c2c763477aca | [
"MIT"
] | 3 | 2021-05-28T17:22:24.000Z | 2022-02-22T22:42:53.000Z | import typed_ast.ast3 as ast
import util.error as err
import typesys.mytypes as mytypes
from libbase.libfuncs import *
def get_func_info(func_name, module_names):
if module_names:
main = module_names[0]
sub = module_names[1:] if len(module_names) > 1 else []
info = module_to_info(main, sub... | 29.355556 | 78 | 0.57623 |
736415b2b2c54a8eb293e906f17273e25d4af578 | 10,251 | py | Python | openpeerpower/components/snapcast/media_player.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | openpeerpower/components/snapcast/media_player.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | openpeerpower/components/snapcast/media_player.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Support for interacting with Snapcast clients."""
import logging
import socket
import snapcast.control
from snapcast.control.server import CONTROL_PORT
import voluptuous as vol
from openpeerpower.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from openpeerpower.components.media_player.const impo... | 30.508929 | 86 | 0.665789 |
6e0a2fb2d40b2788b558f50051e8a52e699418f0 | 4,122 | py | Python | py_stringmatching/similarity_measure/smith_waterman.py | kvpradap/conda-pysm-appveyor | 1dd8e54e8e105780420b25f3f2498977ae5c2f25 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | py_stringmatching/similarity_measure/smith_waterman.py | kvpradap/conda-pysm-appveyor | 1dd8e54e8e105780420b25f3f2498977ae5c2f25 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | py_stringmatching/similarity_measure/smith_waterman.py | kvpradap/conda-pysm-appveyor | 1dd8e54e8e105780420b25f3f2498977ae5c2f25 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
import numpy as np
from py_stringmatching import utils
from six.moves import xrange
from py_stringmatching.similarity_measure.sequence_similarity_measure import \
SequenceSimilarityMeasure
def sim_ident(char1, char2):
return int(char1 == char2)
... | 34.066116 | 144 | 0.587579 |
201a0ae92f2bd69bb001d8f94b1bd70e00ad3381 | 904 | py | Python | backend/app/app/api/api_v1/endpoints/utils.py | Toreno96/hello-fastapi | ab2c8c1f1144cfa3b7c7cb4a1900e2e570a4c4ca | [
"MIT"
] | null | null | null | backend/app/app/api/api_v1/endpoints/utils.py | Toreno96/hello-fastapi | ab2c8c1f1144cfa3b7c7cb4a1900e2e570a4c4ca | [
"MIT"
] | 5 | 2020-03-24T18:13:27.000Z | 2021-12-13T20:41:15.000Z | backend/app/app/api/api_v1/endpoints/utils.py | Toreno96/hello-fastapi | ab2c8c1f1144cfa3b7c7cb4a1900e2e570a4c4ca | [
"MIT"
] | null | null | null | from fastapi import APIRouter, Depends
from pydantic.networks import EmailStr
from app.api.utils.security import get_current_active_superuser
from app.core.celery_app import celery_app
from app.models.user import User as DBUser
from app.schemas.msg import Msg
from app.utils import send_test_email
router = APIRouter()... | 29.16129 | 88 | 0.746681 |
425048478160f7fd743b183d16eec5ae87aed78f | 3,183 | py | Python | facebook_business/adobjects/adrulehistory.py | mschmo/facebook-python-ads-sdk | bf273b4627c99dc261e4483ae0a4c5de648b37c8 | [
"CNRI-Python"
] | null | null | null | facebook_business/adobjects/adrulehistory.py | mschmo/facebook-python-ads-sdk | bf273b4627c99dc261e4483ae0a4c5de648b37c8 | [
"CNRI-Python"
] | null | null | null | facebook_business/adobjects/adrulehistory.py | mschmo/facebook-python-ads-sdk | bf273b4627c99dc261e4483ae0a4c5de648b37c8 | [
"CNRI-Python"
] | null | null | null | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 37.447059 | 79 | 0.717876 |
dce5c0942b00d37d92058e8052bbbab5d9fbe71a | 35,499 | py | Python | python/ccxt/yobit.py | mehrdad-shokri/ccxt | 3ed58dae0b16a8c88e55e4468d1da739c3c8fab8 | [
"MIT"
] | null | null | null | python/ccxt/yobit.py | mehrdad-shokri/ccxt | 3ed58dae0b16a8c88e55e4468d1da739c3c8fab8 | [
"MIT"
] | null | null | null | python/ccxt/yobit.py | mehrdad-shokri/ccxt | 3ed58dae0b16a8c88e55e4468d1da739c3c8fab8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 40.709862 | 248 | 0.504972 |
66cc2938e354d76c25a50a61386ab34939337b82 | 2,660 | py | Python | src/plexus/low_level_drivers/bmp180_driver.py | houseofbigseals/plexus | 370a4a7af2dc4df1ce353a6b8c5f1c54c4f3a06a | [
"Plexus"
] | 2 | 2022-02-25T17:46:49.000Z | 2022-02-25T17:49:46.000Z | src/plexus/low_level_drivers/bmp180_driver.py | houseofbigseals/plexus | 370a4a7af2dc4df1ce353a6b8c5f1c54c4f3a06a | [
"Plexus"
] | 11 | 2022-03-09T21:15:44.000Z | 2022-03-09T21:37:00.000Z | src/plexus/low_level_drivers/bmp180_driver.py | houseofbigseals/plexus | 370a4a7af2dc4df1ce353a6b8c5f1c54c4f3a06a | [
"Plexus"
] | null | null | null | import smbus
import time
def get_bmp180_data():
bus = smbus.SMBus(1)
# BMP180 address, 0x77
data = bus.read_i2c_block_data(0x77, 0xAA, 22)
# Convert the data
AC1 = data[0] * 256 + data[1]
if AC1 > 32767:
AC1 -= 65535
AC2 = data[2] * 256 + data[3]
if AC2 > 32767:
AC2 -... | 25.576923 | 66 | 0.519549 |
5943a7a96cef587e2c0b5e64da3470a3ceb87869 | 3,602 | py | Python | setup.py | inveniosoftware/invenio-records | c34365481556e1048c611fadee44edecffd7b65c | [
"MIT"
] | 9 | 2015-07-03T08:06:30.000Z | 2022-03-01T14:46:18.000Z | setup.py | inveniosoftware/invenio-records | c34365481556e1048c611fadee44edecffd7b65c | [
"MIT"
] | 162 | 2015-06-25T20:58:57.000Z | 2022-03-23T16:20:49.000Z | setup.py | inveniosoftware/invenio-records | c34365481556e1048c611fadee44edecffd7b65c | [
"MIT"
] | 60 | 2015-06-24T12:04:58.000Z | 2021-11-25T09:32:15.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2021 TU Wien.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Invenio-Records is a metadata storage module.""... | 27.496183 | 72 | 0.608828 |
2dde89418ba04716ab8bdb53e84e2e6c0784ae7c | 6,636 | py | Python | tests/auth/test_views.py | austinmcconnell/myflaskapp | 79223c0480387fd95e8dd26620bf0cd50659161c | [
"BSD-3-Clause"
] | null | null | null | tests/auth/test_views.py | austinmcconnell/myflaskapp | 79223c0480387fd95e8dd26620bf0cd50659161c | [
"BSD-3-Clause"
] | 41 | 2018-01-21T22:49:43.000Z | 2022-01-21T19:11:52.000Z | tests/auth/test_views.py | austinmcconnell/myflaskapp | 79223c0480387fd95e8dd26620bf0cd50659161c | [
"BSD-3-Clause"
] | 1 | 2018-02-14T23:27:56.000Z | 2018-02-14T23:27:56.000Z | # -*- coding: utf-8 -*-
import re
from urllib.parse import urlparse
from flask import get_flashed_messages, url_for
from flask_login import login_user
import pytest
from app.extensions import mail
from app.user.models import User
from tests.factories import UserFactory
class TestLoggingIn:
@pytest.mark.paramet... | 33.515152 | 82 | 0.5978 |
6c01b729103155260cd971dfc9b81fc8ebfdc804 | 23,225 | py | Python | ExpanderPi/ABE_ExpanderPi.py | GentlemanBrewing/ADCLibraries-MCP3424 | 5df95b0a3d6d1ca5bb28c1a6490026dcbf7a5fc8 | [
"MIT"
] | null | null | null | ExpanderPi/ABE_ExpanderPi.py | GentlemanBrewing/ADCLibraries-MCP3424 | 5df95b0a3d6d1ca5bb28c1a6490026dcbf7a5fc8 | [
"MIT"
] | null | null | null | ExpanderPi/ABE_ExpanderPi.py | GentlemanBrewing/ADCLibraries-MCP3424 | 5df95b0a3d6d1ca5bb28c1a6490026dcbf7a5fc8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import spidev
import time
import datetime
import sys
import math
import struct
"""
================================================
ABElectronics IO Pi V2 32-Channel Port Expander
Version 1.0 Created 29/03/2015
Requires python smbus to be installed
================================================... | 32.256944 | 87 | 0.578471 |
2b08f829b41502152f72fdbe9bcdfb1e6eec5a34 | 19,520 | py | Python | main_custom_fpn.py | Khoronus/MonoDepth-FPN-PyTorch | 6e41e297723d1490c537e04afff905c61d6f0ff8 | [
"MIT"
] | null | null | null | main_custom_fpn.py | Khoronus/MonoDepth-FPN-PyTorch | 6e41e297723d1490c537e04afff905c61d6f0ff8 | [
"MIT"
] | null | null | null | main_custom_fpn.py | Khoronus/MonoDepth-FPN-PyTorch | 6e41e297723d1490c537e04afff905c61d6f0ff8 | [
"MIT"
] | null | null | null | import numpy as np
import os, sys
from constants import *
from model_fpn import I2D
import argparse, time
#from utils.net_utils import adjust_learning_rate
import torch
from torch.autograd import Variable
# from dataset.dataloader import DepthDataset
#from dataset.nyuv2_dataset import NYUv2Dataset
from dataset.custom_d... | 37.683398 | 159 | 0.587859 |
44f1cb08a5041192480f0c02366540ac1c91ce09 | 5,673 | py | Python | Materials/MakeEnvironmentMap.py | donovankeith/pypline4d | df330876cc1a381e53d4c014f0d1dfe06d69c8a6 | [
"MIT"
] | 7 | 2018-01-26T07:39:59.000Z | 2020-10-01T13:44:57.000Z | Materials/MakeEnvironmentMap.py | donovankeith/pypline4d | df330876cc1a381e53d4c014f0d1dfe06d69c8a6 | [
"MIT"
] | null | null | null | Materials/MakeEnvironmentMap.py | donovankeith/pypline4d | df330876cc1a381e53d4c014f0d1dfe06d69c8a6 | [
"MIT"
] | null | null | null | """
Make Environment Map v0.01
Renders an environment map for the selected object.
Written for CINEMA 4D R14.025
LICENSE:
Copyright (C) 2012 by Donovan Keith (www.donovankeith.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | 31.516667 | 108 | 0.713908 |
992550ddb3bb6012650c6279eb386353a0615068 | 2,209 | py | Python | src/jk_argparsing/textmodel/VisSettings.py | jkpubsrc/python-module-jk-argparsing | 6ee4f818ff9b970a6bdff8ed588ef32cf3a190bc | [
"Apache-2.0"
] | null | null | null | src/jk_argparsing/textmodel/VisSettings.py | jkpubsrc/python-module-jk-argparsing | 6ee4f818ff9b970a6bdff8ed588ef32cf3a190bc | [
"Apache-2.0"
] | null | null | null | src/jk_argparsing/textmodel/VisSettings.py | jkpubsrc/python-module-jk-argparsing | 6ee4f818ff9b970a6bdff8ed588ef32cf3a190bc | [
"Apache-2.0"
] | null | null | null |
import re
import os
import jk_terminal_essentials as te
class VisSettings(object):
################################################################################################################################
## Constructor
###############################################################################... | 28.320513 | 129 | 0.400634 |
db6a9d02fbb5fa6a71badaf5d9fd6c861d762024 | 68,147 | py | Python | learnSipros/test/AMD/siprosV3/scripts/sipros_peptides_filtering.py | xyz1396/Projects | 943ddb37039c13e2878a1d39a2d4d97c937f183a | [
"MIT"
] | null | null | null | learnSipros/test/AMD/siprosV3/scripts/sipros_peptides_filtering.py | xyz1396/Projects | 943ddb37039c13e2878a1d39a2d4d97c937f183a | [
"MIT"
] | null | null | null | learnSipros/test/AMD/siprosV3/scripts/sipros_peptides_filtering.py | xyz1396/Projects | 943ddb37039c13e2878a1d39a2d4d97c937f183a | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
sipros_peptides_filtering.py
sipros_peptides_filtering.py is the first post-processing program
after running of sipros to find statistically significant peptides
and report them.
Created by Tae-Hyuk (Ted) Ahn on 09/23/2012.
Copyright (c) 2012 Tae-Hyuk Ahn (ORNL). Allrights reserved.
"""
## Im... | 42.196285 | 142 | 0.592396 |
bfed9afb6e6e0f0ed0fce544f2c267cce4fca230 | 8,664 | py | Python | webserver/python2.7/site-packages/mpmath/__init__.py | maxr1876/Radix | bf9a5470908ea0823c8398565086b1e6b960c73b | [
"BSD-2-Clause"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | mpmath/__init__.py | asmeurer/mpmath | 157a7091b80c3ac12c4d3c1886a892bd8b29d8bc | [
"BSD-3-Clause"
] | null | null | null | mpmath/__init__.py | asmeurer/mpmath | 157a7091b80c3ac12c4d3c1886a892bd8b29d8bc | [
"BSD-3-Clause"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | __version__ = '1.0.0'
from .usertools import monitor, timing
from .ctx_fp import FPContext
from .ctx_mp import MPContext
from .ctx_iv import MPIntervalContext
fp = FPContext()
mp = MPContext()
iv = MPIntervalContext()
fp._mp = mp
mp._mp = mp
iv._mp = mp
mp._fp = fp
fp._fp = fp
mp._iv = iv
fp._iv = iv
iv._iv = iv
#... | 18.632258 | 82 | 0.712258 |
9c50a63a177e6382ecdf964a6610b0c6914ef4ba | 301,025 | py | Python | nova/tests/unit/network/test_neutronv2.py | arvindn05/nova | 1d335b333245198dbf39841eedd221377beb58c2 | [
"Apache-2.0"
] | 1 | 2018-05-27T09:38:17.000Z | 2018-05-27T09:38:17.000Z | nova/tests/unit/network/test_neutronv2.py | arvindn05/nova | 1d335b333245198dbf39841eedd221377beb58c2 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/network/test_neutronv2.py | arvindn05/nova | 1d335b333245198dbf39841eedd221377beb58c2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 47.368214 | 79 | 0.593001 |
a1407f1783ffb25e6f2a3d83109feb5ceb043050 | 12,777 | py | Python | .history/src/Simulador_20200708160338.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200708160338.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200708160338.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
class Simulador():
def __init__(
self,
... | 42.875839 | 145 | 0.652344 |
b15fae39f5fb1a1f07aeff51124e1cb5b89be52f | 3,567 | py | Python | wuyudong/UCF/UCF_research.py | doge-search/webdoge | 443e758b5c1f962d5c2fe792cdbed01e1208b1cb | [
"Unlicense"
] | null | null | null | wuyudong/UCF/UCF_research.py | doge-search/webdoge | 443e758b5c1f962d5c2fe792cdbed01e1208b1cb | [
"Unlicense"
] | null | null | null | wuyudong/UCF/UCF_research.py | doge-search/webdoge | 443e758b5c1f962d5c2fe792cdbed01e1208b1cb | [
"Unlicense"
] | null | null | null | __author__ = 'cutylewiwi'
# -*- coding:utf-8 -*-
import urllib
import urllib2
import re
class Group:
def __init__(self, name, faculties):
self.name = name
self.faculties = faculties
class GroupList:
def __init__(self, baseUrl):
self.baseUrl = baseUrl
self.grou... | 34.631068 | 106 | 0.543314 |
c862a2c7f3096c7d6f2d1b08317415d1071f54e1 | 13,622 | py | Python | funannotate/aux_scripts/funannotate-p2g.py | jguhlin/funannotate | 9e8483b3ca0287f2c0e7d24ca162fd2c7b5a23c4 | [
"BSD-2-Clause"
] | null | null | null | funannotate/aux_scripts/funannotate-p2g.py | jguhlin/funannotate | 9e8483b3ca0287f2c0e7d24ca162fd2c7b5a23c4 | [
"BSD-2-Clause"
] | null | null | null | funannotate/aux_scripts/funannotate-p2g.py | jguhlin/funannotate | 9e8483b3ca0287f2c0e7d24ca162fd2c7b5a23c4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import subprocess
import shutil
import itertools
import argparse
from Bio import SeqIO
from Bio.SeqIO.FastaIO import SimpleFastaParser
import funannotate.library as lib
# setup menu with argparse
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(s... | 41.404255 | 180 | 0.593672 |
f15f9c76c66f5f52a11a5fa94bedd9b01eb7f36f | 564 | py | Python | tests/conftest.py | molssi-seamm/seamm_ff_util | 72ecb5995bd36c4f9d1a6924a5f4503698f476eb | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | molssi-seamm/seamm_ff_util | 72ecb5995bd36c4f9d1a6924a5f4503698f476eb | [
"BSD-3-Clause"
] | 46 | 2019-07-24T19:45:03.000Z | 2022-02-03T10:39:32.000Z | tests/conftest.py | molssi-seamm/seamm_ff_util | 72ecb5995bd36c4f9d1a6924a5f4503698f476eb | [
"BSD-3-Clause"
] | 1 | 2022-02-09T18:24:53.000Z | 2022-02-09T18:24:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Fixtures for testing the 'seamm_ff_util' package."""
import pytest
from seamm_ff_util import Forcefield
from seamm_ff_util import FFAssigner
@pytest.fixture(scope="session")
def pcff():
"""A forcefield object initialized with PCFF"""
pcff = Forcefield("data/p... | 23.5 | 55 | 0.72695 |
d8bb21a72793cc0e8e7538037f384dbf5760e595 | 11,103 | py | Python | src/azure-cli/azure/cli/command_modules/eventhubs/commands.py | ZengTaoxu/azure-cli | 6be96de450da5ac9f07aafb22dd69880bea04792 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/eventhubs/commands.py | ZengTaoxu/azure-cli | 6be96de450da5ac9f07aafb22dd69880bea04792 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/eventhubs/commands.py | ZengTaoxu/azure-cli | 6be96de450da5ac9f07aafb22dd69880bea04792 | [
"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.
# --------------------------------------------------------------------... | 61.683333 | 207 | 0.711249 |
c9c9a02ddd2664e977083e3601fb683c25075f8c | 2,088 | py | Python | blaze/thirdparty/onnx/onnx-1.2.2/onnx/mapping.py | Ru-Xiang/x-deeplearning | 04cc0497150920c64b06bb8c314ef89977a3427a | [
"Apache-2.0"
] | 4,071 | 2018-12-13T04:17:38.000Z | 2022-03-30T03:29:35.000Z | blaze/thirdparty/onnx/onnx-1.2.2/onnx/mapping.py | laozhuang727/x-deeplearning | 781545783a4e2bbbda48fc64318fb2c6d8bbb3cc | [
"Apache-2.0"
] | 359 | 2018-12-21T01:14:57.000Z | 2022-02-15T07:18:02.000Z | blaze/thirdparty/onnx/onnx-1.2.2/onnx/mapping.py | laozhuang727/x-deeplearning | 781545783a4e2bbbda48fc64318fb2c6d8bbb3cc | [
"Apache-2.0"
] | 1,054 | 2018-12-20T09:57:42.000Z | 2022-03-29T07:16:53.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from onnx import TensorProto
import numpy as np # type: ignore
TENSOR_TYPE_TO_NP_TYPE = {
TensorProto.FLOAT: np.dtype('float32'),
TensorProto.UINT8: np.dtype('u... | 35.389831 | 74 | 0.741379 |
d5ec9f56fc139415510fd010f5a02eee6b9d976a | 7,783 | py | Python | atomic_reactor/plugins/pre_fetch_maven_artifacts.py | mkosiarc/atomic-reactor | 9296f28f6bf72a901d526bec44731125ce943e05 | [
"BSD-3-Clause"
] | null | null | null | atomic_reactor/plugins/pre_fetch_maven_artifacts.py | mkosiarc/atomic-reactor | 9296f28f6bf72a901d526bec44731125ce943e05 | [
"BSD-3-Clause"
] | null | null | null | atomic_reactor/plugins/pre_fetch_maven_artifacts.py | mkosiarc/atomic-reactor | 9296f28f6bf72a901d526bec44731125ce943e05 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017, 2021 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import hashlib
import koji
import os
from atomic_reactor import util
from atomic_reactor.constants import (PLUGIN_FETCH_MAVEN_KEY,
... | 40.118557 | 100 | 0.616986 |
e0efcf2c3d8acc408848f4af77eddc25b48e0c8f | 2,795 | py | Python | gsoc/zheyuan/pipeline/get_properties.py | sahandilshan/NSpM | 5a54ccc85616d489752e5ef4f6bfa72a79b4d7f5 | [
"MIT"
] | 78 | 2020-06-14T15:55:45.000Z | 2022-03-26T22:38:42.000Z | gsoc/zheyuan/pipeline/get_properties.py | sahandilshan/NSpM | 5a54ccc85616d489752e5ef4f6bfa72a79b4d7f5 | [
"MIT"
] | 16 | 2018-05-04T12:53:59.000Z | 2020-09-09T15:44:23.000Z | gsoc/zheyuan/pipeline/get_properties.py | sahandilshan/NSpM | 5a54ccc85616d489752e5ef4f6bfa72a79b4d7f5 | [
"MIT"
] | 25 | 2018-03-23T07:32:48.000Z | 2022-01-15T16:48:32.000Z | import urllib
import json
import sys
import csv
import io
import argparse
import os
from bs4 import BeautifulSoup
from tqdm import tqdm
def get_properties(url, project_name="test_project", output_file = "get_properties.csv", multi=False):
"""
- This function extracts the information regarding : [Name, Label, ... | 36.776316 | 156 | 0.62576 |
51ea43f80fb398f11aaf80772dd1e858e6735d4c | 556 | py | Python | wxtbx/command_line/plot_anomalous_scattering.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | wxtbx/command_line/plot_anomalous_scattering.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | wxtbx/command_line/plot_anomalous_scattering.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME cctbx.plot_anomalous_scattering
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export BOOST_ADAPTBX_FPE_DEFAULT=1
from wxtbx import anomalous_scattering
import wxtbx.app
... | 29.263158 | 69 | 0.811151 |
02517f1e5d6870c99a053babb57b1f166969b9ca | 15,121 | py | Python | tikzplotlib/_save.py | eric-wieser/tikzplotlib | f06fd7cf470000410d8de1b79323c5b201161b48 | [
"MIT"
] | null | null | null | tikzplotlib/_save.py | eric-wieser/tikzplotlib | f06fd7cf470000410d8de1b79323c5b201161b48 | [
"MIT"
] | null | null | null | tikzplotlib/_save.py | eric-wieser/tikzplotlib | f06fd7cf470000410d8de1b79323c5b201161b48 | [
"MIT"
] | null | null | null | import codecs
import os
import tempfile
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
from . import _axes
from . import _image as img
from . import _legend, _line2d, _patch, _path
from . import _quadmesh as qmsh
from . import _text
from .__about__ import __version__
def get_tikz_code(
... | 38.088161 | 87 | 0.601018 |
dc9560206a6c15fc4ec9568d664edf6766a35507 | 3,314 | py | Python | tests/test_bv.py | embg/claripy | 1a5e0ca61d3f480e541226f103900e983f025e4a | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:38:52.000Z | 2020-11-18T16:38:52.000Z | tests/test_bv.py | embg/claripy | 1a5e0ca61d3f480e541226f103900e983f025e4a | [
"BSD-2-Clause"
] | null | null | null | tests/test_bv.py | embg/claripy | 1a5e0ca61d3f480e541226f103900e983f025e4a | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:38:55.000Z | 2020-11-18T16:38:55.000Z |
import sys
import nose.tools
import claripy
from claripy.bv import BVV, Extract, SignExt, ZeroExt, Concat, SDiv
from claripy.errors import ClaripyTypeError, ClaripyZeroDivisionError, ClaripyValueError
def test_bv():
a = BVV(1, 8)
b = BVV(2, 8)
assert a | b == 3
assert a & b == 0
assert a / b ==... | 29.855856 | 88 | 0.624321 |
c4f45ed97043728d5142fa36b158966a8976956d | 2,634 | py | Python | tests/components/command_line/test_cover.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | tests/components/command_line/test_cover.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | tests/components/command_line/test_cover.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """The tests the cover command line platform."""
import os
import tempfile
from unittest import mock
import pytest
import homeassistant.components.command_line.cover as cmd_rs
from homeassistant.components.cover import DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_CLOSE_COVER,
SERVICE_O... | 29.595506 | 88 | 0.614655 |
cf49c73006d7de2c02ba8a8c9bc8d81b204d5239 | 7,864 | py | Python | ens_sdk/model/cmdb_extend/subsystem_dependency_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | ens_sdk/model/cmdb_extend/subsystem_dependency_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | ens_sdk/model/cmdb_extend/subsystem_dependency_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: subsystem_dependency.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google... | 45.988304 | 782 | 0.767675 |
34d3ad424515440965d9b130a11cf368e05b13b6 | 387 | py | Python | backend/tst_1/wsgi.py | crowdbotics-dev/tst-1 | 30be5160ed64e2e1caa745e3fdf5b8ba96ef46fa | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tst_1/wsgi.py | crowdbotics-dev/tst-1 | 30be5160ed64e2e1caa745e3fdf5b8ba96ef46fa | [
"FTL",
"AML",
"RSA-MD"
] | 69 | 2021-08-22T13:27:09.000Z | 2022-03-27T13:25:44.000Z | backend/tst_1/wsgi.py | crowdbotics-dev/tst-1 | 30be5160ed64e2e1caa745e3fdf5b8ba96ef46fa | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for tst_1 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
4ac1a26a0aba7dfa6055d87e59634f36748fdcb8 | 3,269 | py | Python | ps-indexing.py | sand-ci/AlarmsAndAlerts | 37b783cbb22bb7d01532e3e1427fd18098717095 | [
"Apache-2.0"
] | 1 | 2020-12-07T20:27:38.000Z | 2020-12-07T20:27:38.000Z | ps-indexing.py | sand-ci/AlarmsAndAlerts | 37b783cbb22bb7d01532e3e1427fd18098717095 | [
"Apache-2.0"
] | null | null | null | ps-indexing.py | sand-ci/AlarmsAndAlerts | 37b783cbb22bb7d01532e3e1427fd18098717095 | [
"Apache-2.0"
] | null | null | null | # # Checks if Perfsonar data is indexed
#
# Checks number of indexed documents in all perfsonar indices and alerts if any of them is
# significantly less then usual. It sends mails to all the people substribed to that alert.
# It is run every 30 min from a cron job.
import json
import sys
from elasticsearch im... | 28.929204 | 92 | 0.627409 |
e6e58796ce5b694b6055afa2ce64bb83af37daf9 | 4,031 | py | Python | examples/translation/data.py | rightx2/skorch | d4865aa7868e3c9b73fc6be699303db4560c6f2f | [
"BSD-3-Clause"
] | 2,748 | 2019-03-19T11:43:01.000Z | 2022-03-31T13:55:28.000Z | examples/translation/data.py | rightx2/skorch | d4865aa7868e3c9b73fc6be699303db4560c6f2f | [
"BSD-3-Clause"
] | 392 | 2019-03-19T11:17:04.000Z | 2022-03-29T21:36:53.000Z | examples/translation/data.py | rightx2/skorch | d4865aa7868e3c9b73fc6be699303db4560c6f2f | [
"BSD-3-Clause"
] | 197 | 2019-03-27T09:18:25.000Z | 2022-03-27T00:15:23.000Z | import unicodedata
import string
import re
SOS_token = 0
EOS_token = 1
class Lang:
def __init__(self, name):
self.name = name
self.word2index = {}
self.word2count = {}
self.index2word = {0: "SOS", 1: "EOS"}
self.n_words = 2 # Count SOS and EOS
def addSentence(self, ... | 29.210145 | 73 | 0.595634 |
adb9ce6c18d1fc3ba5a9b115442d4704609186e5 | 1,411 | py | Python | src/demo_quipuswap/types/quipu_fa12/storage.py | arrijabba/dipdup-py | fa90bfd889c473966e0d5aed98cec90a575fcb90 | [
"MIT"
] | null | null | null | src/demo_quipuswap/types/quipu_fa12/storage.py | arrijabba/dipdup-py | fa90bfd889c473966e0d5aed98cec90a575fcb90 | [
"MIT"
] | null | null | null | src/demo_quipuswap/types/quipu_fa12/storage.py | arrijabba/dipdup-py | fa90bfd889c473966e0d5aed98cec90a575fcb90 | [
"MIT"
] | null | null | null | # generated by datamodel-codegen:
# filename: storage.json
from __future__ import annotations
from typing import Dict, Optional
from pydantic import BaseModel, Extra
class Ledger(BaseModel):
class Config:
extra = Extra.forbid
allowances: Dict[str, str]
balance: str
frozen_balance: str
... | 19.067568 | 40 | 0.672573 |
e456a773aa25dddb4c031f784bec84a05f5f9d32 | 21,769 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.591518 | 174 | 0.661032 |
e7fd236fba063a12ac38bc60e9df7919e7ed6408 | 2,648 | py | Python | recipes/Python/302086_Strip_attachments_email/recipe-302086.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/302086_Strip_attachments_email/recipe-302086.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/302086_Strip_attachments_email/recipe-302086.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | ReplaceString = """
This message contained an attachment that was stripped out.
The original type was: %(content_type)s
The filename was: %(filename)s,
(and it had additional parameters of:
%(params)s)
"""
import re
BAD_CONTENT_RE = re.compile('application/(msword|msexcel)', re.I)
BAD_FILEEXT_RE = re.compile(r'(\... | 40.738462 | 74 | 0.631798 |
2c2af118e9d116aca7bf64c02c693d57f55d132d | 1,733 | py | Python | Milestone2/L2_5_P4_test_two_tone.py | 4ntLu0/1051-Project | 93ae9b8d312bd6e79949d878d3fb422282de703b | [
"Unlicense"
] | null | null | null | Milestone2/L2_5_P4_test_two_tone.py | 4ntLu0/1051-Project | 93ae9b8d312bd6e79949d878d3fb422282de703b | [
"Unlicense"
] | null | null | null | Milestone2/L2_5_P4_test_two_tone.py | 4ntLu0/1051-Project | 93ae9b8d312bd6e79949d878d3fb422282de703b | [
"Unlicense"
] | null | null | null | from Cimpl import set_color, create_color, create_image, copy, get_color
from typing import NewType, Tuple
from L2_5_two_tone import twoTone
Image = NewType('Image', str)
from datetime import datetime
tones = ['black', 'white', 'red', 'lime', 'blue',
'yellow', 'cyan', 'magenta', 'gray']
colours = [(0, 0, 0),... | 30.946429 | 107 | 0.592614 |
22c13e0a350cc764027321adece8dc5dd177c5ae | 6,158 | py | Python | 3_Functions/1_def.py | hauntarl/real-python | 6ffb535648bf5c79c90e2ed7def842078bc7807f | [
"MIT"
] | 2 | 2020-12-15T18:11:00.000Z | 2021-03-01T11:43:16.000Z | 3_Functions/1_def.py | hauntarl/real_python | 6ffb535648bf5c79c90e2ed7def842078bc7807f | [
"MIT"
] | null | null | null | 3_Functions/1_def.py | hauntarl/real_python | 6ffb535648bf5c79c90e2ed7def842078bc7807f | [
"MIT"
] | null | null | null | # def <function_name>([<parameters>]):
# <statement(s)>
def f():
s = '-- Inside f()'
print(s)
print('Before calling f()')
f()
print('After calling f()')
def stub():
pass
stub()
# The most straightforward way to pass arguments to a Python function is with
# positional arguments (also called requi... | 34.595506 | 83 | 0.713868 |
27f12c1d1be79f00d75db1cf6b29e7ea2f90ccfc | 16,768 | py | Python | wagtail_wordpress_import/test/tests/test_block_builder.py | nickmoreton/wagtail-wordpress-import | 9b07de5e0d3996a9f0d6b6406c9728db4a150021 | [
"MIT"
] | 22 | 2021-12-06T14:47:40.000Z | 2022-03-31T18:12:34.000Z | wagtail_wordpress_import/test/tests/test_block_builder.py | nickmoreton/wagtail-wordpress-import | 9b07de5e0d3996a9f0d6b6406c9728db4a150021 | [
"MIT"
] | 87 | 2021-10-01T09:25:16.000Z | 2022-02-14T10:56:16.000Z | wagtail_wordpress_import/test/tests/test_block_builder.py | nickmoreton/wagtail-wordpress-import | 9b07de5e0d3996a9f0d6b6406c9728db4a150021 | [
"MIT"
] | 5 | 2021-12-11T21:43:26.000Z | 2022-03-07T06:15:21.000Z | import os
import bs4
import responses
import requests
from bs4 import BeautifulSoup
from django.test import TestCase, override_settings
from wagtail.images import get_image_model
from wagtail_wordpress_import.block_builder import BlockBuilder, conf_promote_child_tags
from wagtail_wordpress_import.block_builder_default... | 36.77193 | 187 | 0.622674 |
8e95f1eb81465eac63460e8fa0486829e68bf501 | 13,706 | py | Python | swagger_client/api/api_v2___votes_api.py | Fates-List/fateslist.py-autogen | 0643434d9d0e71f781f99b2703a2ef52f49d8875 | [
"MIT"
] | null | null | null | swagger_client/api/api_v2___votes_api.py | Fates-List/fateslist.py-autogen | 0643434d9d0e71f781f99b2703a2ef52f49d8875 | [
"MIT"
] | null | null | null | swagger_client/api/api_v2___votes_api.py | Fates-List/fateslist.py-autogen | 0643434d9d0e71f781f99b2703a2ef52f49d8875 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Fates List
Current API: v2 beta 3 Default API: v2 API Docs: https://apidocs.fateslist.xyz Enum Reference: https://apidocs.fateslist.xyz/structures/enums.autogen # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: h... | 40.913433 | 225 | 0.629797 |
37c494fa7303fadfc3f6678ff735762c71aa3528 | 1,944 | py | Python | code/cnn.py | stjordanis/ml-cheatsheet | d34e096032b7ae826868be8808aee01699cec491 | [
"MIT"
] | 1,031 | 2019-12-04T23:51:59.000Z | 2022-03-31T10:44:51.000Z | code/cnn.py | stjordanis/ml-cheatsheet | d34e096032b7ae826868be8808aee01699cec491 | [
"MIT"
] | 41 | 2019-12-04T17:21:22.000Z | 2022-02-26T08:43:01.000Z | code/cnn.py | stjordanis/ml-cheatsheet | d34e096032b7ae826868be8808aee01699cec491 | [
"MIT"
] | 253 | 2019-12-06T06:46:08.000Z | 2022-03-23T01:24:16.000Z | import torch.nn as nn
from torch.autograd import Variable
class CNN(nn.Module):
def __init__(self, in_shape, n_classes):
super().__init__()
c, w, h = in_shape
pool_layers = 2
fc_h = int(h / 2**pool_layers)
fc_w = int(w / 2**pool_layers)
self.features = nn.Sequential... | 30.857143 | 70 | 0.591049 |
1853d1d34aed7d3799c8fa069a873354b1e7cca0 | 1,473 | py | Python | UDFLoader/examples/example.py | open-edge-insights/video-common | 6a680674bd23a705494171bcc8652315f707f0bb | [
"MIT"
] | 1 | 2021-08-13T10:13:09.000Z | 2021-08-13T10:13:09.000Z | UDFLoader/examples/example.py | open-edge-insights/video-common | 6a680674bd23a705494171bcc8652315f707f0bb | [
"MIT"
] | null | null | null | UDFLoader/examples/example.py | open-edge-insights/video-common | 6a680674bd23a705494171bcc8652315f707f0bb | [
"MIT"
] | 4 | 2021-06-17T20:12:56.000Z | 2022-02-07T09:00:17.000Z | # Copyright (c) 2019 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, ... | 38.763158 | 78 | 0.718262 |
fef1cae4be890daf0cb82d1fa0880bbf4145359f | 8,078 | py | Python | a10_octavia/common/data_models.py | afrin-chakure-a10/a10-octavia | 45c2a19c083553c28b8fef75dceeca29f0c1adc0 | [
"Apache-2.0"
] | 1 | 2020-10-06T08:29:27.000Z | 2020-10-06T08:29:27.000Z | a10_octavia/common/data_models.py | afrin-chakure-a10/a10-octavia | 45c2a19c083553c28b8fef75dceeca29f0c1adc0 | [
"Apache-2.0"
] | null | null | null | a10_octavia/common/data_models.py | afrin-chakure-a10/a10-octavia | 45c2a19c083553c28b8fef75dceeca29f0c1adc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, A10 Networks
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.225806 | 93 | 0.588636 |
fd8247c5ef494a360d0e144be9ef379e7d7200a7 | 9,998 | py | Python | gammapy/cube/tests/test_core.py | mealworm/gammapy | a838b2ca347dd6321f8da4e4097a33150d7b9be6 | [
"BSD-3-Clause"
] | null | null | null | gammapy/cube/tests/test_core.py | mealworm/gammapy | a838b2ca347dd6321f8da4e4097a33150d7b9be6 | [
"BSD-3-Clause"
] | null | null | null | gammapy/cube/tests/test_core.py | mealworm/gammapy | a838b2ca347dd6321f8da4e4097a33150d7b9be6 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import textwrap
import numpy as np
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.io import fits
f... | 37.728302 | 90 | 0.646929 |
228596da2db24730d331b1e77167ee8122bd36c6 | 2,388 | py | Python | tests/test_EDL.py | marza-animation-planet/python-edl | 2fc85922e5457c087cdfefab8f6e5d280e83680c | [
"MIT"
] | 6 | 2016-01-12T14:53:26.000Z | 2020-10-07T15:48:49.000Z | tests/test_EDL.py | marza-animation-planet/python-edl | 2fc85922e5457c087cdfefab8f6e5d280e83680c | [
"MIT"
] | null | null | null | tests/test_EDL.py | marza-animation-planet/python-edl | 2fc85922e5457c087cdfefab8f6e5d280e83680c | [
"MIT"
] | 4 | 2018-03-25T20:43:55.000Z | 2021-04-05T13:52:59.000Z | # -*- coding: utf-8 -*-
import unittest
from itertools import izip_longest
from edl import Parser
class EDLTestCase(unittest.TestCase):
"""tests the edl.edl.List class
"""
def testing_to_edl_method_will_output_the_standard_edl_case1(self):
"""testing if to_string will output the EDL as string
... | 32.27027 | 79 | 0.58124 |
1c2609e854b107dd08e135f85873d2499d5f58a8 | 265 | py | Python | tests/artificial/transf_Integration/trend_PolyTrend/cycle_5/ar_/test_artificial_128_Integration_PolyTrend_5__0.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Integration/trend_PolyTrend/cycle_5/ar_/test_artificial_128_Integration_PolyTrend_5__0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Integration/trend_PolyTrend/cycle_5/ar_/test_artificial_128_Integration_PolyTrend_5__0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 0); | 37.857143 | 165 | 0.732075 |
69213a6af66d14bb005454a5370aeb3c9d99171d | 686 | py | Python | app/core/migrations/0003_ingredient.py | mohit4/recipe-app-api | 9bda7d5edd9e1d45fba0e174c7c0c46072dfe6de | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | mohit4/recipe-app-api | 9bda7d5edd9e1d45fba0e174c7c0c46072dfe6de | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | mohit4/recipe-app-api | 9bda7d5edd9e1d45fba0e174c7c0c46072dfe6de | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-12-22 18:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... | 28.583333 | 118 | 0.618076 |
b9a1d274ebfa05f98646c95fde6beafb02e89c5d | 4,085 | py | Python | Servicios/pesos.py | andresvisco/anviAdium | e0e7d27576eb1f385f129cee997b45674cf8bd1c | [
"MIT"
] | null | null | null | Servicios/pesos.py | andresvisco/anviAdium | e0e7d27576eb1f385f129cee997b45674cf8bd1c | [
"MIT"
] | 1 | 2021-07-03T14:33:00.000Z | 2021-07-03T14:33:00.000Z | Servicios/pesos.py | andresvisco/anviAdium | e0e7d27576eb1f385f129cee997b45674cf8bd1c | [
"MIT"
] | null | null | null | import itertools
from itertools import count
import numpy
from funcionCosto import calcularCostoFB
import math
# listaCantidades = []
import pandas as pd
from lotesScipy import distribucionSciPyNueva#, distribucionSciPyNuevaIter
import logginProcess
def update_value(index, new_value, listaElementos, TLPT):
limite ... | 34.91453 | 133 | 0.613709 |
59236a07e596abb318cd1896fe533ebea878354f | 1,295 | py | Python | app/capacity/resource.py | globocom/iaas-usage | 4fd0ce318ccd46eea94b1c2512d8d0c84d457263 | [
"BSD-3-Clause"
] | 6 | 2016-01-28T23:21:52.000Z | 2019-06-03T20:37:00.000Z | app/capacity/resource.py | globocom/iaas-usage | 4fd0ce318ccd46eea94b1c2512d8d0c84d457263 | [
"BSD-3-Clause"
] | null | null | null | app/capacity/resource.py | globocom/iaas-usage | 4fd0ce318ccd46eea94b1c2512d8d0c84d457263 | [
"BSD-3-Clause"
] | 5 | 2016-06-21T12:58:30.000Z | 2021-04-04T23:21:53.000Z | from app.auth.utils import required_login
from app.cloudstack.cloudstack_base_resource import handle_errors, CloudstackResource
class CloudCapacityResource(CloudstackResource):
capacity_type = { 0: 'Memory', 1: 'CPU', 3: 'Primary Storage', 6: 'Secondary Storage'}
@required_login
@handle_errors
def g... | 38.088235 | 90 | 0.596139 |
5e6a2bfde90b4a33b273d5b6193983388882ba74 | 8,112 | py | Python | src/core/utils/vocab_utils.py | zxgx/Graph2Seq-for-KGQG | ce0f5d2c01a37830d8bacd1494c51faf4bd1ff61 | [
"Apache-2.0"
] | null | null | null | src/core/utils/vocab_utils.py | zxgx/Graph2Seq-for-KGQG | ce0f5d2c01a37830d8bacd1494c51faf4bd1ff61 | [
"Apache-2.0"
] | null | null | null | src/core/utils/vocab_utils.py | zxgx/Graph2Seq-for-KGQG | ce0f5d2c01a37830d8bacd1494c51faf4bd1ff61 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import re
import pickle
import numpy as np
from collections import Counter
from functools import lru_cache
from . import constants
word_detector = re.compile('\w')
class VocabModel(object):
def __init__(self, data_set, config):
prin... | 37.211009 | 129 | 0.623891 |
040803f4b3fa58e85c99a00e31c76dfd71d58542 | 8,608 | py | Python | cron_descriptor/ExpressionParser.py | SpamExperts/cron-descriptor | fad409f0bbea3829b11d7812f165bd9e0f87b3f7 | [
"MIT"
] | null | null | null | cron_descriptor/ExpressionParser.py | SpamExperts/cron-descriptor | fad409f0bbea3829b11d7812f165bd9e0f87b3f7 | [
"MIT"
] | 2 | 2020-02-27T08:56:54.000Z | 2022-03-03T12:04:54.000Z | cron_descriptor/ExpressionParser.py | SpamExperts/cron-descriptor | fad409f0bbea3829b11d7812f165bd9e0f87b3f7 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2016 Adam Schubert
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | 39.486239 | 118 | 0.579809 |
b5c0b13ba8d4344b51651e5aefed0e876140f19b | 7,522 | py | Python | corehq/apps/domain/auth.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/domain/auth.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/domain/auth.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
import base64
import re
from functools import wraps
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.decorators.debug import sensitive_variables
... | 35.314554 | 100 | 0.690242 |
00a291593a1aa92358305ff997ee6720e9de4429 | 4,455 | py | Python | resources/lib/navigation/actions.py | groth-its/plugin.video.netflix | 2d9ef4336924da189526e306b47c63c7fcefabd0 | [
"MIT"
] | 1 | 2020-06-12T15:52:34.000Z | 2020-06-12T15:52:34.000Z | resources/lib/navigation/actions.py | groth-its/plugin.video.netflix | 2d9ef4336924da189526e306b47c63c7fcefabd0 | [
"MIT"
] | null | null | null | resources/lib/navigation/actions.py | groth-its/plugin.video.netflix | 2d9ef4336924da189526e306b47c63c7fcefabd0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Navigation handler for actions"""
from __future__ import unicode_literals
import xbmc
from resources.lib.globals import g
import resources.lib.common as common
import resources.lib.api.shakti as api
import resources.lib.kodi.ui as ui
class AddonActionExecutor(object):
"""Executes acti... | 39.424779 | 98 | 0.640629 |
de109d8bae19023ea34c2e96382b88d6bde93d89 | 295 | py | Python | Dataset/Leetcode/train/27/654.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/27/654.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/27/654.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, nums: List[int], val: int) -> int:
fast, slow = 0, 0
while fast < len(nums):
if nums[fast] != val:
nums[fast], nums[slow] = nums[slow], nums[fast]
slow += 1
fast += 1
return slow
| 26.818182 | 63 | 0.454237 |
b33cb85066a594e2dad5110c22a5f412c2ee4bf9 | 1,996 | py | Python | src/saltext/vmware/modules/vmc_vm_stats.py | kdsalvy/salt-ext-modules-vmware-1 | 9fdc941692e4c526f575f33b2ce23c1470582934 | [
"Apache-2.0"
] | 10 | 2021-11-02T20:24:44.000Z | 2022-03-11T05:54:27.000Z | src/saltext/vmware/modules/vmc_vm_stats.py | waynew/salt-ext-modules-vmware | 9f693382772061676c846c850df6ff508b7f3a91 | [
"Apache-2.0"
] | 83 | 2021-10-01T15:13:02.000Z | 2022-03-31T16:22:40.000Z | src/saltext/vmware/modules/vmc_vm_stats.py | waynew/salt-ext-modules-vmware | 9f693382772061676c846c850df6ff508b7f3a91 | [
"Apache-2.0"
] | 15 | 2021-09-30T23:17:27.000Z | 2022-03-23T06:54:22.000Z | """
Salt execution module for VMC vm stats
Provides methods to get cpu or memory related settings of a virtual machine
"""
import logging
from saltext.vmware.utils import vmc_constants
from saltext.vmware.utils import vmc_request
from saltext.vmware.utils import vmc_vcenter_request
log = logging.getLogger(__name__)
... | 28.927536 | 91 | 0.720441 |
1cff124d47f9687eb32a84608b19fe6fa2e10155 | 6,869 | py | Python | base/modules/utils/root/sb_utils/amqp_tools.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | 1 | 2019-04-29T12:47:17.000Z | 2019-04-29T12:47:17.000Z | base/modules/utils/root/sb_utils/amqp_tools.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | null | null | null | base/modules/utils/root/sb_utils/amqp_tools.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | null | null | null | """
amqp_tools.py
Implements wrapper for kombu module to more-easily read/write from message queue.
"""
import kombu # handles interaction with AMQP server
import socket # identify exceptions that occur with timeout
import datetime # print time received message
import os # to determine localhost on a given machine
... | 37.535519 | 176 | 0.616684 |
fd2054a61c93e0e7fee687a23c33649ac4597c8e | 925 | py | Python | z2/part2/batch/jm/parser_errors_2/153002627.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 1 | 2020-04-16T12:13:47.000Z | 2020-04-16T12:13:47.000Z | z2/part2/batch/jm/parser_errors_2/153002627.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:50:15.000Z | 2020-05-19T14:58:30.000Z | z2/part2/batch/jm/parser_errors_2/153002627.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:45:13.000Z | 2020-06-09T19:18:31.000Z | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 153002627
"""
"""
random actions, total chaos
"""
board = gamma_new(2, 2, 4, 1)
assert board is... | 23.125 | 44 | 0.67027 |
47185d5df5767b44aaf19c9b4c084840a50226f9 | 281 | py | Python | manga_py/meta.py | Abijithkrishna/manga-py | 03b142ecb944ef37a36e5095ffa580209021e3b0 | [
"MIT"
] | null | null | null | manga_py/meta.py | Abijithkrishna/manga-py | 03b142ecb944ef37a36e5095ffa580209021e3b0 | [
"MIT"
] | null | null | null | manga_py/meta.py | Abijithkrishna/manga-py | 03b142ecb944ef37a36e5095ffa580209021e3b0 | [
"MIT"
] | null | null | null | author = 'Sergey Zharkov'
license_type = 'MIT'
email = 'sttv-pc@mail.ru'
version = '1.31.0'
repo_name = 'manga-py/manga-py'
repo_url = 'https://github.com/%s' % repo_name
__all__ = [
'author',
'license_type',
'email',
'version',
'repo_name',
'repo_url',
]
| 17.5625 | 46 | 0.608541 |
e61e64909f12bcf900a5c06304cacfe357d1efde | 4,389 | py | Python | benchmark/startQiskit_Class3307.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class3307.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class3307.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=44
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.833333 | 140 | 0.647756 |
13b8fbda24d8693ff9822fb5b5bc773aa76e3b09 | 1,567 | py | Python | tiledb/cloud/rest_api/test/test_subarray.py | TileDB-Inc/TileDB-Cloud-Py | e73f6e0ae3fc595218abd3be606c68f62ad5ac9b | [
"MIT"
] | 4 | 2019-12-04T23:19:35.000Z | 2021-06-21T21:42:53.000Z | tiledb/cloud/rest_api/test/test_subarray.py | TileDB-Inc/TileDB-Cloud-Py | e73f6e0ae3fc595218abd3be606c68f62ad5ac9b | [
"MIT"
] | 106 | 2019-11-07T22:40:43.000Z | 2022-03-29T22:31:18.000Z | tiledb/cloud/rest_api/test/test_subarray.py | TileDB-Inc/TileDB-Cloud-Py | e73f6e0ae3fc595218abd3be606c68f62ad5ac9b | [
"MIT"
] | 1 | 2020-10-04T18:54:37.000Z | 2020-10-04T18:54:37.000Z | # coding: utf-8
"""
TileDB Storage Platform API
TileDB Storage Platform REST API # noqa: E501
The version of the OpenAPI document: 2.2.19
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import datetime
import unittest
import tiledb.cloud.rest_api
from tile... | 26.116667 | 80 | 0.615826 |
4b4544f9de1bdfd630535629442ad9dec922e62b | 73 | py | Python | lib/replisome/receivers/__init__.py | Zeto-Ltd/replisome | 2be86278d8f826835205b023d552691a1c4295f2 | [
"BSD-3-Clause"
] | null | null | null | lib/replisome/receivers/__init__.py | Zeto-Ltd/replisome | 2be86278d8f826835205b023d552691a1c4295f2 | [
"BSD-3-Clause"
] | null | null | null | lib/replisome/receivers/__init__.py | Zeto-Ltd/replisome | 2be86278d8f826835205b023d552691a1c4295f2 | [
"BSD-3-Clause"
] | 1 | 2018-08-27T07:12:44.000Z | 2018-08-27T07:12:44.000Z | from .json import *
from .test_decoding import *
from .wal2json import *
| 18.25 | 28 | 0.753425 |
3c31cf0abdfac652a2fd2bd95036b7d43fc5e550 | 1,318 | py | Python | rl_trainer/tests/agent/test_in_memory_replay_buffer.py | Roboy/nips-2018-ai-for-prosthetics | acb69f267a0cc852842828edbbfb47d1840c0a17 | [
"BSD-3-Clause"
] | 3 | 2018-08-31T15:04:53.000Z | 2019-07-13T01:11:10.000Z | rl_trainer/tests/agent/test_in_memory_replay_buffer.py | Roboy/nips-2018-ai-for-prosthetics | acb69f267a0cc852842828edbbfb47d1840c0a17 | [
"BSD-3-Clause"
] | null | null | null | rl_trainer/tests/agent/test_in_memory_replay_buffer.py | Roboy/nips-2018-ai-for-prosthetics | acb69f267a0cc852842828edbbfb47d1840c0a17 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from rl_trainer.agent.replay_buffer import InMemoryReplayBuffer
from rl_trainer.commons import ExperienceTupleBatch, ExperienceTuple
BUFFER_SIZE = 10
LOWER_SIZE_LIMIT = 1
EXPERIENCE_TUPLE = ExperienceTuple.mock(action_dim=3, state_dim=4)
def test_construction():
InMemoryReplayBuffer(buffer_size=BU... | 32.146341 | 68 | 0.728376 |
a0f9c26456204ae00f11b875cc7293c56463bd69 | 3,400 | py | Python | shopkit/contrib/checkout/singlestep/app.py | sakkada/django-shopkit | 35e6f8ac73bf6aa40887aa9b1b860d27db8b2975 | [
"BSD-3-Clause"
] | null | null | null | shopkit/contrib/checkout/singlestep/app.py | sakkada/django-shopkit | 35e6f8ac73bf6aa40887aa9b1b860d27db8b2975 | [
"BSD-3-Clause"
] | null | null | null | shopkit/contrib/checkout/singlestep/app.py | sakkada/django-shopkit | 35e6f8ac73bf6aa40887aa9b1b860d27db8b2975 | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import render
from ....checkout import app
class SingleStepCheckoutApp(app.CheckoutApp):
BillingForm = None
checkout_templates = [
'shopkit/checkout/checkout.html',
]
def __init__(self, **kwargs):
super(Sin... | 42.5 | 86 | 0.621765 |
052dd567c8b9e9c300cee72f441cc686cfc0ee8a | 52,345 | py | Python | jax/_src/lax/linalg.py | obkyrush/jax | 8662c5f660678b6320a1a8fc46e917e97c399b57 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-12-25T01:12:42.000Z | 2021-12-25T01:12:42.000Z | jax/_src/lax/linalg.py | obkyrush/jax | 8662c5f660678b6320a1a8fc46e917e97c399b57 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2022-01-31T13:20:35.000Z | 2022-02-14T13:20:49.000Z | jax/_src/lax/linalg.py | obkyrush/jax | 8662c5f660678b6320a1a8fc46e917e97c399b57 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# 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 ... | 37.019095 | 157 | 0.66801 |
dad5d50daf7f210c9dabd09cbdffa1149ce84f2d | 3,997 | py | Python | portable/ARMv8M/copy_files.py | nchong-at-aws/FreeRTOS-Kernel | 4a61f9ff7e2ad058c578952e2a615a123dadeba2 | [
"MIT"
] | 1 | 2021-06-25T08:25:16.000Z | 2021-06-25T08:25:16.000Z | portable/ARMv8M/copy_files.py | nchong-at-aws/FreeRTOS-Kernel | 4a61f9ff7e2ad058c578952e2a615a123dadeba2 | [
"MIT"
] | null | null | null | portable/ARMv8M/copy_files.py | nchong-at-aws/FreeRTOS-Kernel | 4a61f9ff7e2ad058c578952e2a615a123dadeba2 | [
"MIT"
] | 1 | 2021-06-25T08:25:17.000Z | 2021-06-25T08:25:17.000Z | #/*
# * FreeRTOS Kernel V10.3.1
# * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a copy of
# * this software and associated documentation files (the "Software"), to deal in
# * the Software without restri... | 38.432692 | 103 | 0.68001 |
0b44b22c6e5aa82c44a44faab1fab12dd5aaf19a | 3,075 | py | Python | sim/access_dist.py | alchemy315/NoPFS | f3901e963e2301e8a6f1c7aac0511d0cf9a1889d | [
"BSD-3-Clause"
] | null | null | null | sim/access_dist.py | alchemy315/NoPFS | f3901e963e2301e8a6f1c7aac0511d0cf9a1889d | [
"BSD-3-Clause"
] | null | null | null | sim/access_dist.py | alchemy315/NoPFS | f3901e963e2301e8a6f1c7aac0511d0cf9a1889d | [
"BSD-3-Clause"
] | null | null | null | """Plot access distribution for a dataset.
Adapted from the original script by Roman Röhringer.
"""
import argparse
import numpy as np
import scipy.stats
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
parser = argparse.ArgumentParser(
description='Plot access distribution')... | 36.176471 | 76 | 0.666992 |
815585248c84afdcc066a1ad2960728b288a8f27 | 4,212 | py | Python | nova/tests/unit/virt/test_osinfo.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | 1 | 2015-11-30T19:44:00.000Z | 2015-11-30T19:44:00.000Z | nova/tests/unit/virt/test_osinfo.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 11 | 2017-06-19T01:28:55.000Z | 2017-06-23T02:01:47.000Z | nova/tests/unit/virt/test_osinfo.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 7 | 2015-01-20T10:30:08.000Z | 2020-02-05T10:29:05.000Z | # Copyright 2015 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 40.114286 | 78 | 0.653134 |
1e796b51413094203d226c803db84c477d11c1d6 | 2,553 | py | Python | openslides_backend/action/actions/poll/anonymize.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | null | null | null | openslides_backend/action/actions/poll/anonymize.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | null | null | null | openslides_backend/action/actions/poll/anonymize.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | null | null | null | from typing import Any, Dict, List
from ....models.models import Poll
from ....services.datastore.commands import GetManyRequest
from ....shared.exceptions import ActionException
from ....shared.patterns import Collection, FullQualifiedId
from ...generics.update import UpdateAction
from ...util.default_schema import D... | 37 | 84 | 0.650607 |
f90ce633c52cf9b926908ae0a42761f73b5892ea | 375 | py | Python | tests/test_articles.py | BrendaMwiza/News | b68d53d0aefac78fae3de557c145cefd69e03c6b | [
"MIT"
] | null | null | null | tests/test_articles.py | BrendaMwiza/News | b68d53d0aefac78fae3de557c145cefd69e03c6b | [
"MIT"
] | null | null | null | tests/test_articles.py | BrendaMwiza/News | b68d53d0aefac78fae3de557c145cefd69e03c6b | [
"MIT"
] | null | null | null | import unittest
from app.models import Articles
class ArticlesTest(unittest.TestCase):
def setUp(self):
'''
Method that runs before every test
'''
self.article = Articles("id", "name", "author", "title", "description", "url", "urlToImage", "publishedAt")
def test_it(self):
... | 28.846154 | 115 | 0.648 |
728e87cec24d2fa420bf43d78ec528764faf41b0 | 1,983 | py | Python | src/robot/utils/match.py | gdw2/robot-framework | f25068edf1502e76ba8664d4b5ed1aebe0ee2434 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/utils/match.py | gdw2/robot-framework | f25068edf1502e76ba8664d4b5ed1aebe0ee2434 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/utils/match.py | gdw2/robot-framework | f25068edf1502e76ba8664d4b5ed1aebe0ee2434 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2010 Nokia Siemens Networks Oyj
#
# 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... | 32.508197 | 76 | 0.684317 |
9f2704051580a813d9acd965bcf98be095022349 | 60,135 | py | Python | effects.py | tanwar29/BY-GEN-public | 1ec3ff5995bc7fc9e2f2eafe677bf0852fe4e894 | [
"CC0-1.0"
] | null | null | null | effects.py | tanwar29/BY-GEN-public | 1ec3ff5995bc7fc9e2f2eafe677bf0852fe4e894 | [
"CC0-1.0"
] | null | null | null | effects.py | tanwar29/BY-GEN-public | 1ec3ff5995bc7fc9e2f2eafe677bf0852fe4e894 | [
"CC0-1.0"
] | null | null | null | #region Imports
import bpy
from bpy.props import *
from bpy.types import (Panel,StringProperty, EnumProperty,Menu,Operator,PropertyGroup,Scene, WindowManager)
from bpy.app.handlers import persistent
import bpy.utils.previews
import os
import random
from . modules.easybpy import *
#endregion
#region Useful Variables
pre... | 41.472414 | 161 | 0.6369 |
90f1f956ca2d33ab244527eb119e09a01d99ef06 | 111 | py | Python | examples/datetime.datetime.timetz/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | examples/datetime.datetime.timetz/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | examples/datetime.datetime.timetz/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
print(datetime(2000, 6, 30, 12, 34, 56, tzinfo=timezone.utc).timetz())
| 37 | 70 | 0.747748 |
1c177fe91da58637c53fe47b785a2b7126daf2d3 | 8,785 | py | Python | report/helper.py | Memorydemoeric/syc | 6ae424654fa2a53051a4d411b7623eedc320d569 | [
"MIT"
] | null | null | null | report/helper.py | Memorydemoeric/syc | 6ae424654fa2a53051a4d411b7623eedc320d569 | [
"MIT"
] | 1 | 2021-05-13T07:35:51.000Z | 2021-05-13T07:35:51.000Z | report/helper.py | Memorydemoeric/syc | 6ae424654fa2a53051a4d411b7623eedc320d569 | [
"MIT"
] | null | null | null | import datetime
from purchase.models import Purchase
from report.models import CashFlow, CustomerRank, StatementOutputDetail
from storage.models import StorageOut, ProductInfo, StorageOutDetail
class FinalStatementOutputData(object):
def __init__(self, create_date, origin_balance, income, total_actual_price, re... | 44.145729 | 119 | 0.644394 |
d4b51c8fa40715f0a5909aa259f45b03eeaa1945 | 2,660 | py | Python | hardware/pico_driver/scripts/pico_write_xyz_coeff.py | flowarko/astrobee | b51a819254d835050f13e182a9165cd849dd763b | [
"Apache-2.0"
] | null | null | null | hardware/pico_driver/scripts/pico_write_xyz_coeff.py | flowarko/astrobee | b51a819254d835050f13e182a9165cd849dd763b | [
"Apache-2.0"
] | null | null | null | hardware/pico_driver/scripts/pico_write_xyz_coeff.py | flowarko/astrobee | b51a819254d835050f13e182a9165cd849dd763b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in co... | 31.666667 | 85 | 0.701128 |
c9f3bf9661e189c36d04bead5420387ace436d2c | 8,376 | py | Python | src/players/migrations/0004_auto__add_playernick__add_unique_playernick_db_nick_db_type_db_obj.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/players/migrations/0004_auto__add_playernick__add_unique_playernick_db_nick_db_type_db_obj.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/players/migrations/0004_auto__add_playernick__add_unique_playernick_db_nick_db_type_db_obj.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PlayerNick'
db.create_table('players_playernick', (
('id', self.gf('django.db.... | 71.589744 | 187 | 0.573663 |
2a39bd7d52efd7ea2178834c6f14945c908b7554 | 6,842 | py | Python | python/test/function/test_deconvolution.py | isabella232/nnabla | 82a3c6fed382f889d1a4a429c696bb8cedf6ce79 | [
"Apache-2.0"
] | null | null | null | python/test/function/test_deconvolution.py | isabella232/nnabla | 82a3c6fed382f889d1a4a429c696bb8cedf6ce79 | [
"Apache-2.0"
] | null | null | null | python/test/function/test_deconvolution.py | isabella232/nnabla | 82a3c6fed382f889d1a4a429c696bb8cedf6ce79 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017,2018,2019,2020,2021 Sony Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 44.428571 | 112 | 0.614002 |
c6790ef4c55ebcae3d55d2b31caf52aeb888534c | 16,135 | py | Python | backend/coreapp/tests.py | mkst/decomp.me | c016a49ceba0bcd97e4bd617c51e4484d45324a9 | [
"MIT"
] | null | null | null | backend/coreapp/tests.py | mkst/decomp.me | c016a49ceba0bcd97e4bd617c51e4484d45324a9 | [
"MIT"
] | null | null | null | backend/coreapp/tests.py | mkst/decomp.me | c016a49ceba0bcd97e4bd617c51e4484d45324a9 | [
"MIT"
] | null | null | null | from django.test.testcases import TestCase
from coreapp.m2c_wrapper import M2CWrapper
from coreapp.compiler_wrapper import CompilerWrapper
from django.urls import reverse
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
import responses
from time... | 35.152505 | 150 | 0.626278 |
2537ea00222c8b789bc9b4ab08723d5b06a3dfb4 | 18,373 | py | Python | ngsscriptlibrary/mosaic.py | martinhaagmans/ngsscriptlibrary | dbadb009044e377cbb6e192148a9db1525a277a9 | [
"MIT"
] | null | null | null | ngsscriptlibrary/mosaic.py | martinhaagmans/ngsscriptlibrary | dbadb009044e377cbb6e192148a9db1525a277a9 | [
"MIT"
] | null | null | null | ngsscriptlibrary/mosaic.py | martinhaagmans/ngsscriptlibrary | dbadb009044e377cbb6e192148a9db1525a277a9 | [
"MIT"
] | null | null | null | import os
import csv
import json
import glob
import sqlite3
from statistics import mean
from collections import namedtuple
from collections import defaultdict
import vcf
import pysam
import seaborn as sns
import matplotlib.pyplot as plt
class Mosaic:
"""Handle all things database for mosaic analysis."""
def... | 32.40388 | 116 | 0.560224 |
3b05a17563bfa8f177016c4efe6b52723f26f442 | 1,003 | py | Python | techminer2/cross_corr_matrix_html.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | techminer2/cross_corr_matrix_html.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | techminer2/cross_corr_matrix_html.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | """
Cross-correlation Matrix / HTML
===============================================================================
>>> from techminer2 import *
>>> directory = "data/"
>>> cross_corr_matrix_html(
... 'authors',
... min_occ=3,
... by='countries',
... min_occ_by=6,
... directory=directory,
... )... | 19.666667 | 79 | 0.551346 |
038fae32358962368581a43ea7ac14a7128986fe | 13,122 | py | Python | tests/test_crawler.py | wahello/scrapy | b82a480e91ba3fb43b8c75f1e70d204919105e4b | [
"BSD-3-Clause"
] | 3 | 2020-08-06T04:59:26.000Z | 2020-08-19T01:22:39.000Z | tests/test_crawler.py | wahello/scrapy | b82a480e91ba3fb43b8c75f1e70d204919105e4b | [
"BSD-3-Clause"
] | 4 | 2020-06-06T03:16:43.000Z | 2020-07-27T16:43:50.000Z | tests/test_crawler.py | wahello/scrapy | b82a480e91ba3fb43b8c75f1e70d204919105e4b | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
import subprocess
import sys
import warnings
from pytest import raises, mark
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial import unittest
import scrapy
from scrapy.crawler import Crawler, CrawlerRunner, CrawlerProcess
from scrapy.settings import Se... | 38.25656 | 112 | 0.682137 |
65164d1bc114d3e2b2b64934bbdf0281e73194c1 | 1,712 | py | Python | BFS/630.Knight Shortest Path II/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 12 | 2019-05-04T04:21:27.000Z | 2022-03-02T07:06:57.000Z | BFS/630.Knight Shortest Path II/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 1 | 2019-07-24T18:43:53.000Z | 2019-07-24T18:43:53.000Z | BFS/630.Knight Shortest Path II/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 10 | 2019-07-01T04:03:04.000Z | 2022-03-09T03:57:37.000Z | from collections import deque, namedtuple
class Solution:
"""
@param grid: a chessboard included 0 and 1
@return: the shortest path
"""
EMPTY = 0
BARRIER = 1
dX = [1, -1, 2, -2]
dY = [2, 2, 1, 1]
def shortestPath2(self, grid):
# write your code here
if not grid or... | 28.065574 | 102 | 0.488902 |
e72f3b514cd7e0f90dff288dea23dd3ff048ac7c | 2,575 | py | Python | microservice_flask.py | acumos/model-runner-rds-model-runner | 7a77101130440f1d5e781f8d8f0c7e978a9a9ded | [
"Apache-2.0"
] | null | null | null | microservice_flask.py | acumos/model-runner-rds-model-runner | 7a77101130440f1d5e781f8d8f0c7e978a9a9ded | [
"Apache-2.0"
] | null | null | null | microservice_flask.py | acumos/model-runner-rds-model-runner | 7a77101130440f1d5e781f8d8f0c7e978a9a9ded | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# ===============LICENSE_START=======================================================
# Acumos Apache-2.0
# ===================================================================================
# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
# =================================... | 35.763889 | 118 | 0.645437 |
47673efb7ccfe5867c388b21f9323d6d81737651 | 1,361 | py | Python | var/spack/repos/builtin/packages/r-blob/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-blob/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-blob/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RBlob(RPackage):
"""A Simple S3 Class for Representing Vectors of Binary Data ('BLOBS')
... | 45.366667 | 95 | 0.706833 |
76224124b0eff4ee6893b50b8c3e6a844af9365a | 2,029 | py | Python | tests/test_environments/test_action_playback.py | JadeCong/jade_robosuite | 0d4b4efd9ca95742ed375ce0b0d4e16d499cec06 | [
"MIT"
] | null | null | null | tests/test_environments/test_action_playback.py | JadeCong/jade_robosuite | 0d4b4efd9ca95742ed375ce0b0d4e16d499cec06 | [
"MIT"
] | null | null | null | tests/test_environments/test_action_playback.py | JadeCong/jade_robosuite | 0d4b4efd9ca95742ed375ce0b0d4e16d499cec06 | [
"MIT"
] | null | null | null | """
Test script for recording a sequence of random actions and playing them back
"""
import sys
sys.path.append("/home/jade/Documents/JadeCloud/Works/Aisono/Projects/Workflows/Doing/PycharmProjects/aisono-robosuite")
import os
import h5py
import argparse
import random
import numpy as np
import json
import robosuite
... | 26.012821 | 120 | 0.685559 |
504dd4e1514ebe902db41c7de8653b4297996fb4 | 2,468 | py | Python | src/general.py | rbnuria/TASS-2018 | 48c4e382058b5bdb93b61c9148fdeed1da166065 | [
"Apache-2.0"
] | 2 | 2018-12-19T14:39:37.000Z | 2019-04-11T16:42:27.000Z | src/general.py | rbnuria/TASS-2018 | 48c4e382058b5bdb93b61c9148fdeed1da166065 | [
"Apache-2.0"
] | null | null | null | src/general.py | rbnuria/TASS-2018 | 48c4e382058b5bdb93b61c9148fdeed1da166065 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def prepareData(train, dev, embeddings):
'''
Almacenamiento de palabras en nuestro vocabulario -> Añadimos al vocabulario
aquellas palabras que estén en el subconjunto de los embeddings seleccionados
(200000) + 2 de padding y unkown
'''
vocabulary = {}
vocabulary["PADDING"] = len(vocabular... | 24.435644 | 84 | 0.705835 |
396cbbb1d5afb467743437f4d7b4b611562e4122 | 2,198 | py | Python | python3-virtualenv/lib/python3.6/site-packages/importlib_metadata/_text.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/importlib_metadata/_text.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/importlib_metadata/_text.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | import re
from ._functools import method_cache
# from jaraco.text 3.5
class FoldedCase(str):
"""
A case insensitive string class; behaves just like str
except compares equal when the only variation is case.
>>> s = FoldedCase('hello world')
>>> s == 'Hello World'
True
>>> 'Hello World'... | 21.98 | 74 | 0.596451 |
a789edd2453f15dd828accdbd499ef449b05341f | 650 | py | Python | sdk/boost_1_30_0/tools/build/test/direct_request_test.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | 2 | 2020-01-30T12:51:49.000Z | 2020-08-31T08:36:49.000Z | sdk/boost_1_30_0/tools/build/test/direct_request_test.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | sdk/boost_1_30_0/tools/build/test/direct_request_test.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | #!/usr/bin/python
from BoostBuild import Tester, List
import os
from string import strip
t = Tester()
# First check some startup
t.set_tree("direct-request-test")
t.run_build_system(extra_args="define=MACROS")
t.expect_addition("bin/$toolset/debug/"
* (List("a.o b.o b.dll a.exe")))
... | 22.413793 | 56 | 0.644615 |
0d8382878dbce6ddf7ce8ce123d7a9ded47e0a2c | 2,640 | py | Python | HW4-3/lib/agent/preprocess.py | b05611038/MLDS_2019SPRING | 0591a1a6f461da0a02b9e1b83f37ad3579f36f4d | [
"MIT"
] | 3 | 2019-06-20T06:47:30.000Z | 2021-11-05T03:16:37.000Z | HW4-3/lib/agent/preprocess.py | b05611038/MLDS_2019SPRING | 0591a1a6f461da0a02b9e1b83f37ad3579f36f4d | [
"MIT"
] | null | null | null | HW4-3/lib/agent/preprocess.py | b05611038/MLDS_2019SPRING | 0591a1a6f461da0a02b9e1b83f37ad3579f36f4d | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torchvision
import torchvision.transforms as T
from PIL import Image
#transform dictionary format pass in the class
# {'implenmented string': True}
class Transform(object):
def __init__(self, preprocess_dict, device):
self.implemented_list = self.implenmented()
... | 33 | 92 | 0.655303 |
42a1dd9a9923334f798b01add7567bd5e7e8f139 | 1,537 | py | Python | setup.py | enggabhishekshinde/AWS_Chalice | 78261b06bd885e3cd7172616e6a5687a0d88adf7 | [
"Apache-2.0"
] | null | null | null | setup.py | enggabhishekshinde/AWS_Chalice | 78261b06bd885e3cd7172616e6a5687a0d88adf7 | [
"Apache-2.0"
] | null | null | null | setup.py | enggabhishekshinde/AWS_Chalice | 78261b06bd885e3cd7172616e6a5687a0d88adf7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
install_requires = [
'click>=6.6,<8.0',
'botocore>=1.12.86,<2.0.0',
'typing==3.6.4;python_version<"3.7"',
'six>=1.10.0,<2.0.0',
'pip>=9,<20.2',
'attrs>=19... | 26.964912 | 61 | 0.58946 |
881492df5fda8be929e7c463d5a6fa66ef641ca6 | 6,846 | py | Python | buildscripts/resmokelib/config.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 4 | 2018-02-06T01:53:12.000Z | 2018-02-20T01:47:36.000Z | buildscripts/resmokelib/config.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | null | null | null | buildscripts/resmokelib/config.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 3 | 2018-02-06T01:53:18.000Z | 2021-07-28T09:48:15.000Z | """
Configuration options for resmoke.py.
"""
from __future__ import absolute_import
import os
import os.path
import time
##
# Default values.
##
# Default path for where to look for executables.
DEFAULT_DBTEST_EXECUTABLE = os.path.join(os.curdir, "dbtest")
DEFAULT_MONGO_EXECUTABLE = os.path.join(... | 34.928571 | 101 | 0.733859 |
02d67b3edb027fa143a19148f73f54106c550513 | 915 | py | Python | atom/electron/python/test/test_ach_card_request_co.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/electron/python/test/test_ach_card_request_co.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/electron/python/test/test_ach_card_request_co.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Electron API
The Hydrogen Electron API # noqa: E501
OpenAPI spec version: 1.3.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import electron_api
from... | 22.317073 | 92 | 0.712568 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.