hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f753023f1508f1f3c459466ddb192c4be9c79b3e | 3,560 | py | Python | ambari-server/src/test/python/TestVersionSelectUtil.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | 3 | 2016-12-01T15:55:11.000Z | 2016-12-01T15:56:38.000Z | ambari-server/src/test/python/TestVersionSelectUtil.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/TestVersionSelectUtil.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-01-07T08:55:01.000Z | 2021-01-07T08:55:01.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 use this ... | 37.87234 | 162 | 0.705899 |
from unittest import TestCase
import os
from mock.mock import patch, MagicMock
from resource_management.core.logger import Logger
class TestVersionSelectUtil(TestCase):
def setUp(self):
import imp
Logger.logger = MagicMock()
self.test_directory = os.path.dirname(os.path.abspath(__file__))
test_fi... | true | true |
f75303662800f737c834689b990c32bbe2d19c44 | 2,482 | py | Python | 3Dface_priors/facial_landmark.py | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | [
"MIT"
] | 29 | 2020-10-19T09:59:22.000Z | 2022-03-28T00:55:34.000Z | 3Dface_priors/facial_landmark.py | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | [
"MIT"
] | 10 | 2021-01-29T20:36:38.000Z | 2021-11-30T07:25:36.000Z | 3Dface_priors/facial_landmark.py | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | [
"MIT"
] | 4 | 2020-12-07T15:41:13.000Z | 2021-11-07T07:07:27.000Z | # import the necessary packages
from imutils import face_utils
import numpy as np
import argparse
import imutils
import dlib
import cv2
#python facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat --image test1.jpg
def rect_to_bb(rect):
# take a bounding predicted by dlib and convert it
# to the ... | 37.044776 | 101 | 0.692184 | from imutils import face_utils
import numpy as np
import argparse
import imutils
import dlib
import cv2
def rect_to_bb(rect):
x = rect.left()
y = rect.top()
w = rect.right() - x
h = rect.bottom() - y
return (x, y, w, h)
def shape_to_np(shape, dtype="int"):
coords = np.zeros((68, 2), dtype=d... | true | true |
f7530443cbcf99b302496fac676d8ba76e94f0ae | 11,932 | py | Python | userbot/modules/android.py | CrysTalesiaS/Bot | 69312bda7d009ff39dad81e0c9cfcc77dd9038e6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/android.py | CrysTalesiaS/Bot | 69312bda7d009ff39dad81e0c9cfcc77dd9038e6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/android.py | CrysTalesiaS/Bot | 69312bda7d009ff39dad81e0c9cfcc77dd9038e6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing commands related to android"""
import asyncio
import json
import re
import os
import tim... | 36.048338 | 96 | 0.573416 |
import asyncio
import json
import re
import os
import time
import math
from requests import get
from bs4 import BeautifulSoup
from userbot import CMD_HELP, TEMP_DOWNLOAD_DIRECTORY
from userbot.events import register
from userbot.utils import (
chrome, humanbytes, time_formatter, md5, human_to_bytes
)
GITHUB = '... | true | true |
f75304e9fc1ebda25188ae03374672ad4149393d | 741 | py | Python | main.py | CodeSlammers/python-base | c9e3b0c564d792355cfec6132cd5048d77eed230 | [
"MIT"
] | 1 | 2018-02-18T04:22:40.000Z | 2018-02-18T04:22:40.000Z | main.py | CodeSlammers/python-base | c9e3b0c564d792355cfec6132cd5048d77eed230 | [
"MIT"
] | null | null | null | main.py | CodeSlammers/python-base | c9e3b0c564d792355cfec6132cd5048d77eed230 | [
"MIT"
] | null | null | null | from flask import Flask
from database import register_db
from flask_bootstrap import Bootstrap
from flask_debug import Debug
from flask_session import Session
from nav import nav
from bundle import apply_assets
app = Flask(__name__)
app.config.from_object('config.DevConfig')
session = Session(app)
register_db(app, app... | 24.7 | 106 | 0.790823 | from flask import Flask
from database import register_db
from flask_bootstrap import Bootstrap
from flask_debug import Debug
from flask_session import Session
from nav import nav
from bundle import apply_assets
app = Flask(__name__)
app.config.from_object('config.DevConfig')
session = Session(app)
register_db(app, app... | true | true |
f753076e3b9b5889a5186f9b50ee54614cf38174 | 5,017 | py | Python | rf_file_handler.py | paulgclark/rf_utilities | 8caada61fa95f308e3e93970ca1419e9d95183af | [
"MIT"
] | 10 | 2017-10-15T18:19:31.000Z | 2022-03-24T22:51:25.000Z | rf_file_handler.py | paulgclark/rf_utilities | 8caada61fa95f308e3e93970ca1419e9d95183af | [
"MIT"
] | null | null | null | rf_file_handler.py | paulgclark/rf_utilities | 8caada61fa95f308e3e93970ca1419e9d95183af | [
"MIT"
] | 6 | 2018-12-06T04:58:55.000Z | 2022-03-24T22:51:27.000Z | # These functions process and produce names for IQ data files using the
# following format:
# <descriptive text>_c<center frequency>_s<sample rate>.iq
#
# both the center frequency and the sample rate must be expressed in
# with gnuradio (eng_option) suffixes:
# k = 10^3
# M = 10^6
# G = 10^9
#
# Example: a file named ... | 35.835714 | 78 | 0.560494 |
debug = False
def fileNameTextToFloat(valStr, unitStr):
if 'p' in valStr:
print "decimal value found"
regex = re.compile(r"([0-9]+)p([0-9]+)")
wholeVal = regex.findall(valStr)[0][0]
decimalVal = regex.findall(valStr)[0][1]
baseVal = 1.0*int(wholeVal) + 1.0*int(decimalVa... | false | true |
f75307e01b7d8e1cf10f6b81f541c91949631213 | 16,523 | py | Python | sphinx/ext/autosummary/__init__.py | sphinxjp/doc10 | 0f47a8091cfa976bac5033aa07ec9a39ab71e7f0 | [
"BSD-2-Clause"
] | null | null | null | sphinx/ext/autosummary/__init__.py | sphinxjp/doc10 | 0f47a8091cfa976bac5033aa07ec9a39ab71e7f0 | [
"BSD-2-Clause"
] | null | null | null | sphinx/ext/autosummary/__init__.py | sphinxjp/doc10 | 0f47a8091cfa976bac5033aa07ec9a39ab71e7f0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.ext.autosummary
~~~~~~~~~~~~~~~~~~~~~~
Sphinx extension that adds an autosummary:: directive, which can be
used to generate function/method/attribute/etc. summary lists, similar
to those output eg. by Epydoc and other API doc generation tools.
An :autolink: r... | 32.98004 | 80 | 0.564123 | """
sphinx.ext.autosummary
~~~~~~~~~~~~~~~~~~~~~~
Sphinx extension that adds an autosummary:: directive, which can be
used to generate function/method/attribute/etc. summary lists, similar
to those output eg. by Epydoc and other API doc generation tools.
An :autolink: role is also provided.
... | false | true |
f753091a0f09b22966f035c2520fb456a34008af | 2,973 | py | Python | universaldatatool/sample.py | bribroder/python-universaldatatool | 343b3c0f137bf94a99941c299f25dac16680afcc | [
"MIT"
] | 4 | 2020-04-30T22:15:43.000Z | 2021-01-16T15:48:35.000Z | universaldatatool/sample.py | bribroder/python-universaldatatool | 343b3c0f137bf94a99941c299f25dac16680afcc | [
"MIT"
] | 6 | 2020-06-22T13:26:32.000Z | 2020-08-08T23:59:01.000Z | universaldatatool/sample.py | bribroder/python-universaldatatool | 343b3c0f137bf94a99941c299f25dac16680afcc | [
"MIT"
] | 5 | 2020-05-25T04:39:41.000Z | 2021-08-11T23:59:26.000Z | from .camelify import camelify_dict, camelify
import os
def correct_param(name, value):
if name == "img" and not value.startswith("http"):
name = "imagePath"
if name.endswith("Path"):
name = name[:-4] + "Url"
value = "file://" + os.path.abspath(value)
elif name == "audio" or name =... | 29.73 | 99 | 0.536159 | from .camelify import camelify_dict, camelify
import os
def correct_param(name, value):
if name == "img" and not value.startswith("http"):
name = "imagePath"
if name.endswith("Path"):
name = name[:-4] + "Url"
value = "file://" + os.path.abspath(value)
elif name == "audio" or name =... | true | true |
f7530947b45a89cad5e454f88ca6d81ff1118e32 | 4,161 | py | Python | tests/test_account.py | Korben11/dj-stripe | 06661c174f0cda52b33be9a421f8b80438d71ab0 | [
"MIT"
] | null | null | null | tests/test_account.py | Korben11/dj-stripe | 06661c174f0cda52b33be9a421f8b80438d71ab0 | [
"MIT"
] | null | null | null | tests/test_account.py | Korben11/dj-stripe | 06661c174f0cda52b33be9a421f8b80438d71ab0 | [
"MIT"
] | null | null | null | """
dj-stripe Account Tests.
"""
from copy import deepcopy
from unittest.mock import patch
import pytest
from django.test.testcases import TestCase
from djstripe.models import Account
from djstripe.settings import STRIPE_SECRET_KEY
from . import (
FAKE_ACCOUNT,
FAKE_FILEUPLOAD_ICON,
FAKE_FILEUPLOAD_LOGO,... | 32.76378 | 88 | 0.719539 | from copy import deepcopy
from unittest.mock import patch
import pytest
from django.test.testcases import TestCase
from djstripe.models import Account
from djstripe.settings import STRIPE_SECRET_KEY
from . import (
FAKE_ACCOUNT,
FAKE_FILEUPLOAD_ICON,
FAKE_FILEUPLOAD_LOGO,
IS_STATICMETHOD_AUTOSPEC_SUP... | true | true |
f75309684c7846950442fba245fe375d97159a9b | 8,360 | py | Python | config/settings/production.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | null | null | null | config/settings/production.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | null | null | null | config/settings/production.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | 1 | 2020-09-30T17:38:59.000Z | 2020-09-30T17:38:59.000Z | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY')
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 39.809524 | 96 | 0.615789 | from .base import * from .base import env
SECRET_KEY = env('DJANGO_SECRET_KEY')
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['ploopy.oa.to'])
DATABASES['default'] = env.db('DATABASE_URL') DATABASES['default']['ATOMIC_REQUESTS'] = True DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', defa... | true | true |
f75309f92daf715fa82b4ec279b7d901fd935a55 | 1,956 | py | Python | auth-api/migrations/versions/eaef1147f25c_permissions_for_frcr_review.py | argush3/sbc-auth | 96a4de3a4358b3158540aea8c4d99e06909793f2 | [
"Apache-2.0"
] | null | null | null | auth-api/migrations/versions/eaef1147f25c_permissions_for_frcr_review.py | argush3/sbc-auth | 96a4de3a4358b3158540aea8c4d99e06909793f2 | [
"Apache-2.0"
] | null | null | null | auth-api/migrations/versions/eaef1147f25c_permissions_for_frcr_review.py | argush3/sbc-auth | 96a4de3a4358b3158540aea8c4d99e06909793f2 | [
"Apache-2.0"
] | 1 | 2019-07-25T18:20:41.000Z | 2019-07-25T18:20:41.000Z | """permissions for FRCR review
Revision ID: eaef1147f25c
Revises: b72d4946fb3c
Create Date: 2021-01-09 08:11:26.337104
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import column, table
# revision identifiers, used by Alembic.
revision = 'eaef1147f25c'
down_revision = 'b72d4946fb3c'
branch_l... | 39.918367 | 118 | 0.642638 | import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import column, table
revision = 'eaef1147f25c'
down_revision = 'b72d4946fb3c'
branch_labels = None
depends_on = None
def upgrade():
permissions_table = table('permissions',
column('id', sa.Integer()),
... | true | true |
f7530a3b90444f1e9d5a3f44ae3a9254398ca381 | 2,428 | py | Python | tests/ext/sklearn/test_model.py | koskotG/ebonite | 9f9ae016b70fb24865d5edc99142afb8ab4ddc59 | [
"Apache-2.0"
] | 270 | 2019-11-14T15:46:08.000Z | 2021-09-17T16:43:03.000Z | tests/ext/test_sklearn/test_model.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 14 | 2019-11-29T11:49:39.000Z | 2022-02-10T00:23:59.000Z | tests/ext/test_sklearn/test_model.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 18 | 2019-11-22T13:15:14.000Z | 2021-09-01T13:36:12.000Z | import numpy as np
import pytest
from sklearn.linear_model import LinearRegression, LogisticRegression
from ebonite.core.analyzer.model import ModelAnalyzer
from ebonite.ext.sklearn import SklearnModelWrapper
@pytest.fixture
def inp_data():
return [[1, 2, 3], [3, 2, 1]]
@pytest.fixture
def out_data():
retu... | 30.35 | 107 | 0.743822 | import numpy as np
import pytest
from sklearn.linear_model import LinearRegression, LogisticRegression
from ebonite.core.analyzer.model import ModelAnalyzer
from ebonite.ext.sklearn import SklearnModelWrapper
@pytest.fixture
def inp_data():
return [[1, 2, 3], [3, 2, 1]]
@pytest.fixture
def out_data():
retu... | true | true |
f7530abf37296b6ec799486b241f1b0899e56b7e | 90 | py | Python | pod_manager/api/urls_v10.py | racker/pod-manager | 40a748eed8931e98f5ae01b03b4590ec192ad6ed | [
"Apache-2.0"
] | null | null | null | pod_manager/api/urls_v10.py | racker/pod-manager | 40a748eed8931e98f5ae01b03b4590ec192ad6ed | [
"Apache-2.0"
] | null | null | null | pod_manager/api/urls_v10.py | racker/pod-manager | 40a748eed8931e98f5ae01b03b4590ec192ad6ed | [
"Apache-2.0"
] | null | null | null | from werkzeug.routing import Map, Rule
url_map = Map([
Rule('/', endpoint='home')
])
| 15 | 38 | 0.644444 | from werkzeug.routing import Map, Rule
url_map = Map([
Rule('/', endpoint='home')
])
| true | true |
f7530acb46b2e33fc5406c1a24957aeb2468be97 | 1,930 | py | Python | nitorch/nitorch/initialization.py | derEitel/patch_individual_filter_layer | ecd7b3ace759e10ceda8c39ebe1190a7bc27f223 | [
"BSD-3-Clause"
] | 2 | 2021-12-29T12:04:08.000Z | 2022-01-20T05:11:00.000Z | nitorch/nitorch/initialization.py | derEitel/patch_individual_filter_layer | ecd7b3ace759e10ceda8c39ebe1190a7bc27f223 | [
"BSD-3-Clause"
] | null | null | null | nitorch/nitorch/initialization.py | derEitel/patch_individual_filter_layer | ecd7b3ace759e10ceda8c39ebe1190a7bc27f223 | [
"BSD-3-Clause"
] | null | null | null | # Initialize weights
from torch.nn import init, Conv3d, BatchNorm3d, Linear
def xavier(x):
"""Wrapper for torch.nn.init.xavier method.
Parameters
----------
x : torch.tensor
Input tensor to be initialized. See torch.nn.init.py for more information
Returns
-------
torch.tensor
... | 19.896907 | 81 | 0.609326 | from torch.nn import init, Conv3d, BatchNorm3d, Linear
def xavier(x):
return init.xavier_normal_(x)
def xavier_uniform(x):
return init.xavier_uniform_(x)
def he(x):
return init.kaiming_normal_(x)
def he_uniform(x):
return init.kaiming_uniform_(x)
def weights_init(m, func=he_uniform):
if is... | true | true |
f7530bbb67b96ea8bc79fdde0def14765fcf08aa | 20,788 | py | Python | ivi/dicon/diconGP700.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/dicon/diconGP700.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/dicon/diconGP700.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014-2016 Alex Forencich
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... | 40.601563 | 121 | 0.538484 |
import time
from .. import ivi
from .. import scpi
class diconGP700(scpi.common.IdnCommand, scpi.common.ErrorQuery, scpi.common.Reset,
scpi.common.SelfTest, scpi.common.Memory,
ivi.Driver):
def __init__(self, *args, **kwargs):
self.__dict__.setdefault('_instrument_i... | true | true |
f7530be5d969556ae26c51e8c12195cd943aa557 | 618 | py | Python | apps/base/urls/attribute.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 115 | 2019-08-18T16:12:54.000Z | 2022-03-29T14:17:20.000Z | apps/base/urls/attribute.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 22 | 2019-09-09T01:34:54.000Z | 2022-03-12T00:33:40.000Z | apps/base/urls/attribute.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 83 | 2019-08-17T17:09:20.000Z | 2022-03-25T04:46:53.000Z | """The store routes
"""
# Django Library
from django.urls import path
# Localfolder Library
from ..views.attribute import (
AttributeCreateView, AttributeDeleteView, AttributeDetailView,
AttributeListView, AttributeUpdateView)
app_name = 'PyAttribute'
urlpatterns = [
path('', AttributeListView.as_view(),... | 30.9 | 75 | 0.710356 | from django.urls import path
from ..views.attribute import (
AttributeCreateView, AttributeDeleteView, AttributeDetailView,
AttributeListView, AttributeUpdateView)
app_name = 'PyAttribute'
urlpatterns = [
path('', AttributeListView.as_view(), name='list'),
path('add/', AttributeCreateView.as_view(), ... | true | true |
f7530cd5a418fe3ada85b5024506dbdae38333f9 | 1,869 | py | Python | level03/smartshoe/save_accel_righthip_serial2csv.py | bmcage/skills4smartex | 44ed5b074c441974cd66025ef83b0eb7ca12546c | [
"BSD-3-Clause"
] | null | null | null | level03/smartshoe/save_accel_righthip_serial2csv.py | bmcage/skills4smartex | 44ed5b074c441974cd66025ef83b0eb7ca12546c | [
"BSD-3-Clause"
] | null | null | null | level03/smartshoe/save_accel_righthip_serial2csv.py | bmcage/skills4smartex | 44ed5b074c441974cd66025ef83b0eb7ca12546c | [
"BSD-3-Clause"
] | null | null | null | # test04 code prints to serial the following:
# print (sec, accel, peaks[current_peak-1], peaks_sec[current_peak-1],
# valleys[current_valley-1], valleys_sec[current_valley-1], amplitude_avg)
# we capture this here and save
import serial
import time
import csv
# Typing dmesg | tail will shows you which /d... | 29.203125 | 84 | 0.573034 | import serial
import time
import csv
port = '/dev/ttyACM0'
filename = "walking_data_accelhip.csv"
import os.path
if os.path.isfile(filename):
print("File {0} exists. Rename!".format(filename))
raise Exception("File {0} exists. Rename!".format(filename))
ser = serial.Serial(port=port,
... | true | true |
f7530d4ab538ce6db0697cae062250304970795a | 3,384 | py | Python | updateReadme.py | githubib/hosts | 595249aa6fa59ccac0211dcf43c9a2af66a32505 | [
"MIT"
] | 22,197 | 2015-01-05T09:30:34.000Z | 2022-03-31T20:22:18.000Z | updateReadme.py | githubib/hosts | 595249aa6fa59ccac0211dcf43c9a2af66a32505 | [
"MIT"
] | 1,853 | 2015-01-02T01:53:21.000Z | 2022-03-31T13:21:27.000Z | updateReadme.py | githubib/hosts | 595249aa6fa59ccac0211dcf43c9a2af66a32505 | [
"MIT"
] | 2,687 | 2015-01-05T06:06:17.000Z | 2022-03-29T23:03:43.000Z | #!/usr/bin/env python
# Script by Steven Black
# https://github.com/StevenBlack
#
# This Python script will update the readme files in this repo.
import json
import os
import time
from string import Template
# Project Settings
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
README_TEMPLATE = os.path.join(... | 31.626168 | 79 | 0.525414 |
import json
import os
import time
from string import Template
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
README_TEMPLATE = os.path.join(BASEDIR_PATH, "readme_template.md")
README_FILENAME = "readme.md"
README_DATA_FILENAME = "readmeData.json"
def main():
s = Template(
"${description} | ... | true | true |
f7530dd6872500b0ff66d15833e6117be533e251 | 10,767 | py | Python | tranzact/wallet/wallet_coin_store.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | 8 | 2021-09-19T18:57:49.000Z | 2022-02-09T04:32:50.000Z | tranzact/wallet/wallet_coin_store.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | 3 | 2021-09-29T10:56:48.000Z | 2021-11-19T00:09:28.000Z | tranzact/wallet/wallet_coin_store.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Optional, Set
import aiosqlite
import sqlite3
from tranzact.types.blockchain_format.coin import Coin
from tranzact.types.blockchain_format.sized_bytes import bytes32
from tranzact.util.db_wrapper import DBWrapper
from tranzact.util.ints import uint32, uint64
from tranzact.wallet.util.wa... | 43.068 | 120 | 0.637782 | from typing import Dict, List, Optional, Set
import aiosqlite
import sqlite3
from tranzact.types.blockchain_format.coin import Coin
from tranzact.types.blockchain_format.sized_bytes import bytes32
from tranzact.util.db_wrapper import DBWrapper
from tranzact.util.ints import uint32, uint64
from tranzact.wallet.util.wa... | true | true |
f7530f647018869e81b46fbba98bce81ce524309 | 129,355 | py | Python | astropy/io/votable/tree.py | piersharding/astropy | 9680cd546aa9063758f2c23c836ca79a7c8f1eb1 | [
"BSD-3-Clause"
] | null | null | null | astropy/io/votable/tree.py | piersharding/astropy | 9680cd546aa9063758f2c23c836ca79a7c8f1eb1 | [
"BSD-3-Clause"
] | null | null | null | astropy/io/votable/tree.py | piersharding/astropy | 9680cd546aa9063758f2c23c836ca79a7c8f1eb1 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: Test FITS parsing
# STDLIB
import io
import re
import gzip
import base64
import codecs
import urllib.request
# THIRD-PARTY
import numpy as np
from numpy import ma
# LOCAL
from astropy.io import fits
from astropy import __version__ as astropy_ver... | 33.659901 | 102 | 0.542863 |
import io
import re
import gzip
import base64
import codecs
import urllib.request
import numpy as np
from numpy import ma
from astropy.io import fits
from astropy import __version__ as astropy_version
from astropy.utils.collections import HomogeneousList
from astropy.utils.xml.writer import XMLWriter
from . import ... | true | true |
f75310af67421781de6b7e4f35d2e535421bd044 | 13,298 | py | Python | dlp/google/cloud/dlp_v2/gapic/enums.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | dlp/google/cloud/dlp_v2/gapic/enums.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | dlp/google/cloud/dlp_v2/gapic/enums.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-30T02:23:29.000Z | 2020-11-30T02:23:29.000Z | # -*- 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... | 30.360731 | 113 | 0.641224 |
import enum
class Likelihood(enum.IntEnum):
LIKELIHOOD_UNSPECIFIED = 0
VERY_UNLIKELY = 1
UNLIKELY = 2
POSSIBLE = 3
LIKELY = 4
VERY_LIKELY = 5
class FileType(enum.IntEnum):
FILE_TYPE_UNSPECIFIED = 0
BINARY_FILE = 1
TEXT_FILE = 2
class DayOfWeek(enum.IntEnum):
DAY_OF_WEEK... | true | true |
f75310b346a0feebc0bf75d93c3aee032a65515e | 1,576 | py | Python | tf.py | tsaodingtw/pttanal | c1d786c04e2d6f1ce02f6886748b4dbec1f37676 | [
"MIT"
] | null | null | null | tf.py | tsaodingtw/pttanal | c1d786c04e2d6f1ce02f6886748b4dbec1f37676 | [
"MIT"
] | null | null | null | tf.py | tsaodingtw/pttanal | c1d786c04e2d6f1ce02f6886748b4dbec1f37676 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from feature import Feature
import sqlite3
import pickle
db = sqlite3.connect('ptt.db')
cur = db.execute('SELECT * FROM ARTICLES LIMIT 1000')
# Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3
f = Feature()
post_data = []
push_data = []
boo_data = []
for i in c... | 28.654545 | 72 | 0.680838 | import tensorflow as tf
import numpy as np
from feature import Feature
import sqlite3
import pickle
db = sqlite3.connect('ptt.db')
cur = db.execute('SELECT * FROM ARTICLES LIMIT 1000')
f = Feature()
post_data = []
push_data = []
boo_data = []
for i in cur:
post_data.append(f.features_for_tensorflow(i[5]))
pu... | true | true |
f75311158484e590eab563484849feb9fd5b1eff | 5,587 | py | Python | sound/dacc/mg.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 4 | 2016-12-17T20:06:10.000Z | 2021-11-19T04:45:29.000Z | sound/dacc/mg.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 11 | 2021-01-06T05:35:11.000Z | 2022-03-11T23:28:31.000Z | sound/dacc/mg.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 3 | 2015-06-12T10:44:16.000Z | 2021-07-26T18:39:47.000Z | __author__ = 'thor'
import os
import pandas as pd
from pymongo import MongoClient
from pymongo.cursor import Cursor
from ut.sound import util as sutil
from ut.daf.manip import reorder_columns_as
from ut.sound.util import Sound
from ut.pstr.trans import str_to_utf8_or_bust
class MgDacc(object):
def __init__(sel... | 39.34507 | 102 | 0.574548 | __author__ = 'thor'
import os
import pandas as pd
from pymongo import MongoClient
from pymongo.cursor import Cursor
from ut.sound import util as sutil
from ut.daf.manip import reorder_columns_as
from ut.sound.util import Sound
from ut.pstr.trans import str_to_utf8_or_bust
class MgDacc(object):
def __init__(sel... | true | true |
f7531123aee47d4b76682961dba1093c5e36295e | 175 | py | Python | python/oneroll/one_each.py | exposit/katamoiran | f5ad354c102e3e24a666777a1a934fe79b73aea8 | [
"BSD-Source-Code"
] | 6 | 2017-10-09T05:07:50.000Z | 2019-07-11T05:10:15.000Z | python/oneroll/one_each.py | exposit/katamoiran | f5ad354c102e3e24a666777a1a934fe79b73aea8 | [
"BSD-Source-Code"
] | 1 | 2018-09-18T13:40:55.000Z | 2018-11-22T16:41:04.000Z | python/oneroll/one_each.py | exposit/katamoiran | f5ad354c102e3e24a666777a1a934fe79b73aea8 | [
"BSD-Source-Code"
] | 2 | 2017-11-05T19:50:28.000Z | 2019-03-10T08:35:50.000Z | import random
diceList = "4, 6, 8, 10, 12, 20, 30, 100".split(", ")
for roll in diceList:
result = "d" + roll + ": " + str(random.randint(1,int(roll)))
print result | 25 | 65 | 0.582857 | import random
diceList = "4, 6, 8, 10, 12, 20, 30, 100".split(", ")
for roll in diceList:
result = "d" + roll + ": " + str(random.randint(1,int(roll)))
print result | false | true |
f7531197ec636f8c985d6b501a7404b5d8fb650d | 62 | py | Python | tests/__init__.py | astralblue/sig2srv | 5a080542e3888decfb856cf64adbc0838e038cea | [
"MIT"
] | null | null | null | tests/__init__.py | astralblue/sig2srv | 5a080542e3888decfb856cf64adbc0838e038cea | [
"MIT"
] | 234 | 2017-07-27T03:51:03.000Z | 2021-11-15T17:47:36.000Z | tests/__init__.py | astralblue/sig2srv | 5a080542e3888decfb856cf64adbc0838e038cea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Unit test package for sig2srv."""
| 15.5 | 36 | 0.564516 | true | true | |
f7531291acd99c061b78d641d7ec85aebf889e8f | 2,910 | py | Python | napari/utils/_dtype.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 1,345 | 2019-03-03T21:14:14.000Z | 2022-03-31T19:46:39.000Z | napari/utils/_dtype.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 3,904 | 2019-03-02T01:30:24.000Z | 2022-03-31T20:17:27.000Z | napari/utils/_dtype.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 306 | 2019-03-29T17:09:10.000Z | 2022-03-30T09:54:11.000Z | from typing import Tuple, Union
import numpy as np
_np_uints = {
8: np.uint8,
16: np.uint16,
32: np.uint32,
64: np.uint64,
}
_np_ints = {
8: np.int8,
16: np.int16,
32: np.int32,
64: np.int64,
}
_np_floats = {
16: np.float16,
32: np.float32,
64: np.float64,
}
_np_complex ... | 25.752212 | 77 | 0.635052 | from typing import Tuple, Union
import numpy as np
_np_uints = {
8: np.uint8,
16: np.uint16,
32: np.uint32,
64: np.uint64,
}
_np_ints = {
8: np.int8,
16: np.int16,
32: np.int32,
64: np.int64,
}
_np_floats = {
16: np.float16,
32: np.float32,
64: np.float64,
}
_np_complex ... | true | true |
f75312b5c673a11a8d32efd533ce3c601024e27f | 1,673 | py | Python | controller/model.py | romenr/bachelorthesis | 1f4325d5f10274597efb81194b6869768cc38659 | [
"MIT"
] | 2 | 2018-12-07T11:21:24.000Z | 2021-08-31T05:41:10.000Z | controller/model.py | romenr/bachelorthesis | 1f4325d5f10274597efb81194b6869768cc38659 | [
"MIT"
] | null | null | null | controller/model.py | romenr/bachelorthesis | 1f4325d5f10274597efb81194b6869768cc38659 | [
"MIT"
] | 1 | 2021-11-07T11:56:57.000Z | 2021-11-07T11:56:57.000Z | #!/usr/bin/env python
import numpy as np
from parameters import *
from snn import TargetFollowingSNN, ObstacleAvoidanceSNN, nest_simulate
class Model:
def __init__(self):
self.snn_tf = TargetFollowingSNN()
self.snn_oa = ObstacleAvoidanceSNN()
self.turn_pre = 0.0
self.angle_pre = 0.0
self.weights_tf = []
... | 24.970149 | 74 | 0.696952 |
import numpy as np
from parameters import *
from snn import TargetFollowingSNN, ObstacleAvoidanceSNN, nest_simulate
class Model:
def __init__(self):
self.snn_tf = TargetFollowingSNN()
self.snn_oa = ObstacleAvoidanceSNN()
self.turn_pre = 0.0
self.angle_pre = 0.0
self.weights_tf = []
self.weights_oa = []... | true | true |
f7531423b00f9ddab08d8604c42f700f99dc8a6d | 1,233 | py | Python | src/pydybm/arraymath/dycupy/random.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | 1 | 2017-09-04T13:40:41.000Z | 2017-09-04T13:40:41.000Z | src/pydybm/arraymath/dycupy/random.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | null | null | null | src/pydybm/arraymath/dycupy/random.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | 1 | 2019-06-09T01:24:25.000Z | 2019-06-09T01:24:25.000Z | """``cupy``-based implementation of the random module
"""
__author__ = "Taro Sekiyama"
__copyright__ = "(C) Copyright IBM Corp. 2016"
import numpy.random as r
import cupy as cp
def _to_gpu(a):
arr = cp.empty_like(a)
arr.set(a)
return arr
class RandomState:
def __init__(self, seed):
self._... | 20.898305 | 76 | 0.660178 |
__author__ = "Taro Sekiyama"
__copyright__ = "(C) Copyright IBM Corp. 2016"
import numpy.random as r
import cupy as cp
def _to_gpu(a):
arr = cp.empty_like(a)
arr.set(a)
return arr
class RandomState:
def __init__(self, seed):
self._random = r.RandomState(seed)
def uniform(self, low=0.... | true | true |
f7531449b6b1b06cf7881739b889778761557c3d | 2,307 | py | Python | tool/picture_compression.py | mcBegins2Snow/TouhouLittleMaid | a25dcd18ee111caeb35fb26956593c88811475eb | [
"MIT"
] | null | null | null | tool/picture_compression.py | mcBegins2Snow/TouhouLittleMaid | a25dcd18ee111caeb35fb26956593c88811475eb | [
"MIT"
] | 1 | 2019-12-28T02:03:26.000Z | 2019-12-28T02:03:26.000Z | tool/picture_compression.py | mcBegins2Snow/TouhouLittleMaid | a25dcd18ee111caeb35fb26956593c88811475eb | [
"MIT"
] | 1 | 2019-12-27T20:20:15.000Z | 2019-12-27T20:20:15.000Z | import logging
import shutil
import tempfile
import tkinter as tk
from tkinter.filedialog import *
from PIL import Image
# 命令提示行的颜色代码
YELLOW = "\033[33m"
GREEN = "\033[32m"
CYAN = "\033[36m"
GRAY = "\033[37m"
RESET = "\033[0;39m"
# 临时放置处理文件的文件夹
TMP_ASSETS_DIR = tempfile.TemporaryDirectory()
# 日志初始化
logging.basicCon... | 27.464286 | 111 | 0.61205 | import logging
import shutil
import tempfile
import tkinter as tk
from tkinter.filedialog import *
from PIL import Image
YELLOW = "\033[33m"
GREEN = "\033[32m"
CYAN = "\033[36m"
GRAY = "\033[37m"
RESET = "\033[0;39m"
TMP_ASSETS_DIR = tempfile.TemporaryDirectory()
logging.basicConfig(
level=logging.INFO,
for... | true | true |
f75314bb4952672c082c83819e9de3a44c8ad901 | 2,097 | py | Python | inference_2.py | mosvlad/tumor_mask_rcnn | 16d6b20431553e6e1cf1594686a1f503171d5f8d | [
"MIT"
] | null | null | null | inference_2.py | mosvlad/tumor_mask_rcnn | 16d6b20431553e6e1cf1594686a1f503171d5f8d | [
"MIT"
] | null | null | null | inference_2.py | mosvlad/tumor_mask_rcnn | 16d6b20431553e6e1cf1594686a1f503171d5f8d | [
"MIT"
] | null | null | null | import os
import cv2
import sys
import random
import math
import re
import time
import numpy as np
import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import skimage
import glob
ROOT_DIR = os.getcwd()
sys.path.append(ROOT_DIR)
from Mask_RCNN.mrcnn import util... | 26.884615 | 95 | 0.741536 | import os
import cv2
import sys
import random
import math
import re
import time
import numpy as np
import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import skimage
import glob
ROOT_DIR = os.getcwd()
sys.path.append(ROOT_DIR)
from Mask_RCNN.mrcnn import util... | true | true |
f75316db187264acd547e92b9a375c0bf8205fd7 | 2,745 | py | Python | angalabiri/suggestion/views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 1 | 2021-03-25T14:06:23.000Z | 2021-03-25T14:06:23.000Z | angalabiri/suggestion/views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 5 | 2021-09-08T03:08:46.000Z | 2022-03-12T00:56:35.000Z | angalabiri/suggestion/views.py | me-edavids/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | null | null | null | from django.db.models import Sum, F
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.urls i... | 34.3125 | 91 | 0.738434 | from django.db.models import Sum, F
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.urls i... | true | true |
f75317a6380ef2f6bacaf23d6dc962a3d4586d97 | 1,193 | py | Python | trans_alt.py | Liying1996/ASBanalyzer | 9593818be5e1977e60317a9318a23a51d6d318f5 | [
"MIT"
] | null | null | null | trans_alt.py | Liying1996/ASBanalyzer | 9593818be5e1977e60317a9318a23a51d6d318f5 | [
"MIT"
] | null | null | null | trans_alt.py | Liying1996/ASBanalyzer | 9593818be5e1977e60317a9318a23a51d6d318f5 | [
"MIT"
] | null | null | null | ## python to get alt fasta
import argparse, os
parser = argparse.ArgumentParser()
parser.add_argument("-name", help = "output name, eg. ENCFF758RQJ", required = True)
parser.add_argument("-input_file", help = "please give an AS bed file's path", required = True)
parser.add_argument("-fa", help = "please give the path o... | 27.113636 | 95 | 0.602682 | import argparse, os
parser = argparse.ArgumentParser()
parser.add_argument("-name", help = "output name, eg. ENCFF758RQJ", required = True)
parser.add_argument("-input_file", help = "please give an AS bed file's path", required = True)
parser.add_argument("-fa", help = "please give the path of fastq file", required = T... | true | true |
f75317f91a967096a36364322d444d8e02e127f0 | 23,792 | py | Python | egs/wsj/s5/steps/nnet3/train_raw_dnn.tmp.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | egs/wsj/s5/steps/nnet3/train_raw_dnn.tmp.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | egs/wsj/s5/steps/nnet3/train_raw_dnn.tmp.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 Vijayaditya Peddinti.
# 2016 Vimal Manohar
# Apache 2.0.
""" This script is similar to steps/nnet3/train_dnn.py but trains a
raw neural network instead of an acoustic model.
"""
from __future__ import print_function
from __future__ import division
import argpars... | 45.666027 | 252 | 0.597049 |
from __future__ import print_function
from __future__ import division
import argparse
import logging
import pprint
import os
import sys
import traceback
sys.path.insert(0, 'steps')
import libs.nnet3.train.common_tmp as common_train_lib
import libs.common as common_lib
import libs.nnet3.train.frame_level_objf_tmp as... | true | true |
f753187d782e5920847b9bf586983f627bb0f9a2 | 603 | py | Python | fastapi/tutorial/16_cors/main.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | fastapi/tutorial/16_cors/main.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | fastapi/tutorial/16_cors/main.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost.tiangolo.com",
"https://localhost.tiangolo.com",
"http://localhost",
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origin... | 20.1 | 69 | 0.668325 | import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost.tiangolo.com",
"https://localhost.tiangolo.com",
"http://localhost",
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origin... | true | true |
f7531953ffe7f5ec8d2d008f647409945152b71b | 8,963 | py | Python | yolo.py | huxian123/mask_detecting | a9564d595edaff9317378fbe682cad4400760bff | [
"MIT"
] | 18 | 2020-02-07T02:21:14.000Z | 2022-03-08T14:27:04.000Z | yolo.py | huxian123/mask_detecting | a9564d595edaff9317378fbe682cad4400760bff | [
"MIT"
] | 1 | 2020-02-10T12:34:52.000Z | 2020-02-10T12:34:52.000Z | yolo.py | huxian123/mask_detecting | a9564d595edaff9317378fbe682cad4400760bff | [
"MIT"
] | 7 | 2020-02-07T02:21:16.000Z | 2020-07-19T08:54:57.000Z | # -*- coding: utf-8 -*-
"""
Class definition of YOLO_v3 style detection model on image and video
"""
import colorsys
import os
from timeit import default_timer as timer
import numpy as np
from keras import backend as K
from keras.models import load_model
from keras.layers import Input
from PIL import Image, ImageFont... | 39.139738 | 106 | 0.601696 |
import colorsys
import os
from timeit import default_timer as timer
import numpy as np
from keras import backend as K
from keras.models import load_model
from keras.layers import Input
from PIL import Image, ImageFont, ImageDraw
from yolo3.model import yolo_eval, yolo_body, tiny_yolo_body
from yolo3.utils import let... | true | true |
f7531957a145a5fa1a093eea378aaf0d59ce501d | 466 | py | Python | ports/blog/blog_schema.py | Jinxes/pipe | 3ce5b8b7b80e7b378e7773cc038d9b305848a081 | [
"BSD-2-Clause"
] | null | null | null | ports/blog/blog_schema.py | Jinxes/pipe | 3ce5b8b7b80e7b378e7773cc038d9b305848a081 | [
"BSD-2-Clause"
] | null | null | null | ports/blog/blog_schema.py | Jinxes/pipe | 3ce5b8b7b80e7b378e7773cc038d9b305848a081 | [
"BSD-2-Clause"
] | null | null | null | from marshmallow import Schema, fields, pre_load, post_dump
class UserSchema(Schema):
id = fields.Int()
title = fields.Str()
subtitle = fields.Str()
intro = fields.Str()
logo = fields.Str()
@pre_load
def make_user_data(self, data):
return data
@post_dump
def dump_user(self... | 20.26087 | 59 | 0.648069 | from marshmallow import Schema, fields, pre_load, post_dump
class UserSchema(Schema):
id = fields.Int()
title = fields.Str()
subtitle = fields.Str()
intro = fields.Str()
logo = fields.Str()
@pre_load
def make_user_data(self, data):
return data
@post_dump
def dump_user(self... | true | true |
f75319e85fcafdd645d532d13f8a52baa396bfc3 | 4,358 | py | Python | meniscus/data/model/tenant.py | ProjectMeniscus/meniscus | 1df9efe33ead702d0f53dfc227b5da385ba9cf23 | [
"Apache-2.0"
] | 12 | 2015-01-14T03:40:05.000Z | 2018-08-20T13:19:07.000Z | meniscus/data/model/tenant.py | ProjectMeniscus/meniscus | 1df9efe33ead702d0f53dfc227b5da385ba9cf23 | [
"Apache-2.0"
] | 1 | 2015-07-02T17:03:47.000Z | 2015-07-02T17:03:47.000Z | meniscus/data/model/tenant.py | ProjectMeniscus/meniscus | 1df9efe33ead702d0f53dfc227b5da385ba9cf23 | [
"Apache-2.0"
] | 4 | 2015-05-12T12:04:44.000Z | 2020-11-17T19:08:43.000Z | from uuid import uuid4
from meniscus.openstack.common.timeutils import isotime
from meniscus.sinks import DEFAULT_SINK
class EventProducer(object):
"""
An event producer is a nicer way of describing a parsing template
for a producer of events. Event producer definitions should be
reusable and not spec... | 27.408805 | 75 | 0.602111 | from uuid import uuid4
from meniscus.openstack.common.timeutils import isotime
from meniscus.sinks import DEFAULT_SINK
class EventProducer(object):
def __init__(self, _id, name, pattern, durable=False,
encrypted=False, sinks=None):
if not sinks:
self.sinks = [DEFAULT_SINK]
... | true | true |
f7531a0915c8465b0480fced097c2978ce606fce | 1,249 | py | Python | tests/test_transforms.py | ParhamYZ/MusicSourceSeparation | 26a42fbebdf50d2ae2ef674ef64f4c88cbe7e8e3 | [
"MIT"
] | null | null | null | tests/test_transforms.py | ParhamYZ/MusicSourceSeparation | 26a42fbebdf50d2ae2ef674ef64f4c88cbe7e8e3 | [
"MIT"
] | null | null | null | tests/test_transforms.py | ParhamYZ/MusicSourceSeparation | 26a42fbebdf50d2ae2ef674ef64f4c88cbe7e8e3 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
import torch
from openunmix import transforms
@pytest.fixture(params=[4096, 44100])
def nb_timesteps(request):
return int(request.param)
@pytest.fixture(params=[1, 2])
def nb_channels(request):
return request.param
@pytest.fixture(params=[1, 2])
def nb_sam... | 24.019231 | 97 | 0.67494 | import pytest
import numpy as np
import torch
from openunmix import transforms
@pytest.fixture(params=[4096, 44100])
def nb_timesteps(request):
return int(request.param)
@pytest.fixture(params=[1, 2])
def nb_channels(request):
return request.param
@pytest.fixture(params=[1, 2])
def nb_sam... | true | true |
f7531b47e938a142ce12345cb00b5b8535eafcef | 11,745 | py | Python | SCons/Variables/__init__.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | 2 | 2019-11-21T14:40:00.000Z | 2020-10-25T15:44:53.000Z | SCons/Variables/__init__.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | SCons/Variables/__init__.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | 2 | 2019-12-23T05:06:28.000Z | 2020-01-16T12:57:55.000Z | """SCons.Variables
This file defines the Variables class that is used to add user-friendly
customizable variables to an SCons build.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal ... | 35.483384 | 118 | 0.567476 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import sys
from functools import cmp_to_key
import SCons.Environment
import SCons.Errors
import SCons.Util
import SCons.Warnings
from .BoolVariable import BoolVariable from .EnumVariable import EnumVariable from .ListVariable import Lis... | true | true |
f7531b90ae9818f7cd272e2dfcd0dfb482339beb | 747 | py | Python | bin/split.py | szks/gfk_aics | 2cfa4c26e8e9a4318eaf10dc2b93e6cb1e8254ca | [
"MIT"
] | null | null | null | bin/split.py | szks/gfk_aics | 2cfa4c26e8e9a4318eaf10dc2b93e6cb1e8254ca | [
"MIT"
] | null | null | null | bin/split.py | szks/gfk_aics | 2cfa4c26e8e9a4318eaf10dc2b93e6cb1e8254ca | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
def usage():
print 'usage: %s in_file out_file_prefix' % sys.argv[0]
chrs = [
"chr1",
"chr2",
"chr3",
"chr4",
"chr5",
"chr6",
"chr7",
"chr8",
"chr9",
"chr10",
"chr11",
"chr12",
"chr13",
"chr14",
"chr15",
"chr16",
"chr17",
"chr18",
"chr19",
"chr20",
"chr21",
"chr22",
"chrX",
"chr... | 13.339286 | 63 | 0.523427 |
import sys
def usage():
print 'usage: %s in_file out_file_prefix' % sys.argv[0]
chrs = [
"chr1",
"chr2",
"chr3",
"chr4",
"chr5",
"chr6",
"chr7",
"chr8",
"chr9",
"chr10",
"chr11",
"chr12",
"chr13",
"chr14",
"chr15",
"chr16",
"chr17",
"chr18",
"chr19",
"chr20",
"chr21",
"chr22",
"chrX",
"chrY",
"chrM",
"*",
]
i... | false | true |
f7531ce9dfd8089e394ca7d54c810a144920a90c | 14 | py | Python | rebound/__init__.py | kste/aeshash | 985ee3a8a3e9853580ac1ab745b446c82c97a095 | [
"MIT"
] | 5 | 2015-10-09T22:23:50.000Z | 2021-02-21T22:10:38.000Z | rebound/__init__.py | kste/aeshash | 985ee3a8a3e9853580ac1ab745b446c82c97a095 | [
"MIT"
] | null | null | null | rebound/__init__.py | kste/aeshash | 985ee3a8a3e9853580ac1ab745b446c82c97a095 | [
"MIT"
] | null | null | null | import rebound | 14 | 14 | 0.928571 | import rebound | true | true |
f7531d0382434928f4102e4fd51afaf4e6dd11ed | 3,482 | py | Python | app/app/settings.py | tuvshinot/recipe-django-rest-app-api | 3782e471a7372d2d3430e6b9dbd070df21278be8 | [
"MIT"
] | null | null | null | app/app/settings.py | tuvshinot/recipe-django-rest-app-api | 3782e471a7372d2d3430e6b9dbd070df21278be8 | [
"MIT"
] | null | null | null | app/app/settings.py | tuvshinot/recipe-django-rest-app-api | 3782e471a7372d2d3430e6b9dbd070df21278be8 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bui... | 25.416058 | 91 | 0.686674 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '$&8@$(&u0@d_3#$khih_q-5l)3cki0!ysjzsc!ngiv4c+$x+=b'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f7531d4ec7bef209b74d461d1d1ac99f49d81929 | 2,879 | py | Python | pymc3_ext/tests/test_missing.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/tests/test_missing.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/tests/test_missing.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | import pytest
from numpy import ma, array
import numpy
import pandas as pd
from pymc3_ext import Model, Normal, sample_prior_predictive, sample, ImputationWarning
def test_missing():
data = ma.masked_values([1, 2, -1, 4, -1], value=-1)
with Model() as model:
x = Normal('x', 1, 1)
with pytest.wa... | 33.476744 | 87 | 0.612713 | import pytest
from numpy import ma, array
import numpy
import pandas as pd
from pymc3_ext import Model, Normal, sample_prior_predictive, sample, ImputationWarning
def test_missing():
data = ma.masked_values([1, 2, -1, 4, -1], value=-1)
with Model() as model:
x = Normal('x', 1, 1)
with pytest.wa... | true | true |
f7531dd4add092f27de67e5426e4eda50f3a0db4 | 1,411 | py | Python | posts/models.py | Vilbert55/yatube | 4ec1fc111a88c0b4c6d1f679602c1f720b19959f | [
"BSD-3-Clause"
] | null | null | null | posts/models.py | Vilbert55/yatube | 4ec1fc111a88c0b4c6d1f679602c1f720b19959f | [
"BSD-3-Clause"
] | 9 | 2021-03-19T12:33:23.000Z | 2022-03-12T00:48:25.000Z | posts/models.py | Vilbert55/yatube | 4ec1fc111a88c0b4c6d1f679602c1f720b19959f | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(verbose_name='URL', max_length=50, unique=True, blank=True, null=True)
description = models.TextField(max_length=... | 38.135135 | 122 | 0.746279 | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(verbose_name='URL', max_length=50, unique=True, blank=True, null=True)
description = models.TextField(max_length=... | true | true |
f7531fef06b8f3e4b33f42610c055450eab311a7 | 6,327 | py | Python | pron_dict_quality_assurance/align_xsampa.py | cadia-lvl/lvl_tts_frontend | 5100cba30d77424899679044c90a0de9f9c1777a | [
"Apache-2.0"
] | null | null | null | pron_dict_quality_assurance/align_xsampa.py | cadia-lvl/lvl_tts_frontend | 5100cba30d77424899679044c90a0de9f9c1777a | [
"Apache-2.0"
] | 1 | 2021-06-01T11:56:52.000Z | 2021-06-01T11:56:52.000Z | pron_dict_quality_assurance/align_xsampa.py | cadia-lvl/lvl_tts_frontend | 5100cba30d77424899679044c90a0de9f9c1777a | [
"Apache-2.0"
] | 2 | 2019-11-11T10:15:36.000Z | 2019-12-05T10:43:59.000Z | #!/usr/bin/env python3
#
# Copyright 2015 Robert Kjaran
#
#
from collections import OrderedDict
from pprint import pprint
# Eiríkur Rögnvaldsson. Icelandic Phonetic Transcription.
ER_PHONEMES_SAMPA = {
# Consonants Plosives
'p',
'p_h',
't',
't_h',
'c',
'c_h',
'k',
'k_h',
# Cons... | 28.759091 | 93 | 0.529319 |
from collections import OrderedDict
from pprint import pprint
ER_PHONEMES_SAMPA = {
'p',
'p_h',
't',
't_h',
'c',
'c_h',
'k',
'k_h',
'f',
'v',
'D',
'T',
's',
'j',
'C',
'G',
'x',
'h',
'm',
'n',
'J',
'N',
'm_0',
'... | true | true |
f75321017375931478c261004740f35672b8e534 | 8,829 | py | Python | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Guido Lemoine
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
# Version :
import time
import sys
import os
import io
import json... | 29.528428 | 99 | 0.61751 |
import time
import sys
import os
import io
import json
import psycopg2
import psycopg2.extras
import rasterio
import pandas as pd
from rasterstats import zonal_stats
from datetime import datetime
import download_with_boto3 as dwb
start = time.time()
with open('s3_config.json', 'r') as f:
s3config = json.load(... | true | true |
f7532102d03901b35f7279dad903b19eb137926a | 466 | py | Python | examples/basic.py | chachan/pynotify2 | 43cd1e75f4339deb6014504a36825649a6e67865 | [
"BSD-2-Clause"
] | 1 | 2021-12-15T02:47:23.000Z | 2021-12-15T02:47:23.000Z | examples/basic.py | chachan/pynotify2 | 43cd1e75f4339deb6014504a36825649a6e67865 | [
"BSD-2-Clause"
] | null | null | null | examples/basic.py | chachan/pynotify2 | 43cd1e75f4339deb6014504a36825649a6e67865 | [
"BSD-2-Clause"
] | 1 | 2021-12-15T02:47:24.000Z | 2021-12-15T02:47:24.000Z | #!/usr/bin/env python
"""This illustrates the basic functionality of notify2 - creating and displaying
a notification message.
"""
import notify2
# This must be called before using notify2
notify2.init("Demo application")
# A number of stock
n = notify2.Notification("Summary", "Body text goes here",
"no... | 29.125 | 80 | 0.665236 |
import notify2
notify2.init("Demo application")
n = notify2.Notification("Summary", "Body text goes here",
"notification-message-im") n.show()
| true | true |
f75321b0f09d9a1751b5b3b0d6d50b7b6493d932 | 708 | py | Python | 4_ifelse_2.py | polatbilek/python-101 | 8957ec8561cb3763be33fb2ef3f486375df58ea4 | [
"MIT"
] | null | null | null | 4_ifelse_2.py | polatbilek/python-101 | 8957ec8561cb3763be33fb2ef3f486375df58ea4 | [
"MIT"
] | null | null | null | 4_ifelse_2.py | polatbilek/python-101 | 8957ec8561cb3763be33fb2ef3f486375df58ea4 | [
"MIT"
] | null | null | null | list1 = [1, 10, 3, 4, 6]
if 3 in list1:
print("3 is in list.")
if 11 not in list1:
print("list doesn't contain 11")
variable1 = 4
if list1[3] == variable1:
print("element in index 3 is equal to variable1")
my_string = "this is an example string"
print(my_string[0])
print(my_string[1])
print(... | 19.135135 | 87 | 0.638418 | list1 = [1, 10, 3, 4, 6]
if 3 in list1:
print("3 is in list.")
if 11 not in list1:
print("list doesn't contain 11")
variable1 = 4
if list1[3] == variable1:
print("element in index 3 is equal to variable1")
my_string = "this is an example string"
print(my_string[0])
print(my_string[1])
print(... | true | true |
f753231caabe55c8c5f931774ef9e41d022202d0 | 249,749 | py | Python | Python2.7-CDN_Edgepack/tencentcloud/dayu/v20180709/models.py | tencentyun/scf-demo-repo | c75f9b9e8be8d079f0510b14fb0c7098d0b6bb7e | [
"Python-2.0",
"OLDAP-2.7"
] | 46 | 2019-03-01T02:19:18.000Z | 2021-12-18T12:37:02.000Z | Python3.6-CDN_PushUrlsCache/tencentcloud/dayu/v20180709/models.py | Juliiii/scf-demo-repo | 766928f14c64fbccab0713d6c6af0de3e716c9b0 | [
"Python-2.0",
"OLDAP-2.7"
] | 8 | 2019-01-22T10:46:43.000Z | 2020-12-30T13:03:04.000Z | Python2.7-CDN_Refresh/tencentcloud/dayu/v20180709/models.py | tencentyun/scf-demo-repo | c75f9b9e8be8d079f0510b14fb0c7098d0b6bb7e | [
"Python-2.0",
"OLDAP-2.7"
] | 67 | 2018-10-29T09:50:49.000Z | 2022-01-06T07:35:56.000Z | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | 29.210409 | 186 | 0.601752 |
from tencentcloud.common.abstract_model import AbstractModel
class BaradData(AbstractModel):
def __init__(self):
self.MetricName = None
self.Data = None
self.Count = None
def _deserialize(self, params):
self.MetricName = params.get("MetricName")
self.Data = params.g... | true | true |
f753235d42eb26c88d363fa1ccf74fbd3ae519b9 | 501 | py | Python | nlp_annotator_api/server/signals/process_pool.py | dasaku-ai/nlpmodel-v-h | 326bb9467df11d517285610c70f9d22627eb5efc | [
"Apache-2.0"
] | 3 | 2022-01-04T12:15:22.000Z | 2022-03-25T21:19:20.000Z | nlp_annotator_api/server/signals/process_pool.py | IBM/deepsearch-nlp-annotator-api-example | 76c2c8fd83c1e6d51c51c7b581a8c3f273b23c40 | [
"Apache-2.0"
] | 1 | 2022-02-02T09:26:44.000Z | 2022-02-02T09:26:44.000Z | nlp_annotator_api/server/signals/process_pool.py | dasaku-ai/nlpmodel-v-h | 326bb9467df11d517285610c70f9d22627eb5efc | [
"Apache-2.0"
] | 5 | 2021-09-27T08:26:09.000Z | 2022-03-10T11:41:35.000Z | import logging
from concurrent.futures.process import ProcessPoolExecutor
logger = logging.getLogger(__name__)
def process_pool_factory(num_workers: int):
async def process_pool(app_instance):
logger.debug("Setting up process pool with %r workers", num_workers)
pool = ProcessPoolExecutor(max_wo... | 21.782609 | 76 | 0.720559 | import logging
from concurrent.futures.process import ProcessPoolExecutor
logger = logging.getLogger(__name__)
def process_pool_factory(num_workers: int):
async def process_pool(app_instance):
logger.debug("Setting up process pool with %r workers", num_workers)
pool = ProcessPoolExecutor(max_wo... | true | true |
f753242d5bd13d286d7fbb0d872cc359e81f727e | 797 | py | Python | tensorflow_model_remediation/min_diff/keras/__init__.py | sarvex/model-remediation | c0592dccfa4706577fe94786cf3d59d4b80cd825 | [
"Apache-2.0"
] | 27 | 2020-10-23T18:00:06.000Z | 2022-03-28T02:50:47.000Z | tensorflow_model_remediation/min_diff/keras/__init__.py | sarvex/model-remediation | c0592dccfa4706577fe94786cf3d59d4b80cd825 | [
"Apache-2.0"
] | 12 | 2020-11-13T20:51:30.000Z | 2022-03-30T22:58:18.000Z | tensorflow_model_remediation/min_diff/keras/__init__.py | sarvex/model-remediation | c0592dccfa4706577fe94786cf3d59d4b80cd825 | [
"Apache-2.0"
] | 14 | 2020-11-16T12:13:35.000Z | 2022-03-27T09:14:28.000Z | # coding=utf-8
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 36.227273 | 74 | 0.780427 |
from tensorflow_model_remediation.min_diff.keras import models
from tensorflow_model_remediation.min_diff.keras import utils
MinDiffModel = models.MinDiffModel
| true | true |
f753245c6149b5b259cd11b8a8f9fa6891a02d8c | 6,261 | py | Python | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | null | null | null | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2017-07-31T08:15:26.000Z | 2017-07-31T08:15:26.000Z | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2019-10-06T16:52:31.000Z | 2019-10-06T16:52:31.000Z | """This module implements the built-in data types of the Scheme language, along
with a parser for Scheme expressions.
In addition to the types defined in this file, some data types in Scheme are
represented by their corresponding type in Python:
number: int or float
symbol: string
boolean: ... | 29.257009 | 79 | 0.576585 |
from ucb import main, trace, interact
from scheme_tokens import tokenize_lines, DELIMITERS
from buffer import Buffer, InputReader, LineReader
class Pair:
def __init__(self, first, second):
self.first = first
self.second = second
def __iter__(self):
self.cur = self
return self... | true | true |
f753248881389b5f9291cb4d292ef226acceeea2 | 1,244 | py | Python | src/os_tornado/commands/runserver.py | cfhamlet/os-tornado | a1ac204889d561d2db9d646ee49214c39fa546c1 | [
"MIT"
] | 5 | 2018-03-01T12:28:50.000Z | 2020-12-08T19:19:56.000Z | src/os_tornado/commands/runserver.py | cfhamlet/os-tornado | a1ac204889d561d2db9d646ee49214c39fa546c1 | [
"MIT"
] | 3 | 2017-12-20T05:41:42.000Z | 2018-03-13T05:42:28.000Z | src/os_tornado/commands/runserver.py | cfhamlet/os-tornado | a1ac204889d561d2db9d646ee49214c39fa546c1 | [
"MIT"
] | null | null | null | """The runserver command"""
from __future__ import print_function
from os_tornado.commands import Command
from os_tornado.component_manager import ComponentManager
from os_tornado.exceptions import UsageError
from os_tornado.runner import Runner
class RunserverCommand(Command):
"""Command for starting server"""
... | 33.621622 | 93 | 0.659968 | from __future__ import print_function
from os_tornado.commands import Command
from os_tornado.component_manager import ComponentManager
from os_tornado.exceptions import UsageError
from os_tornado.runner import Runner
class RunserverCommand(Command):
def short_desc(self):
return "run server."
def a... | true | true |
f7532610b54959b4e8cbbbc39867ac6245084ad6 | 2,874 | py | Python | dizzy/objects/regex.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T10:11:43.000Z | 2020-11-19T10:11:43.000Z | dizzy/objects/regex.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | null | null | null | dizzy/objects/regex.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T10:12:18.000Z | 2020-11-19T10:12:18.000Z | # regex.py
#
# Copyright 2017 Daniel Mende <mail@c0decafe.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
#... | 42.264706 | 80 | 0.652749 |
from dizzy.value import Value
from dizzy.config import CONFIG
from dizzy import DizzyParseException
if CONFIG["DEPS"]["exrex"]:
from exrex import generate, count
class Regex:
def __init__(self, name, regex, limit=20):
if isinstance(name, str) and name:
self.name = name
... | true | true |
f753272cfe4f364b62862db19bd91d0bb77e66b2 | 1,728 | py | Python | setup.py | Liatwilight/txtai | abf9104a1a47969147152c3100ef2bc7ed2265ed | [
"Apache-2.0"
] | null | null | null | setup.py | Liatwilight/txtai | abf9104a1a47969147152c3100ef2bc7ed2265ed | [
"Apache-2.0"
] | null | null | null | setup.py | Liatwilight/txtai | abf9104a1a47969147152c3100ef2bc7ed2265ed | [
"Apache-2.0"
] | null | null | null | # pylint: disable = C0111
from setuptools import find_packages, setup
with open("README.md", "r") as f:
DESCRIPTION = f.read()
setup(name="txtai",
version="1.4.0",
author="NeuML",
description="AI-powered search engine",
long_description=DESCRIPTION,
long_description_content_type="tex... | 34.56 | 71 | 0.555556 | from setuptools import find_packages, setup
with open("README.md", "r") as f:
DESCRIPTION = f.read()
setup(name="txtai",
version="1.4.0",
author="NeuML",
description="AI-powered search engine",
long_description=DESCRIPTION,
long_description_content_type="text/markdown",
url="ht... | true | true |
f7532781ca18bfaa28bc8f549f7df37dbba45c3c | 15,639 | py | Python | coronet/main2_worker_gradient_quantization.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | coronet/main2_worker_gradient_quantization.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | coronet/main2_worker_gradient_quantization.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | import time
from numpy.random import seed
seed(8) #1
import tensorflow
tensorflow.random.set_seed(7)
# tensorflow.random.set_random_seed(7)
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
from tensorflow.keras import backend as K
from tensorflow.... | 31.466801 | 116 | 0.617942 | import time
from numpy.random import seed
seed(8)
import tensorflow
tensorflow.random.set_seed(7)
import numpy as np import pandas as pd
import os
from tensorflow.keras import backend as K
from tensorflow.keras.models import Model ,load_model
from tensorflow.keras.layers import Flatten, Dense, Dropout
from tensorf... | true | true |
f7532838cb01421566643ccdecefe5e78ef886df | 423 | py | Python | examples/task.py | hamakou108/luigi-batch-flow | e52d6ecf503d8a91903c10c36edc86483afc6d68 | [
"MIT"
] | null | null | null | examples/task.py | hamakou108/luigi-batch-flow | e52d6ecf503d8a91903c10c36edc86483afc6d68 | [
"MIT"
] | 4 | 2018-09-16T05:42:55.000Z | 2018-12-06T13:10:18.000Z | examples/task.py | hamakou108/luigi-batch-flow | e52d6ecf503d8a91903c10c36edc86483afc6d68 | [
"MIT"
] | null | null | null | from luigi.mock import MockTarget
from examples import batch as b
from luigi_batch_flow.task import Task
class FirstTask(Task):
"""
FirstTask is an example.
"""
batch = b.FirstBatch()
target = MockTarget("first_task.txt")
class SecondTask(Task):
"""
SecondTask is an example.
"""
... | 16.92 | 42 | 0.664303 | from luigi.mock import MockTarget
from examples import batch as b
from luigi_batch_flow.task import Task
class FirstTask(Task):
batch = b.FirstBatch()
target = MockTarget("first_task.txt")
class SecondTask(Task):
required_task = FirstTask()
batch = b.SecondBatch()
target = MockTarget("second_... | true | true |
f7532914447f413eed5274c4e54cca2f9bb6b81c | 2,535 | py | Python | seeker/apps.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 24 | 2015-01-05T21:03:56.000Z | 2021-12-30T03:35:26.000Z | seeker/apps.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 30 | 2016-03-11T21:29:38.000Z | 2022-03-29T21:09:05.000Z | seeker/apps.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 30 | 2015-01-08T19:49:04.000Z | 2021-12-22T21:41:55.000Z | from django.apps import AppConfig, apps
from django.conf import settings
from .mapping import Indexable
from .registry import register
from .utils import import_class
import importlib
import inspect
import logging
logger = logging.getLogger(__name__)
class SeekerConfig (AppConfig):
name = 'seeker'
def re... | 42.25 | 142 | 0.599211 | from django.apps import AppConfig, apps
from django.conf import settings
from .mapping import Indexable
from .registry import register
from .utils import import_class
import importlib
import inspect
import logging
logger = logging.getLogger(__name__)
class SeekerConfig (AppConfig):
name = 'seeker'
def re... | true | true |
f75329eb245b8a73b5cf9d4b829c11ae70c07605 | 414 | py | Python | embedders/FAb-Net/Datasets/generate_large_voxceleb.py | mumumu99/latent-pose-reenactment | bfe8175f9cf3d67d46c21194bb5b6f898ef3ea53 | [
"Apache-2.0"
] | 79 | 2018-08-29T08:58:34.000Z | 2021-12-12T23:12:36.000Z | embedders/FAb-Net/Datasets/generate_large_voxceleb.py | mumumu99/latent-pose-reenactment | bfe8175f9cf3d67d46c21194bb5b6f898ef3ea53 | [
"Apache-2.0"
] | 5 | 2018-09-06T08:31:19.000Z | 2020-09-28T09:52:02.000Z | embedders/FAb-Net/Datasets/generate_large_voxceleb.py | mumumu99/latent-pose-reenactment | bfe8175f9cf3d67d46c21194bb5b6f898ef3ea53 | [
"Apache-2.0"
] | 14 | 2018-09-30T09:07:50.000Z | 2021-08-05T08:16:44.000Z |
import os
ids = [d for d in os.listdir(VOX_CELEB_LOCATION) if d[0:2] == 'id']
train = ids[0:int(0.7*len(ids))]
val = ids[int(0.7*len(ids)):int(0.8*len(ids))]
test = ids[int(0.8*len(ids)):]
import numpy as np
np.save('./large_voxceleb/train.npy', np.array(train))
np.save('./large_voxceleb/test.npy', np.array(test))... | 23 | 67 | 0.666667 |
import os
ids = [d for d in os.listdir(VOX_CELEB_LOCATION) if d[0:2] == 'id']
train = ids[0:int(0.7*len(ids))]
val = ids[int(0.7*len(ids)):int(0.8*len(ids))]
test = ids[int(0.8*len(ids)):]
import numpy as np
np.save('./large_voxceleb/train.npy', np.array(train))
np.save('./large_voxceleb/test.npy', np.array(test))... | true | true |
f7532a629fbd5e65a163a91a7a2bf4c4519a23be | 983 | py | Python | django2/bookmarks/account/forms.py | Gozeon/code-collections | 7304e2b9c4c91a809125198d22cf40dcbb45a23b | [
"MIT"
] | 2 | 2020-10-28T11:36:28.000Z | 2020-11-06T12:36:24.000Z | django2/bookmarks/account/forms.py | Gozeon/code-collections | 7304e2b9c4c91a809125198d22cf40dcbb45a23b | [
"MIT"
] | 136 | 2020-09-28T16:36:28.000Z | 2022-03-28T19:34:14.000Z | account/forms.py | vitorpvcampos/social-net-django | fbda648f6c2c7f317436fa5f70f845deda0af875 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from .models import Profile
class LoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput)
class UserRegistrationForm(forms.ModelForm):
password = forms.CharField(label='Password', widg... | 27.305556 | 84 | 0.675483 | from django import forms
from django.contrib.auth.models import User
from .models import Profile
class LoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput)
class UserRegistrationForm(forms.ModelForm):
password = forms.CharField(label='Password', widg... | true | true |
f7532aa4aa3ade9a6ba2aa21ce694ce0cbe330ea | 4,540 | py | Python | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 385 | 2015-11-20T02:21:18.000Z | 2022-03-24T09:38:24.000Z | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 127 | 2016-07-08T20:23:20.000Z | 2022-02-23T13:52:19.000Z | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 68 | 2015-11-20T12:51:44.000Z | 2022-01-25T04:35:54.000Z | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | 37.213115 | 112 | 0.529075 |
import os
import sys
import logging
import requests
import subprocess
from tempfile import NamedTemporaryFile
from .exceptions import StoqException, StoqPluginException
log = logging.getLogger()
class StoqPluginInstaller:
DEFAULT_REPO = 'git+https://github.com/PUNCH-Cyber/stoq-plugins-public.git@v3'
@st... | true | true |
f7532b4f7ffc5780a15c35dbf7c2675512c6f684 | 2,272 | py | Python | setup.py | laughedelic/sparql-kernel | a7fa090ec75cde4e432d4145d1c63249bdef8b70 | [
"BSD-3-Clause"
] | null | null | null | setup.py | laughedelic/sparql-kernel | a7fa090ec75cde4e432d4145d1c63249bdef8b70 | [
"BSD-3-Clause"
] | null | null | null | setup.py | laughedelic/sparql-kernel | a7fa090ec75cde4e432d4145d1c63249bdef8b70 | [
"BSD-3-Clause"
] | null | null | null | """
Install the package containing the SPARQL kernel for Jupyter.
To actually use the kernel it needs to be installed into Jupyter afterwards.
"""
from __future__ import print_function
import os
import os.path
import sys
from setuptools import setup
from sparqlkernel.constants import __version__, LANGUAGE, DISPLAY_N... | 31.123288 | 78 | 0.611356 |
from __future__ import print_function
import os
import os.path
import sys
from setuptools import setup
from sparqlkernel.constants import __version__, LANGUAGE, DISPLAY_NAME
PKGNAME = 'sparqlkernel'
GITHUB_URL = 'https://github.com/paulovn/sparql-kernel'
setup_args = dict (
name=PKGNAME,
version=__version... | true | true |
f7532bc1477ba440f90704335a746ad779329719 | 4,452 | py | Python | IMDB-Clone-DRF-Cleaned-main/IMDB-Clone-DRF-Cleaned-main/watchlist_app/api/views.py | PacktPublishing/Build-REST-APIs-with-Django-REST-Framework-and-Python | 7cd16918b964746377baac31e138193ef0a17dc8 | [
"MIT"
] | 6 | 2021-08-04T06:10:03.000Z | 2022-03-18T03:00:39.000Z | IMDB-Clone-DRF-Cleaned-main/IMDB-Clone-DRF-Cleaned-main/watchlist_app/api/views.py | rizwandel/Build-REST-APIs-with-Django-REST-Framework-and-Python | 7cd16918b964746377baac31e138193ef0a17dc8 | [
"MIT"
] | 1 | 2022-02-22T03:30:50.000Z | 2022-03-09T14:33:00.000Z | IMDB-Clone-DRF-Cleaned-main/IMDB-Clone-DRF-Cleaned-main/watchlist_app/api/views.py | rizwandel/Build-REST-APIs-with-Django-REST-Framework-and-Python | 7cd16918b964746377baac31e138193ef0a17dc8 | [
"MIT"
] | 3 | 2021-06-14T15:23:19.000Z | 2021-12-20T18:50:21.000Z | from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, generics, status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
from rest_f... | 36.195122 | 92 | 0.729784 | from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, generics, status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
from rest_f... | true | true |
f7532bdcc2bb714ad21fdc4ba7ce48e33a7bbfa1 | 12,114 | py | Python | sdk/cosmos/azure-cosmos/samples/nonpartitioned_collection_operations.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | sdk/cosmos/azure-cosmos/samples/nonpartitioned_collection_operations.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | sdk/cosmos/azure-cosmos/samples/nonpartitioned_collection_operations.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | #The MIT License (MIT)
#Copyright (c) 2018 Microsoft 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, modi... | 39.588235 | 127 | 0.616229 |
import azure.cosmos.cosmos_client as cosmos_client
import azure.cosmos.errors as errors
import requests
import six
import json
import uuid
from six.moves.urllib.parse import quote as urllib_quote
import azure.cosmos.auth as auth
import azure.cosmos.partition_key as partition_key
import datetime
import config
HOS... | true | true |
f7533038c3104e4c8a0cc2959d17f62b3298ed7e | 1,319 | py | Python | test/testSequence.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T19:22:17.000Z | 2021-05-26T19:22:17.000Z | test/testSequence.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | null | null | null | test/testSequence.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import nzmath.sequence as sequence
class SequenceTest(unittest.TestCase):
def testGeneratorFibonacci(self):
gf = sequence.generator_fibonacci(40)
fibo_40 = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610,
987, 1597, 2584, 4181, 6765, 10946, 17711, 28657,... | 38.794118 | 81 | 0.648218 | import unittest
import nzmath.sequence as sequence
class SequenceTest(unittest.TestCase):
def testGeneratorFibonacci(self):
gf = sequence.generator_fibonacci(40)
fibo_40 = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610,
987, 1597, 2584, 4181, 6765, 10946, 17711, 28657,... | true | true |
f753311a80b359f1830cdf5f04a2340a842c2b95 | 3,562 | py | Python | my_configs/cattle/resnet_50_15/tail_black.py | EricChan-OC/mmpose | b7f36b29eb077b69791675cce39dfcc23c658647 | [
"Apache-2.0"
] | null | null | null | my_configs/cattle/resnet_50_15/tail_black.py | EricChan-OC/mmpose | b7f36b29eb077b69791675cce39dfcc23c658647 | [
"Apache-2.0"
] | null | null | null | my_configs/cattle/resnet_50_15/tail_black.py | EricChan-OC/mmpose | b7f36b29eb077b69791675cce39dfcc23c658647 | [
"Apache-2.0"
] | null | null | null | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=210)
evaluation = dict(interval=5, metric='PCK', key_indicator='PCK')
COLOR = 'black'
EXTEND = '15'
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = ... | 27.19084 | 79 | 0.625772 | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=210)
evaluation = dict(interval=5, metric='PCK', key_indicator='PCK')
COLOR = 'black'
EXTEND = '15'
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = ... | true | true |
f7533149f22bcfa2d1a1d2f65002e839d9449ae9 | 2,840 | py | Python | spectro_data/apply_lamost_cannon.py | ktfm2/Kai_updates | f731922d3e140c1f16ea9b4b45f39232fe19a1ba | [
"MIT"
] | 1 | 2020-03-30T02:33:45.000Z | 2020-03-30T02:33:45.000Z | spectro_data/apply_lamost_cannon.py | ktfm2/Kai_updates | f731922d3e140c1f16ea9b4b45f39232fe19a1ba | [
"MIT"
] | null | null | null | spectro_data/apply_lamost_cannon.py | ktfm2/Kai_updates | f731922d3e140c1f16ea9b4b45f39232fe19a1ba | [
"MIT"
] | 2 | 2018-09-26T05:15:33.000Z | 2020-09-27T21:10:11.000Z | from lamost_cannon import *
import sys
sys.path.append('/data/jls/cyanide/comparisons/')
sys.path.append('../')
from neural_network import *
from spectro_data.lamost import *
l = load_and_match(use_dr1=True)
model = tc.CannonModel.read(
'/data/jls/GaiaDR2/spectro/lamost_cannon/lamost.cannon')
data = full_sample()[... | 31.208791 | 94 | 0.652817 | from lamost_cannon import *
import sys
sys.path.append('/data/jls/cyanide/comparisons/')
sys.path.append('../')
from neural_network import *
from spectro_data.lamost import *
l = load_and_match(use_dr1=True)
model = tc.CannonModel.read(
'/data/jls/GaiaDR2/spectro/lamost_cannon/lamost.cannon')
data = full_sample()[... | false | true |
f75331ff0af91d6b888f2bd5c304dfee46c9e14f | 260 | py | Python | osccontroller/command_line_interface.py | gogo2/osc-controller | dadc2345dfb1858468c044048e73b11ce1552dbc | [
"MIT"
] | 1 | 2020-07-19T05:57:12.000Z | 2020-07-19T05:57:12.000Z | osccontroller/command_line_interface.py | gogo2/osc-controller | dadc2345dfb1858468c044048e73b11ce1552dbc | [
"MIT"
] | null | null | null | osccontroller/command_line_interface.py | gogo2/osc-controller | dadc2345dfb1858468c044048e73b11ce1552dbc | [
"MIT"
] | null | null | null | class CommandLineInterface:
def __init__(self):
self.commands = dict()
def loop(self):
while True:
command = ""
if command in self.commands.keys():
pass
def add_command(self):
pass
| 18.571429 | 47 | 0.523077 | class CommandLineInterface:
def __init__(self):
self.commands = dict()
def loop(self):
while True:
command = ""
if command in self.commands.keys():
pass
def add_command(self):
pass
| true | true |
f7533271afbd908856dbbd9683b79b93b9592075 | 5,872 | py | Python | python/oneflow/nn/optimizer/sequential_lr.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/sequential_lr.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/sequential_lr.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 law or agr... | 40.777778 | 107 | 0.635899 | import bisect
from typing import Sequence, Union
from .optimizer import Optimizer
from .lr_scheduler import LRScheduler, _scheduler_with_step
class SequentialLR(LRScheduler):
def __init__(
self,
optimizer: Optimizer,
schedulers: Sequence[LRScheduler],
milestones: Sequence[int],
... | true | true |
f753328b391f3451ec8d9516da6690a7fefbc52b | 6,889 | py | Python | tests/test_library.py | Tomme/python-plexapi | 49d631442633be9b6f1a17575ceefec4b8b5d6e8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_library.py | Tomme/python-plexapi | 49d631442633be9b6f1a17575ceefec4b8b5d6e8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_library.py | Tomme/python-plexapi | 49d631442633be9b6f1a17575ceefec4b8b5d6e8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from plexapi.exceptions import NotFound
from . import conftest as utils
def test_library_Library_section(plex):
sections = plex.library.sections()
assert len(sections) >= 3
section_name = plex.library.section('TV Shows')
assert section_name.title == 'TV Shows'
... | 31.031532 | 110 | 0.748004 | import pytest
from plexapi.exceptions import NotFound
from . import conftest as utils
def test_library_Library_section(plex):
sections = plex.library.sections()
assert len(sections) >= 3
section_name = plex.library.section('TV Shows')
assert section_name.title == 'TV Shows'
with pytest.raises(NotF... | true | true |
f75333404b4fcaad012756624f8a4c982231a8cf | 2,077 | py | Python | train model/src/inference/UNetInferenceAgent.py | aaryapatel007/Hippocampal-Volume-Quantification-in-Alzheimer-Progression | 5c9eff98572c1d2647a742d285805d9e328ab14f | [
"MIT"
] | 7 | 2020-09-22T18:22:23.000Z | 2021-09-25T12:20:10.000Z | train model/src/inference/UNetInferenceAgent.py | aaryapatel007/Hippocampal-Volume-Quantification-in-Alzheimer-Progression | 5c9eff98572c1d2647a742d285805d9e328ab14f | [
"MIT"
] | null | null | null | train model/src/inference/UNetInferenceAgent.py | aaryapatel007/Hippocampal-Volume-Quantification-in-Alzheimer-Progression | 5c9eff98572c1d2647a742d285805d9e328ab14f | [
"MIT"
] | 4 | 2021-01-09T09:56:03.000Z | 2022-03-12T11:54:57.000Z | """
Contains class that runs inferencing
"""
import torch
import numpy as np
from networks.RecursiveUNet import UNet
from utils.utils import med_reshape
class UNetInferenceAgent:
"""
Stores model and parameters and some methods to handle inferencing
"""
def __init__(self, parameter_file_path='', mode... | 31 | 103 | 0.646606 | import torch
import numpy as np
from networks.RecursiveUNet import UNet
from utils.utils import med_reshape
class UNetInferenceAgent:
def __init__(self, parameter_file_path='', model=None, device="cpu", patch_size=64):
self.model = model
self.patch_size = patch_size
self.device = device
... | true | true |
f753341fad704cf609583de5d22f20adc778d97c | 10,245 | py | Python | models/base.py | cv-hci-project/PyTorch-VAE | e9b9d122eb52f76e096942b300a8db97a123be13 | [
"Apache-2.0"
] | 1 | 2021-10-10T17:07:29.000Z | 2021-10-10T17:07:29.000Z | models/base.py | pdeubel/PyTorch-VAE | e9b9d122eb52f76e096942b300a8db97a123be13 | [
"Apache-2.0"
] | null | null | null | models/base.py | pdeubel/PyTorch-VAE | e9b9d122eb52f76e096942b300a8db97a123be13 | [
"Apache-2.0"
] | 1 | 2021-09-06T22:01:14.000Z | 2021-09-06T22:01:14.000Z | from abc import abstractmethod
import matplotlib.pyplot as plt
import pytorch_lightning as pl
import torch
import torchvision.utils as vutils
from torch import optim
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.datasets import CelebA
from datasets.concrete_cracks import ... | 40.98 | 114 | 0.517618 | from abc import abstractmethod
import matplotlib.pyplot as plt
import pytorch_lightning as pl
import torch
import torchvision.utils as vutils
from torch import optim
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.datasets import CelebA
from datasets.concrete_cracks import ... | true | true |
f75335ca357bc10a1d8c06928ec8e8757a10616a | 2,029 | py | Python | tests/components/homekit_controller/test_air_quality.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 1 | 2022-01-05T16:48:58.000Z | 2022-01-05T16:48:58.000Z | tests/components/homekit_controller/test_air_quality.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 68 | 2020-07-23T07:13:53.000Z | 2022-03-31T06:01:48.000Z | tests/components/homekit_controller/test_air_quality.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 1 | 2020-12-13T08:27:33.000Z | 2020-12-13T08:27:33.000Z | """Basic checks for HomeKit air quality sensor."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from homeassistant.helpers import entity_registry as er
from tests.components.homekit_controller.common import setup_test_component
def create_air_... | 36.232143 | 80 | 0.774766 | from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from homeassistant.helpers import entity_registry as er
from tests.components.homekit_controller.common import setup_test_component
def create_air_quality_sensor_service(accessory):
service = ac... | true | true |
f753366f2c1a36457a50623b7e21a8e4a068486d | 1,121 | py | Python | puma/primitives/auto_reset_event.py | gift-surg/puma | 58beae3459a0c8d96adfe9af323e26868428df4d | [
"Apache-2.0"
] | null | null | null | puma/primitives/auto_reset_event.py | gift-surg/puma | 58beae3459a0c8d96adfe9af323e26868428df4d | [
"Apache-2.0"
] | 13 | 2020-05-04T14:14:58.000Z | 2020-07-29T16:37:03.000Z | puma/primitives/auto_reset_event.py | gift-surg/puma | 58beae3459a0c8d96adfe9af323e26868428df4d | [
"Apache-2.0"
] | null | null | null | import threading
from typing import NoReturn, Union, no_type_check
class AutoResetEvent(threading.Event):
"""Like threading.Event, except that wait() resets the event automatically."""
@no_type_check # I don't know why MyPy refuses to believe that threading.Event has properties self._cond and self._flag.
... | 48.73913 | 137 | 0.676182 | import threading
from typing import NoReturn, Union, no_type_check
class AutoResetEvent(threading.Event):
@no_type_check def wait(self, timeout: Union[int, float, None] = None) -> bool:
# This is a copy of the implementation in threading.Event, but with the addition of the line that clears the flag.... | true | true |
f75336862df1b267e83b88c61dd72e7599c141ca | 5,908 | py | Python | saleor/graphql/core/mutations.py | eskerda/saleor | b624d9f2ec6ae98a4c6ed50adf6735065d979aad | [
"BSD-3-Clause"
] | null | null | null | saleor/graphql/core/mutations.py | eskerda/saleor | b624d9f2ec6ae98a4c6ed50adf6735065d979aad | [
"BSD-3-Clause"
] | null | null | null | saleor/graphql/core/mutations.py | eskerda/saleor | b624d9f2ec6ae98a4c6ed50adf6735065d979aad | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
import graphene
from django.core.exceptions import ImproperlyConfigured
from graphene.types.mutation import MutationOptions
from graphene_django.form_converter import convert_form_field
from graphene_django.registry import get_global_registry
from graphql_jwt.decorators import staff... | 30.770833 | 75 | 0.681618 | from collections import OrderedDict
import graphene
from django.core.exceptions import ImproperlyConfigured
from graphene.types.mutation import MutationOptions
from graphene_django.form_converter import convert_form_field
from graphene_django.registry import get_global_registry
from graphql_jwt.decorators import staff... | true | true |
f753372832e07d75ba3a8f59b35a2ec01a4c9498 | 1,631 | py | Python | SalishSea/tides/script_runs_RC4.py | SalishSeaCast/SS-run-sets | a330ef9963defa6dc322c3f2313f76824878a58b | [
"Apache-2.0"
] | 1 | 2020-04-21T16:47:27.000Z | 2020-04-21T16:47:27.000Z | tempSalishSea/tides/script_runs_RC4.py | SalishSeaCast/SS-run-sets | a330ef9963defa6dc322c3f2313f76824878a58b | [
"Apache-2.0"
] | null | null | null | tempSalishSea/tides/script_runs_RC4.py | SalishSeaCast/SS-run-sets | a330ef9963defa6dc322c3f2313f76824878a58b | [
"Apache-2.0"
] | null | null | null | """ Script to define and execute a series of Salish Sea NEMO model runs.
All use the same RC4, corr4 files but include different numbers of tidal
constituents
"""
from __future__ import absolute_import
import os
import salishsea_cmd.api
def main():
run_desc = base_run_description()
runs = ('RC4_wO1S2', ... | 28.12069 | 72 | 0.626609 | from __future__ import absolute_import
import os
import salishsea_cmd.api
def main():
run_desc = base_run_description()
runs = ('RC4_wO1S2', 'RC4_wO1S2P1N2', 'RC4_wO1S2P1N2Q1K2')
for run_id in runs:
do_run(run_id, run_desc)
def do_run(run_id, run_desc):
run_desc['run_id'] = run_id
... | true | true |
f75338a04a50d9d144a63469e526b9860b0ad7b7 | 823 | py | Python | ColorPair_test_data.py | clean-code-craft-tcq-1/modular-python-Anjana-MU | a5bf6fb4b4a9f785a8ec714efbdf314e810d6514 | [
"MIT"
] | null | null | null | ColorPair_test_data.py | clean-code-craft-tcq-1/modular-python-Anjana-MU | a5bf6fb4b4a9f785a8ec714efbdf314e810d6514 | [
"MIT"
] | null | null | null | ColorPair_test_data.py | clean-code-craft-tcq-1/modular-python-Anjana-MU | a5bf6fb4b4a9f785a8ec714efbdf314e810d6514 | [
"MIT"
] | 1 | 2021-02-19T12:02:56.000Z | 2021-02-19T12:02:56.000Z | from ColorPair_get_data import get_color_from_pair_number
from ColorPair_get_data import get_pair_number_from_color
def test_functionalities():
test_number_to_pair(4, 'White', 'Brown')
test_number_to_pair(5, 'White', 'Slate')
test_pair_to_number('Black', 'Orange', 12)
test_pair_to_number('Violet', 'Slate', 25)... | 41.15 | 72 | 0.789793 | from ColorPair_get_data import get_color_from_pair_number
from ColorPair_get_data import get_pair_number_from_color
def test_functionalities():
test_number_to_pair(4, 'White', 'Brown')
test_number_to_pair(5, 'White', 'Slate')
test_pair_to_number('Black', 'Orange', 12)
test_pair_to_number('Violet', 'Slate', 25)... | true | true |
f75339253437217941857da8b8bd459190355a8e | 3,251 | py | Python | sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/projects/aio/_configuration.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/projects/aio/_configuration.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/projects/aio/_configuration.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.257576 | 149 | 0.693018 |
from typing import Any
from azure.core.configuration import Configuration
from azure.core.credentials import AzureKeyCredential
from azure.core.pipeline import policies
VERSION = "unknown"
class QuestionAnsweringProjectsClientConfiguration(Configuration):
def __init__(
self,
endpoint: str,
... | true | true |
f75339254745c2de1d3af367b4e8f41c0b34baf2 | 5,738 | py | Python | modin/pandas/datetimes.py | hwsamuel/modin | 8602fc0814337b257110239cd6830641eb0bf97a | [
"Apache-2.0"
] | 2 | 2020-06-29T13:15:04.000Z | 2020-08-10T22:31:08.000Z | modin/pandas/datetimes.py | hwsamuel/modin | 8602fc0814337b257110239cd6830641eb0bf97a | [
"Apache-2.0"
] | 26 | 2020-06-16T08:40:28.000Z | 2020-09-01T10:13:38.000Z | modin/pandas/datetimes.py | intel-go/modin | 4d0a3155b31104ac8083b223bd71ff3e541ecd92 | [
"Apache-2.0"
] | 2 | 2020-11-20T23:04:03.000Z | 2021-12-01T00:50:34.000Z | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 40.695035 | 88 | 0.660857 |
import pandas
from .dataframe import DataFrame
from .series import Series
def to_datetime(
arg,
errors="raise",
dayfirst=False,
yearfirst=False,
utc=None,
format=None,
exact=True,
unit=None,
infer_datetime_format=False,
origin="unix",
cache=True,
):
if not isinstance(... | true | true |
f753392b298178c003fa6699f1268d26c0ec6fa8 | 1,961 | py | Python | optimizedGPS/results_provider/heuristic_badness_stats.py | mickael-grima/optimizedGPS | e82fd864d7e1a3ef1f7ae64db991cb33784d4df3 | [
"Apache-2.0"
] | null | null | null | optimizedGPS/results_provider/heuristic_badness_stats.py | mickael-grima/optimizedGPS | e82fd864d7e1a3ef1f7ae64db991cb33784d4df3 | [
"Apache-2.0"
] | null | null | null | optimizedGPS/results_provider/heuristic_badness_stats.py | mickael-grima/optimizedGPS | e82fd864d7e1a3ef1f7ae64db991cb33784d4df3 | [
"Apache-2.0"
] | null | null | null |
from utils import tools
from optimizedGPS.data.data_generator import generate_bad_heuristic_graphs
from optimizedGPS.problems.Heuristics import RealGPS
from optimizedGPS.problems.simulator import FromEdgeDescriptionSimulator
def get_RealGPS_badness_stats(congestions=iter([])):
res = []
traffic_influence = 2
... | 37.711538 | 101 | 0.679245 |
from utils import tools
from optimizedGPS.data.data_generator import generate_bad_heuristic_graphs
from optimizedGPS.problems.Heuristics import RealGPS
from optimizedGPS.problems.simulator import FromEdgeDescriptionSimulator
def get_RealGPS_badness_stats(congestions=iter([])):
res = []
traffic_influence = 2
... | false | true |
f75339605590641977a32c51ac1f198989f63cfa | 13,538 | py | Python | tests/conftest.py | mbolivar-nordic/west | e02ac52236be5ffdf46ca9b8b99b771542ac2ff3 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | mbolivar-nordic/west | e02ac52236be5ffdf46ca9b8b99b771542ac2ff3 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | mbolivar-nordic/west | e02ac52236be5ffdf46ca9b8b99b771542ac2ff3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019, 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
import os
from pathlib import Path, PurePath
import platform
import shlex
import shutil
import subprocess
import sys
import textwrap
from west import configuration as config
import pytest
GIT = shutil.which('git')
# If you c... | 35.720317 | 79 | 0.614271 |
import os
from pathlib import Path, PurePath
import platform
import shlex
import shutil
import subprocess
import sys
import textwrap
from west import configuration as config
import pytest
GIT = shutil.which('git')
MANIFEST_TEMPLATE = '''\
manifest:
defaults:
remote: test-local
remotes:
- name: test-loc... | true | true |
f75339e856f45bc49dfefb13bc083497411c9b3f | 3,438 | py | Python | pyswagger/scan.py | gavrie/pyswagger | f5622d70519061c793e57d1b27659afbb8677105 | [
"MIT"
] | 199 | 2018-06-04T18:10:51.000Z | 2022-03-06T15:23:48.000Z | pyswagger/scan.py | gavrie/pyswagger | f5622d70519061c793e57d1b27659afbb8677105 | [
"MIT"
] | 125 | 2015-01-03T01:42:02.000Z | 2018-05-21T14:44:22.000Z | pyswagger/scan.py | gavrie/pyswagger | f5622d70519061c793e57d1b27659afbb8677105 | [
"MIT"
] | 61 | 2018-06-10T01:46:06.000Z | 2022-03-08T01:13:11.000Z | from __future__ import absolute_import
from .spec.base import BaseObj
import six
def default_tree_traversal(root, leaves):
""" default tree traversal """
objs = [('#', root)]
while len(objs) > 0:
path, obj = objs.pop()
# name of child are json-pointer encoded, we don't have
# to e... | 27.070866 | 101 | 0.518325 | from __future__ import absolute_import
from .spec.base import BaseObj
import six
def default_tree_traversal(root, leaves):
objs = [('#', root)]
while len(objs) > 0:
path, obj = objs.pop()
# to encode it again.
if obj.__class__ not in leaves:
objs.extend(map(lambda ... | true | true |
f75339f3316fa08437848dfaf9564a85b79049bf | 240 | py | Python | UnityEngine/VerticalWrapMode/__init__.py | Grim-es/udon-pie-auto-completion | c2cd86554ed615cdbbb01e19fa40665eafdfaedc | [
"MIT"
] | null | null | null | UnityEngine/VerticalWrapMode/__init__.py | Grim-es/udon-pie-auto-completion | c2cd86554ed615cdbbb01e19fa40665eafdfaedc | [
"MIT"
] | null | null | null | UnityEngine/VerticalWrapMode/__init__.py | Grim-es/udon-pie-auto-completion | c2cd86554ed615cdbbb01e19fa40665eafdfaedc | [
"MIT"
] | null | null | null | from UdonPie import UnityEngine
from UdonPie.Undefined import *
class VerticalWrapMode:
def __new__(cls, arg1=None):
'''
:returns: VerticalWrapMode
:rtype: UnityEngine.VerticalWrapMode
'''
pass
| 20 | 44 | 0.645833 | from UdonPie import UnityEngine
from UdonPie.Undefined import *
class VerticalWrapMode:
def __new__(cls, arg1=None):
pass
| true | true |
f7533a18a1b348e933be1af446bfcb6a698ac718 | 34,794 | py | Python | adspygoogle/dfp/zsi/v201010/NetworkService_services_types.py | hockeyprincess/google-api-dfp-python | efa82a8d85cbdc90f030db9d168790c55bd8b12a | [
"Apache-2.0"
] | null | null | null | adspygoogle/dfp/zsi/v201010/NetworkService_services_types.py | hockeyprincess/google-api-dfp-python | efa82a8d85cbdc90f030db9d168790c55bd8b12a | [
"Apache-2.0"
] | null | null | null | adspygoogle/dfp/zsi/v201010/NetworkService_services_types.py | hockeyprincess/google-api-dfp-python | efa82a8d85cbdc90f030db9d168790c55bd8b12a | [
"Apache-2.0"
] | null | null | null | ##################################################
# NetworkService_services_types.py
# generated by ZSI.generate.wsdl2python
##################################################
import ZSI
import ZSI.TCcompound
from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED
############... | 57.701493 | 1,029 | 0.631086 |
import ZSI
import ZSI.TCcompound
from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED
class ns0:
targetNamespace = "https://www.google.com/apis/ads/publisher/v201010"
class ApiVersionError_Def(TypeDefinition):
schema = "https://www.google.com/apis/ads... | true | true |
f7533b002600f542beb015ba1ee5ab227ed34068 | 16,915 | py | Python | thumt/bin/trainer.py | souradip93/GCDT | 5991044307f59598ea224b64f1f3b915fa00ebcc | [
"BSD-3-Clause"
] | 72 | 2019-06-07T02:05:10.000Z | 2022-02-24T09:33:13.000Z | thumt/bin/trainer.py | souradip93/GCDT | 5991044307f59598ea224b64f1f3b915fa00ebcc | [
"BSD-3-Clause"
] | 5 | 2019-09-11T02:50:17.000Z | 2021-11-19T07:05:10.000Z | thumt/bin/trainer.py | souradip93/GCDT | 5991044307f59598ea224b64f1f3b915fa00ebcc | [
"BSD-3-Clause"
] | 17 | 2019-06-06T03:12:15.000Z | 2021-12-10T20:04:30.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright 2018 The THUMT Authors
import argparse
import os
import numpy as np
import tensorflow as tf
import thumt.data.dataset as dataset
import thumt.data.record as record
import thumt.data.vocab as vocabulary
import thumt.models as models
import thumt.utils.hooks as hooks
impo... | 35.836864 | 146 | 0.594798 |
import argparse
import os
import numpy as np
import tensorflow as tf
import thumt.data.dataset as dataset
import thumt.data.record as record
import thumt.data.vocab as vocabulary
import thumt.models as models
import thumt.utils.hooks as hooks
import thumt.utils.utils as utils
import thumt.utils.parallel as parallel
im... | true | true |
f7533b7f5ac799ef0852da523ded9922ad36707d | 5,454 | py | Python | tests/components/airnow/test_config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | tests/components/airnow/test_config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | tests/components/airnow/test_config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Test the AirNow config flow."""
from unittest.mock import patch
from pyairnow.errors import AirNowError, InvalidKeyError
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.airnow.const import DOMAIN
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGIT... | 29.165775 | 88 | 0.621012 | from unittest.mock import patch
from pyairnow.errors import AirNowError, InvalidKeyError
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.airnow.const import DOMAIN
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS
from tests.common... | true | true |
f7533badfcb6513d7d7a25a2b685f310445cf622 | 1,868 | py | Python | agents/search/astar.py | jmribeiro/PLASTIC-Algorithms | c59ad567a906f320220a09caff64c4a6273151f8 | [
"Apache-2.0"
] | 5 | 2020-10-20T17:00:07.000Z | 2022-03-11T06:23:09.000Z | agents/search/astar.py | jmribeiro/PLASTIC-Algorithms | c59ad567a906f320220a09caff64c4a6273151f8 | [
"Apache-2.0"
] | 2 | 2020-12-05T05:56:57.000Z | 2021-06-05T08:11:35.000Z | agents/search/astar.py | jmribeiro/PLASTIC-Algorithms | c59ad567a906f320220a09caff64c4a6273151f8 | [
"Apache-2.0"
] | null | null | null | from heapq import *
from environment.utils import distance, neighbors, direction
class Node(object):
def __init__(self, position, parent, cost, heuristic):
self.position = position
self.parent = parent
self.cost = cost
self.heuristic = heuristic
def __lt__(self, other):
... | 26.309859 | 89 | 0.625268 | from heapq import *
from environment.utils import distance, neighbors, direction
class Node(object):
def __init__(self, position, parent, cost, heuristic):
self.position = position
self.parent = parent
self.cost = cost
self.heuristic = heuristic
def __lt__(self, other):
... | true | true |
f7533cd7dc0e57ad6f6f35503dcb73b9ed30550d | 3,797 | py | Python | tests/structures/tree/tree_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | 1 | 2021-06-14T01:20:09.000Z | 2021-06-14T01:20:09.000Z | tests/structures/tree/tree_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | null | null | null | tests/structures/tree/tree_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | null | null | null | from typing import TypeVar, cast
import pytest
from cs.structures import BinarySearchTree, RedBlackTree, Tree
from cs.util import Comparable
T = TypeVar("T", bound=Comparable)
parametrize_tree_types = pytest.mark.parametrize(
"tree_type", ("BinarySearchTree", "RedBlackTree")
)
TEN_ELEMS = (8, 3, 6, 1, 10, 14, 13... | 28.765152 | 84 | 0.59231 | from typing import TypeVar, cast
import pytest
from cs.structures import BinarySearchTree, RedBlackTree, Tree
from cs.util import Comparable
T = TypeVar("T", bound=Comparable)
parametrize_tree_types = pytest.mark.parametrize(
"tree_type", ("BinarySearchTree", "RedBlackTree")
)
TEN_ELEMS = (8, 3, 6, 1, 10, 14, 13... | true | true |
f7533d0aad1081a70ea9e135384c6de05bfeb4f6 | 2,841 | py | Python | data/external/repositories_2to3/132160/kaggle-ndsb-master/configurations/featmomentsinfo_doublescale_fs5_latemerge_2233.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/132160/kaggle-ndsb-master/configurations/featmomentsinfo_doublescale_fs5_latemerge_2233.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/132160/kaggle-ndsb-master/configurations/featmomentsinfo_doublescale_fs5_latemerge_2233.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z |
"""momentsinfo_convroll4_doublescale_fs5"""
import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import tmp_dnn
import tta
batch_size = 128
chunk_size = 32768
num_chunks_train = 240
momentum = 0.9
learnin... | 32.655172 | 187 | 0.728617 |
import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import tmp_dnn
import tta
batch_size = 128
chunk_size = 32768
num_chunks_train = 240
momentum = 0.9
learning_rate_schedule = {
0: 0.001,
100: ... | true | true |
f7533d452877f9b98ff9e411f19526008aefd991 | 624 | py | Python | Pescado.py | rllullt/angry-bears | 4cd739c461c74378b36cad328639acb256b22c29 | [
"MIT"
] | null | null | null | Pescado.py | rllullt/angry-bears | 4cd739c461c74378b36cad328639acb256b22c29 | [
"MIT"
] | null | null | null | Pescado.py | rllullt/angry-bears | 4cd739c461c74378b36cad328639acb256b22c29 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Clase Pescado
Genera un objeto pescado sacado de un archivo STL
Hereda la clase Alimento
'''
from Alimento import Alimento
# Clase Pescado
# Campos:
# nombreArchivo (contiene el nombre del archivo STL): str
# rugosidad (si es rugoso o brillante): str
class Pescado(Alimento):
# Constru... | 28.363636 | 91 | 0.665064 |
from Alimento import Alimento
class Pescado(Alimento):
def __init__(self, pos= [0.0, 0.0, 0.0], sz= None, rgb= [0.4706, 0.5216, 0.5451, 1.0]):
self.nombreArchivo= "concrete_fish.stl"
self.rugosidad= "b"
Alimento.__init__(self, self.rugosidad, self.nombreArchivo, None,... | true | true |
f7533e2a5f6aa651838098aab72e1d9d62e2a48e | 1,031 | py | Python | sayings/models.py | migdall/quickblog | 3ced7e17f61239d9eab9ba8b381ff025da1dff66 | [
"MIT"
] | null | null | null | sayings/models.py | migdall/quickblog | 3ced7e17f61239d9eab9ba8b381ff025da1dff66 | [
"MIT"
] | null | null | null | sayings/models.py | migdall/quickblog | 3ced7e17f61239d9eab9ba8b381ff025da1dff66 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
# Create your models here.
class Question(models.Model):
content = models.CharField(max_length=255)
class Answer(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
recording_url = models.URLField(max_length=255)
questi... | 31.242424 | 79 | 0.753637 | import uuid
from django.db import models
class Question(models.Model):
content = models.CharField(max_length=255)
class Answer(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
recording_url = models.URLField(max_length=255)
question = models.ForeignKey(Ques... | true | true |
f7533ee6d6484bf3edaabc8b6e4a1f4998183395 | 5,193 | py | Python | tests/test_pandas_get_generator_operations.py | craft-ai/craft-ai-client-python | 3d8b3d9a49c0c70964deaeb9645130dd54f9a0b3 | [
"BSD-3-Clause"
] | 14 | 2016-08-26T07:06:57.000Z | 2020-09-22T07:41:21.000Z | tests/test_pandas_get_generator_operations.py | craft-ai/craft-ai-client-python | 3d8b3d9a49c0c70964deaeb9645130dd54f9a0b3 | [
"BSD-3-Clause"
] | 94 | 2016-08-02T14:07:59.000Z | 2021-10-06T11:50:52.000Z | tests/test_pandas_get_generator_operations.py | craft-ai/craft-ai-client-python | 3d8b3d9a49c0c70964deaeb9645130dd54f9a0b3 | [
"BSD-3-Clause"
] | 8 | 2017-02-07T12:05:57.000Z | 2021-10-14T09:45:30.000Z | import unittest
from craft_ai.pandas import CRAFTAI_PANDAS_ENABLED
if CRAFTAI_PANDAS_ENABLED:
import copy
import pandas as pd
import craft_ai.pandas
from .data import pandas_valid_data
from .utils import generate_entity_id
from . import settings
AGENT_ID_1_BASE = "test_1_df_pd"
AGEN... | 40.889764 | 86 | 0.729636 | import unittest
from craft_ai.pandas import CRAFTAI_PANDAS_ENABLED
if CRAFTAI_PANDAS_ENABLED:
import copy
import pandas as pd
import craft_ai.pandas
from .data import pandas_valid_data
from .utils import generate_entity_id
from . import settings
AGENT_ID_1_BASE = "test_1_df_pd"
AGEN... | true | true |
f7533fefaa34b43a6d80ed515d98c1eca0a26723 | 1,201 | py | Python | mapss/static/packages/arches/arches/app/search/components/provisional_filter.py | MPI-MAPSS/MAPSS | 3a5c0109758801717aaa8de1125ca5e98f83d3b4 | [
"CC0-1.0"
] | null | null | null | mapss/static/packages/arches/arches/app/search/components/provisional_filter.py | MPI-MAPSS/MAPSS | 3a5c0109758801717aaa8de1125ca5e98f83d3b4 | [
"CC0-1.0"
] | null | null | null | mapss/static/packages/arches/arches/app/search/components/provisional_filter.py | MPI-MAPSS/MAPSS | 3a5c0109758801717aaa8de1125ca5e98f83d3b4 | [
"CC0-1.0"
] | null | null | null | from arches.app.search.components.base import BaseSearchFilter
from arches.app.search.elasticsearch_dsl_builder import Bool, Terms
details = {
"searchcomponentid": "",
"name": "Provisional Filter",
"icon": "",
"modulename": "provisional_filter.py",
"classname": "ProvisionalFilter",
"type": "",
... | 36.393939 | 115 | 0.692756 | from arches.app.search.components.base import BaseSearchFilter
from arches.app.search.elasticsearch_dsl_builder import Bool, Terms
details = {
"searchcomponentid": "",
"name": "Provisional Filter",
"icon": "",
"modulename": "provisional_filter.py",
"classname": "ProvisionalFilter",
"type": "",
... | true | true |
f753403e2cea8e364d13b91eee268f9f3ff9ddec | 627 | py | Python | airline/manage.py | VToropov1337/django_airline | 295a0f97a65edb0c76a38a5aa903665bf0c01765 | [
"MIT"
] | 7 | 2021-05-15T16:32:00.000Z | 2022-03-31T12:11:35.000Z | airline/manage.py | VToropov1337/django_airline | 295a0f97a65edb0c76a38a5aa903665bf0c01765 | [
"MIT"
] | 1 | 2022-03-10T07:26:37.000Z | 2022-03-10T07:26:37.000Z | airline/manage.py | VToropov1337/django_airline | 295a0f97a65edb0c76a38a5aa903665bf0c01765 | [
"MIT"
] | 30 | 2021-01-25T18:20:38.000Z | 2022-03-23T02:59:41.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'airline.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'airline.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f75341101b5d384f9b33707486682d30d676eaa0 | 2,656 | py | Python | python/oneflow/test/modules/test_view.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/test/modules/test_view.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/test/modules/test_view.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow 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 law or agr... | 29.511111 | 82 | 0.606928 |
import unittest
from collections import OrderedDict
import numpy as np
from test_util import GenArgList
import oneflow as flow
import oneflow.unittest
def _test_view(test_case, device):
x = np.array(
[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]
).astype(np.float32)
input = fl... | true | true |
f75341f82cb3d29921a99f33a2a83bd7047d1845 | 3,258 | py | Python | Model.py | khaledmohammed/CULaneDetection | 9b756a7f77aa9c371a44165fbbf19307ae6558c2 | [
"MIT"
] | 2 | 2019-11-18T07:00:50.000Z | 2021-05-20T07:06:08.000Z | Model.py | khaledmohammed/CULaneDetection | 9b756a7f77aa9c371a44165fbbf19307ae6558c2 | [
"MIT"
] | null | null | null | Model.py | khaledmohammed/CULaneDetection | 9b756a7f77aa9c371a44165fbbf19307ae6558c2 | [
"MIT"
] | 2 | 2021-05-20T07:06:09.000Z | 2022-02-27T10:33:33.000Z |
from keras.models import Sequential
from keras.layers import Activation, Dropout, UpSampling2D, ZeroPadding2D
from keras.layers import Conv2DTranspose, Conv2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
from keras import regularizers
def CreateModel(input_shape):
pool_size = (2, 2)
... | 34.659574 | 114 | 0.647023 |
from keras.models import Sequential
from keras.layers import Activation, Dropout, UpSampling2D, ZeroPadding2D
from keras.layers import Conv2DTranspose, Conv2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
from keras import regularizers
def CreateModel(input_shape):
pool_size = (2, 2)
... | true | true |
f753448eae624c9f1d4258b84a7e61b0a9aef194 | 1,020 | py | Python | wagtailgridder/migrations/0002_auto_20180220_1101.py | wharton/wagtailgridder | cdbe0088d86e60d6cf4cd8cf7c65f0c5bc273b54 | [
"BSD-3-Clause"
] | 61 | 2017-02-08T15:24:44.000Z | 2022-03-23T08:09:36.000Z | wagtailgridder/migrations/0002_auto_20180220_1101.py | wharton/wagtailgridder | cdbe0088d86e60d6cf4cd8cf7c65f0c5bc273b54 | [
"BSD-3-Clause"
] | 11 | 2017-08-06T16:27:10.000Z | 2021-02-14T04:26:05.000Z | wagtailgridder/migrations/0002_auto_20180220_1101.py | wharton/wagtailgridder | cdbe0088d86e60d6cf4cd8cf7c65f0c5bc273b54 | [
"BSD-3-Clause"
] | 13 | 2017-03-24T19:44:33.000Z | 2021-02-12T02:17:44.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 16:01
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
("wagtailgridder", "0001_squashed_0012_auto_20170607_1317"),
]
op... | 29.142857 | 98 | 0.588235 | from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
("wagtailgridder", "0001_squashed_0012_auto_20170607_1317"),
]
operations = [
migrations.AlterField(
model_name="gridin... | true | true |
f7534491c0d3a7d187c445afd5f3a0163137d29a | 1,280 | py | Python | py_smart_flies/smart_flies.py | AdamSpannbauer/misc_code_fun | 782b6aa1c6c3b5e881a4745564ca1faeca53d5fd | [
"MIT"
] | 5 | 2018-07-25T12:39:08.000Z | 2018-08-11T13:49:42.000Z | py_smart_flies/smart_flies.py | AdamSpannbauer/misc_code_fun | 782b6aa1c6c3b5e881a4745564ca1faeca53d5fd | [
"MIT"
] | null | null | null | py_smart_flies/smart_flies.py | AdamSpannbauer/misc_code_fun | 782b6aa1c6c3b5e881a4745564ca1faeca53d5fd | [
"MIT"
] | null | null | null | import argparse
from smart_fly_class import SmartFlies
ap = argparse.ArgumentParser()
ap.add_argument('-f', '--nFlies', type=int, default=200, help='Number of flies to create')
ap.add_argument('-o', '--nObstacles', type=int, default=4, help='Number of obstacles')
ap.add_argument('-g', '--nGenerations', type=int, defau... | 51.2 | 105 | 0.619531 | import argparse
from smart_fly_class import SmartFlies
ap = argparse.ArgumentParser()
ap.add_argument('-f', '--nFlies', type=int, default=200, help='Number of flies to create')
ap.add_argument('-o', '--nObstacles', type=int, default=4, help='Number of obstacles')
ap.add_argument('-g', '--nGenerations', type=int, defau... | true | true |
f7534543f2b90054b13a9718ce22d0bcd9ef3abd | 376 | py | Python | src/CsvReader.py | Erikalizth27/project2practice | 1baf4bf5e13b5b4b409b6a5d64c6aa236f09158d | [
"MIT"
] | null | null | null | src/CsvReader.py | Erikalizth27/project2practice | 1baf4bf5e13b5b4b409b6a5d64c6aa236f09158d | [
"MIT"
] | null | null | null | src/CsvReader.py | Erikalizth27/project2practice | 1baf4bf5e13b5b4b409b6a5d64c6aa236f09158d | [
"MIT"
] | null | null | null | import csv
def ClassFactory(class_name, dictionary):
return type(class_name, (object,), dictionary)
class CsvReader:
data = []
def __init__(self, filepath):
self.data.clear()
with open(filepath) as text_data:
csv_data = csv.DictReader(text_data, delimiter=',')
fo... | 23.5 | 63 | 0.619681 | import csv
def ClassFactory(class_name, dictionary):
return type(class_name, (object,), dictionary)
class CsvReader:
data = []
def __init__(self, filepath):
self.data.clear()
with open(filepath) as text_data:
csv_data = csv.DictReader(text_data, delimiter=',')
fo... | true | true |
f7534612b85e852053ca70bf7eae09d88b0cc773 | 10,418 | py | Python | SEES_CODE/hybrid_placement.py | papanisaicharan/Scalable-energy-efficient-scheme-on-mobile-nodes | 43f8d9c82b603c33803ee5d07f056eaeabdaf530 | [
"MIT"
] | 1 | 2019-04-07T03:36:10.000Z | 2019-04-07T03:36:10.000Z | SEES_CODE/hybrid_placement.py | papanisaicharan/Major-Project | 43f8d9c82b603c33803ee5d07f056eaeabdaf530 | [
"MIT"
] | null | null | null | SEES_CODE/hybrid_placement.py | papanisaicharan/Major-Project | 43f8d9c82b603c33803ee5d07f056eaeabdaf530 | [
"MIT"
] | 1 | 2020-02-08T05:21:37.000Z | 2020-02-08T05:21:37.000Z | """
This is a hybrid placement algorithm(offline mode)
"""
from sympy.solvers import solve
from sympy import Symbol
#this is testing plot
from matplotlib import pyplot as plt
from matplotlib.ticker import MultipleLocator
import numpy as np
import math
import random
import Node as nd
import EH_relay as ... | 31.098507 | 110 | 0.601555 |
from sympy.solvers import solve
from sympy import Symbol
from matplotlib import pyplot as plt
from matplotlib.ticker import MultipleLocator
import numpy as np
import math
import random
import Node as nd
import EH_relay as relay_nd
import LBS as L_B_S
import Zone as zone
import Network as nw
def getpoint... | true | true |
f753462e400f9fe8744a1815859819ad15ed0741 | 12,466 | py | Python | strategies/vyacheslav_signalbuy_VolScan.py | jthhk/Binance-volatility-trading-bot | d815716d2161c5d07cea0506049d73450bd5ef5b | [
"MIT"
] | 4 | 2021-11-10T11:47:39.000Z | 2022-02-03T07:07:37.000Z | strategies/vyacheslav_signalbuy_VolScan.py | jthhk/Binance-volatility-trading-bot | d815716d2161c5d07cea0506049d73450bd5ef5b | [
"MIT"
] | 1 | 2021-11-10T03:52:25.000Z | 2021-11-11T07:00:18.000Z | strategies/vyacheslav_signalbuy_VolScan.py | jthhk/Binance-volatility-trading-bot | d815716d2161c5d07cea0506049d73450bd5ef5b | [
"MIT"
] | 1 | 2022-01-14T13:03:56.000Z | 2022-01-14T13:03:56.000Z | # VolScan is a Binance Volatility Bot(BVT Bot)
# compatible module that generates crypto buying signals based upon negative price change & volatility.
# It does this in two different ways,
# the main one being by calculating the aggregate price change within a user defined period,
# the second way being by use of the C... | 46.514925 | 120 | 0.66902 |
import os
import numpy as np
from time import sleep
from datetime import datetime
from binance.client import Client
from helpers.parameters import parse_args, load_config
from helpers.handle_creds import (
load_correct_creds
)
args = parse_args()
DEFAULT_CONFIG_FILE = 'config.yml'
DEFAULT_CREDS_FILE = 'creds.y... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.