hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bb0f20027ec2226e818b1ac4b650b977708c380f | 12,027 | py | Python | hopla/workers.py | AGrigis/hopla | 60147969267b8bf71aec774053d33fa797e2f668 | [
"CECILL-B"
] | null | null | null | hopla/workers.py | AGrigis/hopla | 60147969267b8bf71aec774053d33fa797e2f668 | [
"CECILL-B"
] | null | null | null | hopla/workers.py | AGrigis/hopla | 60147969267b8bf71aec774053d33fa797e2f668 | [
"CECILL-B"
] | null | null | null | ##########################################################################
# Hopla - Copyright (C) AGrigis, 2015 - 2016
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details... | 39.175896 | 79 | 0.573709 | ##########################################################################
# Hopla - Copyright (C) AGrigis, 2015 - 2016
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 42 |
d06a9b5aba8faa38f4e9546363a94d30f0798e45 | 3,483 | py | Python | wsu/tools/simx/simx/python/simx/test/base/Oscilloscope/test_node.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | 1 | 2020-02-28T20:35:09.000Z | 2020-02-28T20:35:09.000Z | wsu/tools/simx/simx/python/simx/test/base/Oscilloscope/test_node.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | wsu/tools/simx/simx/python/simx/test/base/Oscilloscope/test_node.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | from simx.base.testutil import import_assert_functions
import_assert_functions(globals())
from TOSSIM import Tossim
_tossim = Tossim([])
tossim = None
a = None
b = None
c = None
# PST- due to overflow bugs in Tossim (and that there is no way to
# clear the noise traces) each test that uses noise trace readings
# w... | 26.18797 | 77 | 0.655757 | from simx.base.testutil import import_assert_functions
import_assert_functions(globals())
from simx.base import TossimBase
from simx.base import Node
from TOSSIM import Tossim
_tossim = Tossim([])
tossim = None
a = None
b = None
c = None
def setUp():
global tossim, a, b, c
# base
tossim = TossimBase(_to... | 0 | 0 | 0 | 0 | 2,199 | 558 | 0 | 16 | 293 |
36cee23ae9ac3c86ed7eb4e393fb042b87a6aec9 | 5,737 | py | Python | tests/interestingptrmaptest.py | netcharm/ironclad | 5892c43b540b216d638e0fed2e6cf3fd8289fdfc | [
"PSF-2.0"
] | null | null | null | tests/interestingptrmaptest.py | netcharm/ironclad | 5892c43b540b216d638e0fed2e6cf3fd8289fdfc | [
"PSF-2.0"
] | null | null | null | tests/interestingptrmaptest.py | netcharm/ironclad | 5892c43b540b216d638e0fed2e6cf3fd8289fdfc | [
"PSF-2.0"
] | null | null | null |
from tests.utils.runtest import makesuite, run
# NOTE: certain tests wrap some of their execution in a do() function;
# either to ensure that things-which-should-be-GCed really do get GCed,
# rather than hanging around until out of scope, or to ensure that
# inappropriate gc gets a chance to happen and cau... | 32.971264 | 82 | 0.567544 |
from tests.utils.runtest import makesuite, run
from tests.utils.testcase import TestCase
from tests.utils.gc import gcwait
from System import NullReferenceException, WeakReference
from System.Runtime.InteropServices import Marshal
from Ironclad import BadMappingException, CPyMarshal, InterestingPtrMap, P... | 0 | 0 | 0 | 4,956 | 0 | 0 | 0 | 171 | 169 |
f0c9ee2a28d8746fe467486ead00c3e7ca13b083 | 2,355 | py | Python | testsphinx/testsphinx/testapp/migrations/0003_add_date_field.py | NewVadim/django-sphinx | fe83ed4455608b5b4039ddf86aea476cc932b257 | [
"BSD-3-Clause"
] | null | null | null | testsphinx/testsphinx/testapp/migrations/0003_add_date_field.py | NewVadim/django-sphinx | fe83ed4455608b5b4039ddf86aea476cc932b257 | [
"BSD-3-Clause"
] | null | null | null | testsphinx/testsphinx/testapp/migrations/0003_add_date_field.py | NewVadim/django-sphinx | fe83ed4455608b5b4039ddf86aea476cc932b257 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 46.176471 | 129 | 0.549469 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Search.date'
db.add_column('testapp_search', 'date',
self.gf('django.d... | 0 | 0 | 0 | 2,202 | 0 | 0 | 0 | 18 | 111 |
be5aea6672360ea16303055bb8172befc5fb1018 | 486 | py | Python | day10/django/app1/urls.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | day10/django/app1/urls.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | day10/django/app1/urls.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
urlpatterns =[
path("addDepartments",addDepartments,name="addDepartments"),
path("showDepartments",showDepartments,name="showDepartments"),
path("updateDepartment",updateDepartment,name="updateDepartment"),
path("delDepartment",delDepartment,name="delDepartment"),
] | 40.5 | 70 | 0.796296 | from django.urls import path
from app1.dateview.addDepartments import *
from app1.dateview.showDepartments import *
from app1.dateview.updateDepartment import *
from app1.dateview.delDepartment import *
urlpatterns =[
path("addDepartments",addDepartments,name="addDepartments"),
path("showDepartments",showDepar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 88 |
e754d81a363486bcbb02b4180c9aa685a5e210b3 | 1,598 | py | Python | openpnm/algorithms/TransientIonicConduction.py | s-lunowa/OpenPNM | f176ea2cd76f7879edc7eabe13115a6ba9a8b18e | [
"MIT"
] | null | null | null | openpnm/algorithms/TransientIonicConduction.py | s-lunowa/OpenPNM | f176ea2cd76f7879edc7eabe13115a6ba9a8b18e | [
"MIT"
] | null | null | null | openpnm/algorithms/TransientIonicConduction.py | s-lunowa/OpenPNM | f176ea2cd76f7879edc7eabe13115a6ba9a8b18e | [
"MIT"
] | null | null | null | from openpnm.utils import logging, Docorator
logger = logging.getLogger(__name__)
docstr = Docorator()
| 27.084746 | 78 | 0.690864 | from openpnm.algorithms import TransientReactiveTransport, IonicConduction
from openpnm.utils import logging, Docorator, GenericSettings
logger = logging.getLogger(__name__)
docstr = Docorator()
@docstr.get_sections(base='TransientIonicConductionSettings',
sections=['Parameters'])
@docstr.dedent
... | 0 | 806 | 0 | 549 | 0 | 0 | 0 | 70 | 68 |
9d434a8ca5bbb2b4faa659e9649e4830be8018fd | 1,453 | py | Python | tensealstat/tools_context.py | kozzion/tensealstat | 93314a8721ec6b1a2bea466aaeadb06cbf5a4f63 | [
"Apache-2.0"
] | 6 | 2020-12-17T16:05:24.000Z | 2021-12-28T13:26:31.000Z | tensealstat/tools_context.py | kozzion/tensealstat | 93314a8721ec6b1a2bea466aaeadb06cbf5a4f63 | [
"Apache-2.0"
] | null | null | null | tensealstat/tools_context.py | kozzion/tensealstat | 93314a8721ec6b1a2bea466aaeadb06cbf5a4f63 | [
"Apache-2.0"
] | null | null | null |
# @staticmethod
# def get_context_high():
# poly_mod_degree = 32768
# coeff_mod_bit_sizes = [60, 40, 40, 40, 40, 40, 60] # for better accuracy
# context = ts.context(ts.SCHEME_TYPE.CKKS, poly_mod_degree, -1, coeff_mod_bit_sizes)
# context.global_scale = 2 ** 60
# conte... | 33.790698 | 93 | 0.649002 | import tenseal as ts
class ToolsContext:
# @staticmethod
# def get_context_high():
# poly_mod_degree = 32768
# coeff_mod_bit_sizes = [60, 40, 40, 40, 40, 40, 60] # for better accuracy
# context = ts.context(ts.SCHEME_TYPE.CKKS, poly_mod_degree, -1, coeff_mod_bit_sizes)
# cont... | 0 | 958 | 0 | -2 | 0 | 0 | 0 | -1 | 126 |
5dd5209ed52d91a2effd504fb3000119761a9c6d | 2,032 | py | Python | myscripts/dataset_crop.py | SpikeKing/pytorch-image-models-my | c90daf33580dd07d3924a8dfa492511516641ace | [
"Apache-2.0"
] | null | null | null | myscripts/dataset_crop.py | SpikeKing/pytorch-image-models-my | c90daf33580dd07d3924a8dfa492511516641ace | [
"Apache-2.0"
] | null | null | null | myscripts/dataset_crop.py | SpikeKing/pytorch-image-models-my | c90daf33580dd07d3924a8dfa492511516641ace | [
"Apache-2.0"
] | 1 | 2021-09-28T08:13:42.000Z | 2021-09-28T08:13:42.000Z | #!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2021. All rights reserved.
Created by C. L. Wang on 6.12.21
"""
import math
import random
def get_params(img, scale, ratio):
"""Get parameters for ``crop`` for a random sized crop.
Args:
img (PIL Image): Image to be cropped.
scale ... | 27.835616 | 83 | 0.588091 | #!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2021. All rights reserved.
Created by C. L. Wang on 6.12.21
"""
import os
import math
import random
from PIL import Image
from myutils.cv_utils import *
from root_dir import DATA_DIR
def get_params(img, scale, ratio):
"""Get parameters for ``crop`` fo... | 0 | 0 | 0 | 0 | 0 | 336 | 0 | 5 | 112 |
7e1f8de2d0cc9c87348f629b537b1b12db5a537b | 4,111 | py | Python | tests/test_client.py | BONSAMURAIS/bentso | f2ad192e11793c5506b9b0d7f61f5bd175eafb49 | [
"BSD-3-Clause"
] | null | null | null | tests/test_client.py | BONSAMURAIS/bentso | f2ad192e11793c5506b9b0d7f61f5bd175eafb49 | [
"BSD-3-Clause"
] | 7 | 2019-03-04T13:26:38.000Z | 2019-03-29T09:35:35.000Z | tests/test_client.py | BONSAMURAIS/bentso | f2ad192e11793c5506b9b0d7f61f5bd175eafb49 | [
"BSD-3-Clause"
] | 1 | 2020-10-24T20:08:44.000Z | 2020-10-24T20:08:44.000Z | import os
FIXTURES = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"fixtures",
)
| 33.153226 | 83 | 0.645828 | from bentso import CachingDataClient
from bentso.db import get_database
import numpy as np
import os
import pandas as pd
import pytest
FIXTURES = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"fixtures",
)
def test_request_parameters(monkeypatch, tmp_path):
class FakeClient:
def __in... | 0 | 0 | 0 | 173 | 0 | 3,470 | 0 | 15 | 340 |
5d11e136135982bc6b84c0334f5eb61bc13365e6 | 15,345 | py | Python | test/test_pytest/test_flaky_pytest_plugin.py | Jeff-Meadows/flaky | 3bb022f9014c46409662f7352733a4c660e11cd1 | [
"Apache-2.0"
] | 1 | 2018-06-10T23:31:42.000Z | 2018-06-10T23:31:42.000Z | test/test_pytest/test_flaky_pytest_plugin.py | Jeff-Meadows/flaky | 3bb022f9014c46409662f7352733a4c660e11cd1 | [
"Apache-2.0"
] | null | null | null | test/test_pytest/test_flaky_pytest_plugin.py | Jeff-Meadows/flaky | 3bb022f9014c46409662f7352733a4c660e11cd1 | [
"Apache-2.0"
] | 1 | 2020-11-07T10:31:36.000Z | 2020-11-07T10:31:36.000Z | # coding: utf-8
from __future__ import unicode_literals
from mock import Mock
# pylint:disable=import-error
# pylint:enable=import-error
from flaky import flaky
_REPORT_TEXT1 = 'Flaky report text'
_REPORT_TEXT2 = ' '
def test_flaky_plugin_raises_errors_in_fixture_setup(
flaky_test,
... | 27.255773 | 80 | 0.607234 | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
from mock import Mock, patch
# pylint:disable=import-error
import pytest
# pylint:enable=import-error
from flaky import flaky
from flaky import _flaky_plugin
from flaky.flaky_pytest_plugin import (
CallInfo,
FlakyPlugin,
FlakyX... | 60 | 3,068 | 0 | 9,478 | 0 | 1,075 | 0 | 118 | 549 |
b94343b87039488324e7c6319d1239d47bb3dff4 | 5,261 | py | Python | src/python/grpcio/grpc/experimental/aio/__init__.py | sachin746/grpc | 98abc22f4cee7289058543f4602185f0ffacf6ed | [
"Apache-2.0"
] | null | null | null | src/python/grpcio/grpc/experimental/aio/__init__.py | sachin746/grpc | 98abc22f4cee7289058543f4602185f0ffacf6ed | [
"Apache-2.0"
] | null | null | null | src/python/grpcio/grpc/experimental/aio/__init__.py | sachin746/grpc | 98abc22f4cee7289058543f4602185f0ffacf6ed | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 35.073333 | 96 | 0.65881 | # Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 0 | 2,750 | 0 | 989 | 0 | 0 | 0 | -7 | 226 |
42b37f721e56b667340e27c5dce684303994eeaa | 2,399 | py | Python | examples/MDF/translation/run_translated_FN.py | 29riyasaxena/MDF | 476e6950d0f14f29463eb4f6e3be518dfb2160a5 | [
"Apache-2.0"
] | null | null | null | examples/MDF/translation/run_translated_FN.py | 29riyasaxena/MDF | 476e6950d0f14f29463eb4f6e3be518dfb2160a5 | [
"Apache-2.0"
] | null | null | null | examples/MDF/translation/run_translated_FN.py | 29riyasaxena/MDF | 476e6950d0f14f29463eb4f6e3be518dfb2160a5 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
main()
| 28.223529 | 101 | 0.599416 | import json
import ntpath
from modeci_mdf.functions.standard import mdf_functions, create_python_expression
from typing import List, Tuple, Dict, Optional, Set, Any, Union
from modeci_mdf.utils import load_mdf, print_summary
from modeci_mdf.mdf import *
from modeci_mdf.full_translator import *
from modeci_mdf.executio... | 0 | 0 | 0 | 0 | 0 | 1,956 | 0 | 157 | 245 |
7444fee397415f3a18ab9829ca6eb1418d83f54f | 829 | py | Python | NetCatKS/Validators/api/implementers/validators/xml/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | NetCatKS/Validators/api/implementers/validators/xml/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | NetCatKS/Validators/api/implementers/validators/xml/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | __author__ = 'dimd'
from zope.component import getGlobalSiteManager
gsm = getGlobalSiteManager()
gsm.registerSubscriptionAdapter(XMLValidator) | 22.405405 | 81 | 0.703257 | __author__ = 'dimd'
from NetCatKS.Validators.api.interfaces.message import IMessage
from NetCatKS.Validators.api.implementers.validators.default import BaseValidator
from zope.component import adapts
from zope.component import getGlobalSiteManager
from lxml import etree
class XMLValidator(BaseValidator):
adap... | 0 | 0 | 0 | 456 | 0 | 0 | 0 | 115 | 114 |
af738c15e451ead3111b0a2aa4f40cb71e88296b | 437 | py | Python | recipes/migrations/0004_auto_20210324_1236.py | IzmdI/foodgram-project | 280ae3348872b5072c9bb3aa3f06d62ca831369e | [
"MIT"
] | null | null | null | recipes/migrations/0004_auto_20210324_1236.py | IzmdI/foodgram-project | 280ae3348872b5072c9bb3aa3f06d62ca831369e | [
"MIT"
] | null | null | null | recipes/migrations/0004_auto_20210324_1236.py | IzmdI/foodgram-project | 280ae3348872b5072c9bb3aa3f06d62ca831369e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-24 09:36
| 19.863636 | 47 | 0.565217 | # Generated by Django 3.1.7 on 2021-03-24 09:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('recipes', '0003_auto_20210323_1606'),
]
operations = [
migrations.RemoveField(
model_name='recipe',
name='favorites',
... | 0 | 0 | 0 | 331 | 0 | 0 | 0 | 11 | 46 |
f0a0116d9ada4d85bd0d372dee92feac6d85b444 | 1,508 | py | Python | examples/14-daemons/example.py | michaelnarodovitch/kopf | df4e51bf5ca3c1fc9e609ffeb4cc951925135db2 | [
"MIT"
] | null | null | null | examples/14-daemons/example.py | michaelnarodovitch/kopf | df4e51bf5ca3c1fc9e609ffeb4cc951925135db2 | [
"MIT"
] | null | null | null | examples/14-daemons/example.py | michaelnarodovitch/kopf | df4e51bf5ca3c1fc9e609ffeb4cc951925135db2 | [
"MIT"
] | null | null | null |
# Sync daemons in threads are non-interruptable, they must check for the `stopped` flag.
# This daemon exits after 3 attempts and then 30 seconds of running (unless stopped).
# Async daemons do not need the `stopped` signal, they can rely on `asyncio.CancelledError` raised.
# This daemon runs forever (until stopped... | 39.684211 | 128 | 0.689655 | import asyncio
import time
import kopf
# Sync daemons in threads are non-interruptable, they must check for the `stopped` flag.
# This daemon exits after 3 attempts and then 30 seconds of running (unless stopped).
@kopf.daemon('zalando.org', 'v1', 'kopfexamples', backoff=3)
def background_sync(spec, stopped, logger,... | 0 | 873 | 0 | 0 | 0 | 0 | 0 | -27 | 111 |
a27ed5701f6e6de2e3fa1c0caacfb9061e942c5a | 991 | py | Python | djpaypal/checks.py | SakuradaJun/dj-paypal-py27 | dabcccac4dc89c0d8a901ee4800ac7ded7f7102e | [
"MIT"
] | null | null | null | djpaypal/checks.py | SakuradaJun/dj-paypal-py27 | dabcccac4dc89c0d8a901ee4800ac7ded7f7102e | [
"MIT"
] | null | null | null | djpaypal/checks.py | SakuradaJun/dj-paypal-py27 | dabcccac4dc89c0d8a901ee4800ac7ded7f7102e | [
"MIT"
] | null | null | null |
VALID_MODES = ("live", "sandbox")
| 36.703704 | 94 | 0.687185 | from django.core import checks
from . import settings as djpaypal_settings
VALID_MODES = ("live", "sandbox")
@checks.register("djpaypal")
def check_paypal_api_key(app_configs=None, **kwargs):
"""Check that the Paypal API keys are configured correctly"""
messages = []
mode = getattr(djpaypal_settings, ... | 0 | 855 | 0 | 0 | 0 | 0 | 0 | 31 | 68 |
6974365ddb564f36667977a85d824e25b86f1949 | 60 | py | Python | test_response/clean_response.py | seungguini/DialoGPT | 6b89677496cc674fd5cf951c179e94d330292437 | [
"MIT"
] | null | null | null | test_response/clean_response.py | seungguini/DialoGPT | 6b89677496cc674fd5cf951c179e94d330292437 | [
"MIT"
] | null | null | null | test_response/clean_response.py | seungguini/DialoGPT | 6b89677496cc674fd5cf951c179e94d330292437 | [
"MIT"
] | null | null | null | # Script to clean response into one-response-per-line format | 60 | 60 | 0.816667 | # Script to clean response into one-response-per-line format | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eb433520bb82c6093df638cb8b32c5356357e2a6 | 189 | py | Python | gender_analysis/text/__init__.py | dhmit/gender_analysis | 4ed3e8733f2d078d88b50f8dbec218dfca269037 | [
"BSD-3-Clause"
] | 10 | 2019-07-21T21:57:35.000Z | 2022-01-11T16:13:08.000Z | gender_analysis/text/__init__.py | dhmit/gender_analysis | 4ed3e8733f2d078d88b50f8dbec218dfca269037 | [
"BSD-3-Clause"
] | 128 | 2019-06-18T15:33:29.000Z | 2021-09-24T19:55:03.000Z | gender_analysis/text/__init__.py | dhmit/gender_analysis | 4ed3e8733f2d078d88b50f8dbec218dfca269037 | [
"BSD-3-Clause"
] | 5 | 2020-10-01T23:53:17.000Z | 2021-10-05T22:15:12.000Z | __all__ = [
'character',
'common',
'corpus',
'document',
]
| 15.75 | 32 | 0.677249 | __all__ = [
'character',
'common',
'corpus',
'document',
]
from .common import *
from .character import Character
from .corpus import Corpus
from .document import Document
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 89 |
6cb70ee23fc97b9e1939ca4f205159bf17cd891e | 4,187 | py | Python | tests/test_api_plugins.py | edgardmota/vent | 67b01abc059a3e9e8d16670c7058f0a9e267d8f1 | [
"Apache-2.0"
] | null | null | null | tests/test_api_plugins.py | edgardmota/vent | 67b01abc059a3e9e8d16670c7058f0a9e267d8f1 | [
"Apache-2.0"
] | null | null | null | tests/test_api_plugins.py | edgardmota/vent | 67b01abc059a3e9e8d16670c7058f0a9e267d8f1 | [
"Apache-2.0"
] | null | null | null | import os
from vent.api.plugins import Plugin
from vent.api.templates import Template
def test_add():
""" Test the add function """
instance = Plugin()
status = instance.add('https://github.com/cyberreboot/vent', build=False)
assert isinstance(status, tuple)
assert status[0] == True
status = i... | 37.383929 | 134 | 0.669453 | import os
from vent.api.plugins import Plugin
from vent.api.templates import Template
def test_add():
""" Test the add function """
instance = Plugin()
status = instance.add('https://github.com/cyberreboot/vent', build=False)
assert isinstance(status, tuple)
assert status[0] == True
status = i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c46fe8755645ba4ac356bb9cf6d7090b64d2c00d | 146 | py | Python | utils/export.py | FilippoRanza/aps_location | 99d1caf11bfa7ad273202c966cdb397db2d5e0c3 | [
"MIT"
] | null | null | null | utils/export.py | FilippoRanza/aps_location | 99d1caf11bfa7ad273202c966cdb397db2d5e0c3 | [
"MIT"
] | null | null | null | utils/export.py | FilippoRanza/aps_location | 99d1caf11bfa7ad273202c966cdb397db2d5e0c3 | [
"MIT"
] | null | null | null | #! /usr/bin/python
| 16.222222 | 40 | 0.657534 | #! /usr/bin/python
import json
def export_results(file_name, **kwargs):
with open(file_name, "w") as file:
json.dump(kwargs, file)
| 0 | 0 | 0 | 0 | 0 | 90 | 0 | -10 | 46 |
2a405f90d24d3f3f09252b343e3ce35cb9485610 | 1,533 | py | Python | api.py | gajanlee/ZeusKnows3 | 8e22f7d0ca5b8c4563a6d975b1339a859b1268f6 | [
"MIT"
] | null | null | null | api.py | gajanlee/ZeusKnows3 | 8e22f7d0ca5b8c4563a6d975b1339a859b1268f6 | [
"MIT"
] | null | null | null | api.py | gajanlee/ZeusKnows3 | 8e22f7d0ca5b8c4563a6d975b1339a859b1268f6 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from aip import AipNlp
APP_ID = '10791703'
API_KEY = 'YNMY6eSAz6QlDCeM7KB9GKHC'
SECRET_KEY = 'tSqTt0OikFiYXVIt5kAXZyL0FdciRp5t'
client = AipNlp(APP_ID, API_KEY, SECRET_KEY)
def get_dependency(text):
"""
:param text: prepare to analysis the dependecy of tokens
:return word_list: a list ... | 33.326087 | 105 | 0.677104 | #!/usr/bin/python3
from aip import AipNlp
import numpy as np
APP_ID = '10791703'
API_KEY = 'YNMY6eSAz6QlDCeM7KB9GKHC'
SECRET_KEY = 'tSqTt0OikFiYXVIt5kAXZyL0FdciRp5t'
client = AipNlp(APP_ID, API_KEY, SECRET_KEY)
def get_wordEmbedding(word):
we = client.wordEmbedding(word)
return np.array(we['vec']) if 'vec' i... | 6 | 0 | 0 | 0 | 0 | 503 | 0 | -3 | 118 |
142d34a1e53c79b444c600d00c7d0aacde3c14d7 | 6,415 | py | Python | graphrole/features/extract.py | bingrao/GraphRole | 3439cd000e256e7b84159e7083debe7873fca61e | [
"MIT"
] | 60 | 2019-03-07T15:15:49.000Z | 2022-03-25T19:21:18.000Z | graphrole/features/extract.py | bingrao/GraphRole | 3439cd000e256e7b84159e7083debe7873fca61e | [
"MIT"
] | 5 | 2020-08-24T08:51:40.000Z | 2021-12-08T06:50:47.000Z | graphrole/features/extract.py | bingrao/GraphRole | 3439cd000e256e7b84159e7083debe7873fca61e | [
"MIT"
] | 17 | 2019-08-02T04:15:50.000Z | 2022-03-16T21:32:23.000Z |
import pandas as pd
from graphrole.types import DataFrameLike
# Helper functions
def as_frame(df_like: DataFrameLike) -> pd.DataFrame:
"""
Helper to safely cast a pd.Series to pd.DataFrame without throwing
an exception if input is already a pd.DataFrame
:param df_like: pd.Series or pd.DataFrame
... | 36.867816 | 85 | 0.647233 | from collections import ChainMap
from typing import Dict, List, Optional
import pandas as pd
from graphrole.features.prune import FeaturePruner
from graphrole.graph import interface
from graphrole.types import DataFrameDict, DataFrameLike
class RecursiveFeatureExtractor:
""" Compute recursive features for node... | 0 | 795 | 0 | 5,001 | 0 | 0 | 0 | 89 | 112 |
96d649293a96c10f012cd771d8121445d8ffd652 | 812 | py | Python | museum_site/migrations/0018_auto_20170816_0336.py | DrDos0016/z2 | b63e77129fefcb4f990ee1cb9952f4f708ee3a2b | [
"MIT"
] | 3 | 2017-05-01T19:53:57.000Z | 2018-08-27T20:14:43.000Z | museum_site/migrations/0018_auto_20170816_0336.py | asiekierka/z2 | d926408423dc98d71d5e7fc2fda3202c03c309de | [
"MIT"
] | 26 | 2020-02-11T22:10:43.000Z | 2022-02-03T20:54:08.000Z | museum_site/migrations/0018_auto_20170816_0336.py | asiekierka/z2 | d926408423dc98d71d5e7fc2fda3202c03c309de | [
"MIT"
] | 1 | 2018-08-27T20:14:46.000Z | 2018-08-27T20:14:46.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-08-16 03:36
from __future__ import unicode_literals
| 27.066667 | 96 | 0.598522 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-08-16 03:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0017_auto_20170415_0102'),
]
operations = [
migrations.Remov... | 0 | 0 | 0 | 633 | 0 | 0 | 0 | 19 | 46 |
fe2e86f70df87eaa47fdd63f89aff6dfc19a6360 | 6,403 | py | Python | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from random import random
import random
import webbrowser
import pyttsx3
import datetime
import wikipedia
import os
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice',voices[0].id)
"""def alarm():
Hh=int(input("set hour... | 28.584821 | 92 | 0.532875 | from datetime import datetime
from random import random
import random
import webbrowser
import pyttsx3
import datetime
import urllib.request
import re
import speech_recognition as sr
import wikipedia
import os
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice',voi... | 5 | 0 | 0 | 0 | 0 | 2,271 | 0 | -2 | 238 |
89568549dbff5a284e22d17c0fbc6208b8b7837f | 991 | py | Python | convex_api/tool/command/peer_command.py | luisriverag/convex-api-py | 193c0abff1ac5389d2d9032d944a2e8799136861 | [
"Apache-2.0"
] | null | null | null | convex_api/tool/command/peer_command.py | luisriverag/convex-api-py | 193c0abff1ac5389d2d9032d944a2e8799136861 | [
"Apache-2.0"
] | null | null | null | convex_api/tool/command/peer_command.py | luisriverag/convex-api-py | 193c0abff1ac5389d2d9032d944a2e8799136861 | [
"Apache-2.0"
] | 1 | 2021-05-04T04:59:15.000Z | 2021-05-04T04:59:15.000Z | """
Command peer
"""
| 24.775 | 72 | 0.621594 | """
Command peer
"""
from .command_base import CommandBase
from .help_command import HelpCommand
from .peer_create_command import PeerCreateCommand
class PeerCommand(CommandBase):
def __init__(self, sub_parser=None):
self._command_list = []
super().__init__('peer', sub_parser)
def cre... | 0 | 0 | 0 | 812 | 0 | 0 | 0 | 61 | 90 |
6e4a27ad0c729c08d3a53b69c7c8abdaa40481b6 | 36,427 | py | Python | SBaaS_quantification/stage01_quantification_peakInformation_io.py | dmccloskey/SBaaS_quantification | b2a9c7a9a0d318f22ff20e311f94c213852ba914 | [
"MIT"
] | null | null | null | SBaaS_quantification/stage01_quantification_peakInformation_io.py | dmccloskey/SBaaS_quantification | b2a9c7a9a0d318f22ff20e311f94c213852ba914 | [
"MIT"
] | null | null | null | SBaaS_quantification/stage01_quantification_peakInformation_io.py | dmccloskey/SBaaS_quantification | b2a9c7a9a0d318f22ff20e311f94c213852ba914 | [
"MIT"
] | null | null | null | # System
# SBaaS
# Resources
| 59.716393 | 374 | 0.587037 | # System
import json,re
# SBaaS
from .stage01_quantification_peakInformation_query import stage01_quantification_peakInformation_query
from .stage01_quantification_MQResultsTable_query import stage01_quantification_MQResultsTable_query
# Resources
from io_utilities.base_importData import base_importData
from io_utilit... | 3 | 0 | 0 | 35,879 | 0 | 0 | 0 | 316 | 199 |
213ea17a6e3e233293f1b25f2c7e3c486ad0932a | 28,781 | py | Python | matilda/fundamental_analysis/financial_statements/balance_sheet.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 45 | 2021-01-28T04:12:21.000Z | 2022-02-24T13:15:50.000Z | matilda/fundamental_analysis/financial_statements/balance_sheet.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 32 | 2021-03-02T18:45:16.000Z | 2022-03-12T00:53:10.000Z | matilda/fundamental_analysis/financial_statements/balance_sheet.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 10 | 2020-12-25T15:02:40.000Z | 2021-12-30T11:40:15.000Z | """
Balance Sheet Entries
"""
from datetime import timedelta
from matilda.data_pipeline.db_crud import read_financial_statement_entry
def cash_and_cash_equivalents(stock, date=None, lookback_period: timedelta = timedelta(days=0), period: str = 'Q'):
"""
**Cash and Cash Equivalents** is the amount of money on... | 65.710046 | 180 | 0.594663 | """
Balance Sheet Entries
"""
from datetime import timedelta
from matilda import config
from matilda.data_pipeline.db_crud import read_financial_statement_entry, companies_in_classification
def cash_and_cash_equivalents(stock, date=None, lookback_period: timedelta = timedelta(days=0), period: str = 'Q'):
"""
... | 0 | 0 | 0 | 0 | 0 | 22,621 | 0 | 34 | 1,104 |
2220eb562017f377eebd9616b61b5042760d0593 | 4,130 | py | Python | Communication/SerialCommunication.py | UncleBench/PREN2 | 039077e098ea97bc5e21b85e35df858d6c33f55d | [
"MIT"
] | null | null | null | Communication/SerialCommunication.py | UncleBench/PREN2 | 039077e098ea97bc5e21b85e35df858d6c33f55d | [
"MIT"
] | null | null | null | Communication/SerialCommunication.py | UncleBench/PREN2 | 039077e098ea97bc5e21b85e35df858d6c33f55d | [
"MIT"
] | null | null | null | import serial
ANGLE_ERROR_CODE = 65535 # -1 signed int
if __name__ == '__main__':
arduino = SerialCommunication('COM3', 9600)
arduino.setGrabber(GrabberState.CLOSE)
print arduino.getRawBeta(), arduino.getRawAlpha() | 28.287671 | 89 | 0.564407 | import serial
ANGLE_ERROR_CODE = 65535 # -1 signed int
class CommException(Exception):
pass
class StopState:
RUNNING = 0
STOP = 1
class SerialCommunication:
def __init__(self, com, baud=115200):
"""
Args:
com (String): Arduino Comport
baud (int): Baudrate
... | 0 | 0 | 0 | 3,832 | 0 | 0 | 0 | 0 | 69 |
d263993c14dfee5fd37e7db7f5ae2dca8b68c651 | 3,088 | py | Python | excut/embedding/ampligraph_extend/model_utils.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | 5 | 2020-11-17T19:59:49.000Z | 2021-09-23T23:10:39.000Z | excut/embedding/ampligraph_extend/model_utils.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | null | null | null | excut/embedding/ampligraph_extend/model_utils.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | null | null | null | import importlib
import pickle
import glob
from excut.utils.logging import logger
def restore_model(model_name_path=None, module_name="ampligraph.latent_features"):
"""Restore a saved model from disk.
See also :meth:`save_model`.
Parameters
----------
model_name_path: string
... | 30.574257 | 84 | 0.632124 | import importlib
import pickle
import glob
from excut.utils.logging import logger
def restore_model(model_name_path=None, module_name="ampligraph.latent_features"):
"""Restore a saved model from disk.
See also :meth:`save_model`.
Parameters
----------
model_name_path: string
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e7e7f051ce7389716e3b71e792a245dcae7cd10 | 5,975 | py | Python | bjorg.fr.py | mic100/Food_Recipes | fcb11f8c8d06ef5bc6d4b1699557f7174c48ac8b | [
"MIT"
] | 1 | 2022-01-16T03:16:30.000Z | 2022-01-16T03:16:30.000Z | bjorg.fr.py | Oakesso/Food_Recipes | fcb11f8c8d06ef5bc6d4b1699557f7174c48ac8b | [
"MIT"
] | null | null | null | bjorg.fr.py | Oakesso/Food_Recipes | fcb11f8c8d06ef5bc6d4b1699557f7174c48ac8b | [
"MIT"
] | 1 | 2022-01-16T03:15:18.000Z | 2022-01-16T03:15:18.000Z | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------#
# Import Librairies #
#-----------------------------------------------------------------------------#
import tool_kit as tk
#--------------------------------... | 44.259259 | 83 | 0.331381 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------#
# Import Librairies #
#-----------------------------------------------------------------------------#
import tool_kit as tk
#--------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
37db107adc28519126aa51faefbddeaeba4c32b7 | 3,309 | py | Python | DimationReduction.py | shalev-habany/Introduction-to-AI | 388bdd358f9e9b6beb09c20d79ade7938c7dbecd | [
"MIT"
] | null | null | null | DimationReduction.py | shalev-habany/Introduction-to-AI | 388bdd358f9e9b6beb09c20d79ade7938c7dbecd | [
"MIT"
] | null | null | null | DimationReduction.py | shalev-habany/Introduction-to-AI | 388bdd358f9e9b6beb09c20d79ade7938c7dbecd | [
"MIT"
] | null | null | null |
dataPath = r"C:\Users\shalev\Desktop\Introduction_to_AI\Introduction-to-AI\Data\mushrooms_data.csv"
reducedDataPath = r"C:\Users\shalev\Desktop\Introduction_to_AI\Introduction-to-AI\Data\reduced_data.csv"
# if __name__ == '__main__':
# # 28 saves 93% explained variance of the data
# dr = DimantionReduction(... | 41.3625 | 104 | 0.667573 | import preprocess
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import pandas as pd
import plotly.express as px
from sklearn.decomposition import FastICA
import matplotlib.pyplot as plt
import numpy as np
dataPath = r"C:\Users\shalev\Desktop\Introduction_to_AI\Introduction-to-A... | 0 | 0 | 0 | 2,620 | 0 | 0 | 0 | 70 | 199 |
a2c8a89002fa14a18334c9ff9b81f0f6218ace23 | 16,770 | py | Python | cinder/tests/test_v6000_fcp_with_mock.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_v6000_fcp_with_mock.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | 1 | 2021-01-12T23:22:22.000Z | 2021-01-12T23:22:22.000Z | cinder/tests/test_v6000_fcp_with_mock.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 38.819444 | 79 | 0.643113 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 0 | 3,046 | 0 | 11,360 | 0 | 0 | 0 | 132 | 180 |
05e3f35b6f81e3fa37ea72b46e2d38a19e1b9221 | 33 | py | Python | third-party/llvm/llvm-src/utils/lit/tests/Inputs/allow-retries/does-not-succeed-within-limit.py | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | third-party/llvm/llvm-src/utils/lit/tests/Inputs/allow-retries/does-not-succeed-within-limit.py | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | third-party/llvm/llvm-src/utils/lit/tests/Inputs/allow-retries/does-not-succeed-within-limit.py | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | # ALLOW_RETRIES: 3
# RUN: false
| 8.25 | 18 | 0.666667 | # ALLOW_RETRIES: 3
# RUN: false
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25e360bea747f09bd9a02d4959f00bea3cfc0d74 | 1,630 | py | Python | assignments/testem.py | hughsw/PythonEtc | cfc30b1df6a62d7e6f51fefe97906de8ade7f65f | [
"Apache-2.0"
] | null | null | null | assignments/testem.py | hughsw/PythonEtc | cfc30b1df6a62d7e6f51fefe97906de8ade7f65f | [
"Apache-2.0"
] | null | null | null | assignments/testem.py | hughsw/PythonEtc | cfc30b1df6a62d7e6f51fefe97906de8ade7f65f | [
"Apache-2.0"
] | null | null | null | """
From: https://taxfoundation.org/2017-tax-brackets/
Rate |Taxable Income Bracket |Tax Owed
:--- |:--------------------- |:--------
10% |$0 to $9,325 |10% of Taxable Income
15% |$9,325 to $37,950 |$932.50 plus 15% of the excess over $9325
25% |$37,950 to $91,900 |$5,226.25 p... | 20.897436 | 84 | 0.552147 | """
From: https://taxfoundation.org/2017-tax-brackets/
Rate |Taxable Income Bracket |Tax Owed
:--- |:--------------------- |:--------
10% |$0 to $9,325 |10% of Taxable Income
15% |$9,325 to $37,950 |$932.50 plus 15% of the excess over $9325
25% |$37,950 to $91,900 |$5,226.25 p... | 0 | 0 | 0 | 0 | 0 | 17 | 0 | 4 | 53 |
0cd08f0aab1f3212412b91ebee56cac2991d0d9e | 887 | py | Python | hard-gists/2438871/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/2438871/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/2438871/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | '''
This is how to track a white ball example using SimpleCV
The parameters may need to be adjusted to match the RGB color
of your object.
The demo video can be found at:
http://www.youtube.com/watch?v=jihxqg3kr-g
'''
print __doc__
import SimpleCV
display = SimpleCV.Display()
cam = SimpleCV.Camera()
normaldisplay =... | 23.972973 | 93 | 0.728298 | '''
This is how to track a white ball example using SimpleCV
The parameters may need to be adjusted to match the RGB color
of your object.
The demo video can be found at:
http://www.youtube.com/watch?v=jihxqg3kr-g
'''
print __doc__
import SimpleCV
display = SimpleCV.Display()
cam = SimpleCV.Camera()
normaldisplay =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
19bab6ca0a9b906c3cc20ade56860a6eeff7d443 | 2,730 | py | Python | ci/check_airgap_images.py | InfuseAI/primehub | 9e6307c86c30a1217f8e9bbcf83430eb521f0950 | [
"Apache-2.0"
] | 294 | 2019-04-02T13:09:26.000Z | 2022-03-30T09:09:49.000Z | ci/check_airgap_images.py | 3r1ccc/primehub | 72949ff4ce0f83f3ecd99ca6edfe2361b698396a | [
"Apache-2.0"
] | 206 | 2019-04-09T08:41:28.000Z | 2022-03-30T01:28:19.000Z | ci/check_airgap_images.py | 3r1ccc/primehub | 72949ff4ce0f83f3ecd99ca6edfe2361b698396a | [
"Apache-2.0"
] | 26 | 2019-04-16T20:53:12.000Z | 2022-03-10T12:37:16.000Z | import sys
if __name__ == '__main__':
images, bootstrap_crds, phapptemplates_dir = sys.argv[1:]
section("Inputs")
print("images.yaml => {}".format(images))
print("crds.yaml => {}".format(bootstrap_crds))
print("ph-app-templates => {}".format(phapptemplates_dir))
main(images, bootstrap_... | 31.744186 | 90 | 0.639194 | import sys
import re
import os
def section(title):
print("\n{}".format("=" * 24))
print("{}".format(title))
print("{}".format("=" * 24))
def load(f):
with open(f, "r") as fh:
return fh.read()
def check_notebook_images(all_images, bootstrap_crds):
section("crds.yaml")
image_crds = l... | 0 | 0 | 0 | 0 | 0 | 2,154 | 0 | -24 | 205 |
b1376c82a05251fe02da7708b845cee22d2f820a | 105 | py | Python | function.py | alihussainia/Py2Exe-Converter | a073bf53cc47d385ea0b2bbfe4a7ab569f98b83f | [
"Apache-2.0"
] | 4 | 2021-08-09T06:54:16.000Z | 2021-08-11T10:33:56.000Z | function.py | alihussainia/Py2Exe-Converter | a073bf53cc47d385ea0b2bbfe4a7ab569f98b83f | [
"Apache-2.0"
] | null | null | null | function.py | alihussainia/Py2Exe-Converter | a073bf53cc47d385ea0b2bbfe4a7ab569f98b83f | [
"Apache-2.0"
] | 1 | 2021-08-10T09:39:52.000Z | 2021-08-10T09:39:52.000Z | from py2exe_converter.converter import convert
convert('example.py', 'requirements.txt', 'icon_one.png') | 35 | 57 | 0.8 | from py2exe_converter.converter import convert
convert('example.py', 'requirements.txt', 'icon_one.png') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f0d170758b889f177a847af5b34dc5f417b1565f | 9,835 | py | Python | methylprep/processing/raw_dataset.py | holonomicjl/methylprep | 6a503263ae4399a25e13238a6e4890d891f4dec9 | [
"MIT"
] | 1 | 2021-04-08T22:10:55.000Z | 2021-04-08T22:10:55.000Z | methylprep/processing/raw_dataset.py | holonomicjl/methylprep | 6a503263ae4399a25e13238a6e4890d891f4dec9 | [
"MIT"
] | null | null | null | methylprep/processing/raw_dataset.py | holonomicjl/methylprep | 6a503263ae4399a25e13238a6e4890d891f4dec9 | [
"MIT"
] | null | null | null | # Lib
import logging
# App
from collections import Counter
__all__ = ['RawDataset', 'RawMetaDataset', 'get_raw_datasets', 'get_raw_meta_datasets', 'get_array_type']
LOGGER = logging.getLogger(__name__)
def get_raw_datasets(sample_sheet, sample_name=None, from_s3=None, meta_only=False):
"""Generates a collectio... | 39.183267 | 128 | 0.676462 | # Lib
import logging
import pandas as pd
# App
from ..models import (
FG_PROBE_SUBSETS,
ArrayType,
Channel,
ProbeType,
)
from ..files import IdatDataset
from ..utils import inner_join_data
from ..utils.progress_bar import * # checks environment and imports tqdm appropriately.
from collections import Cou... | 0 | 741 | 0 | 5,281 | 0 | 0 | 0 | 103 | 209 |
df3f5721586160468a4db0fdd47d0198d2ca3fb3 | 2,852 | py | Python | Kernel.py | annaromanova/python | 58f514bd807771bd1092c0e9e94dd8ca6b2a93b1 | [
"MIT"
] | null | null | null | Kernel.py | annaromanova/python | 58f514bd807771bd1092c0e9e94dd8ca6b2a93b1 | [
"MIT"
] | null | null | null | Kernel.py | annaromanova/python | 58f514bd807771bd1092c0e9e94dd8ca6b2a93b1 | [
"MIT"
] | null | null | null |
import numpy as np
# Simple kernel
# Do not change these three lines.
data = np.loadtxt("data.csv", delimiter=',')
X = data[:, :2]
Y = data[:, 2]
# These are the parameters for the models. Please play with these and note your observations about speed and successful hyperplane formation.
beta = 0
N = 10
numsam... | 23.766667 | 171 | 0.674965 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as c
from Perceptron import Perceptron
# Simple kernel
def K(x_i, x_j):
return np.dot(x_i, x_j)
class KernelPerceptron(Perceptron):
def __init__(self, numsamples):
self.S = {}
self.numsamples = numsamples
def __calculate_y_hat(sel... | 0 | 0 | 0 | 1,795 | 0 | 20 | 0 | 30 | 134 |
df47de176b21634f656c2ae6036c73b7e6e48cea | 354 | py | Python | setup.py | aarongolliver/asyncirc | e72a3902d581de778b5859fe44ecb9a8178d4698 | [
"MIT"
] | 1 | 2015-12-15T14:27:35.000Z | 2015-12-15T14:27:35.000Z | setup.py | aarongolliver/asyncirc | e72a3902d581de778b5859fe44ecb9a8178d4698 | [
"MIT"
] | null | null | null | setup.py | aarongolliver/asyncirc | e72a3902d581de778b5859fe44ecb9a8178d4698 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name="asyncio-irc",
version="0.2.1",
description="irc based on asyncio",
author="Fox Wilson",
author_email="fwilson@fwilson.me",
url="https://github.com/watchtower/asyncirc",
install_requires=["blinker"],
packages=[... | 27.230769 | 53 | 0.612994 | from distutils.core import setup
setup(
name="asyncio-irc",
version="0.2.1",
description="irc based on asyncio",
author="Fox Wilson",
author_email="fwilson@fwilson.me",
url="https://github.com/watchtower/asyncirc",
install_requires=["blinker"],
packages=[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d62cce998f67f712ed45afaab67fa6db7cf13184 | 4,796 | py | Python | tests/generate_new_site/site_data_structs/test_site.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | 1 | 2020-10-01T01:07:11.000Z | 2020-10-01T01:07:11.000Z | tests/generate_new_site/site_data_structs/test_site.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | null | null | null | tests/generate_new_site/site_data_structs/test_site.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | null | null | null |
################
# Test write() #
################
# Mock it with itself just so we can get a count
######################
# Test update_href() #
######################
# Integration test for all update_href methods in site.py
| 33.305556 | 103 | 0.59779 | from unittest import mock
from unittest.mock import patch
from src.generate_new_site.site_data_structs import site
from pathlib import Path
################
# Test write() #
################
@patch('jinja2.Template.render')
@patch('src.generate_new_site.site_data_structs.site.Index.update_href')
def test_index_writ... | 0 | 3,445 | 0 | 0 | 0 | 861 | 0 | 52 | 201 |
23757e23b01d9932d8204bfeb2e156a42fed3787 | 776 | py | Python | beginner-codes/simple_division.py | kinster007/beginner-python-codes | 1660e1dd56896fe3e5dfffc59975bf3b9b6925a4 | [
"MIT"
] | null | null | null | beginner-codes/simple_division.py | kinster007/beginner-python-codes | 1660e1dd56896fe3e5dfffc59975bf3b9b6925a4 | [
"MIT"
] | null | null | null | beginner-codes/simple_division.py | kinster007/beginner-python-codes | 1660e1dd56896fe3e5dfffc59975bf3b9b6925a4 | [
"MIT"
] | null | null | null | """
fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0 and 1). Complete the body of the function so that it returns the right number. Note: Since division by 0 produces an error, if the denominator is 0, the function should return 0 instead of at... | 43.111111 | 338 | 0.735825 | """
fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0 and 1). Complete the body of the function so that it returns the right number. Note: Since division by 0 produces an error, if the denominator is 0, the function should return 0 instead of at... | 0 | 0 | 0 | 0 | 0 | 125 | 0 | 0 | 25 |
a70d60d4f705c5e3e8dfba58834a2fd7997dcf09 | 901 | py | Python | openvpp-agents/setup.py | mtroeschel/isaac | 47eabfd5a91a61dfe94babe6537ff69d7d18ecd8 | [
"MIT"
] | 8 | 2018-02-09T11:59:09.000Z | 2021-12-02T16:49:48.000Z | openvpp-agents/setup.py | mtroeschel/isaac | 47eabfd5a91a61dfe94babe6537ff69d7d18ecd8 | [
"MIT"
] | null | null | null | openvpp-agents/setup.py | mtroeschel/isaac | 47eabfd5a91a61dfe94babe6537ff69d7d18ecd8 | [
"MIT"
] | 3 | 2018-06-05T18:53:07.000Z | 2020-10-27T20:25:57.000Z | from setuptools import setup, find_packages
setup(
name='openvpp-agents',
version='0.1.0',
author='Martin Trschel',
author_email='martin.troeschel@gmail.com',
description=('The Open VPP multi-agent system'),
# long_description=(open('README.txt').read() + '\n\n' +
# open(... | 28.15625 | 64 | 0.54384 | from setuptools import setup, find_packages
setup(
name='openvpp-agents',
version='0.1.0',
author='Martin Tröschel',
author_email='martin.troeschel@gmail.com',
description=('The Open VPP multi-agent system'),
# long_description=(open('README.txt').read() + '\n\n' +
# open... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
acccaadb9f49197ad547c179cec6a19cf713260f | 892 | py | Python | setup.py | wieden-kennedy/haikus | da3d6674a7e0740279cf3b123dcb756c314d9494 | [
"BSD-3-Clause"
] | 9 | 2016-09-09T19:29:42.000Z | 2022-01-25T07:53:26.000Z | setup.py | wieden-kennedy/haikus | da3d6674a7e0740279cf3b123dcb756c314d9494 | [
"BSD-3-Clause"
] | null | null | null | setup.py | wieden-kennedy/haikus | da3d6674a7e0740279cf3b123dcb756c314d9494 | [
"BSD-3-Clause"
] | 5 | 2016-05-07T15:19:25.000Z | 2020-11-27T19:58:32.000Z | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
setup(
name="haikus",
description="Some classes for finding haikus in text",
author="Grant Thomas",
author_email="grant.thomas@wk.com",
url="https://g... | 29.733333 | 71 | 0.646861 | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
setup(
name="haikus",
description="Some classes for finding haikus in text",
author="Grant Thomas",
author_email="grant.thomas@wk.com",
url="https://g... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c4e86fcd0e1f7b39cea3e866ebf888841e43cff | 9,419 | py | Python | perform_gwas/gwas.py | grimmlab/permGWAS | d40b198c34cb2a7d8fdae82c4bdeec90af624053 | [
"MIT"
] | null | null | null | perform_gwas/gwas.py | grimmlab/permGWAS | d40b198c34cb2a7d8fdae82c4bdeec90af624053 | [
"MIT"
] | null | null | null | perform_gwas/gwas.py | grimmlab/permGWAS | d40b198c34cb2a7d8fdae82c4bdeec90af624053 | [
"MIT"
] | null | null | null | # perform gwas, use sub functions
import argparse
import torch
import numpy as np
from itertools import repeat
from perform_gwas import model, kin, perm
from preprocessing import load_files, prepare_data
import time
def gwas(arguments: argparse.Namespace, X: torch.tensor, y: torch.tensor, K: torch.tensor, covs: torch... | 50.913514 | 122 | 0.641151 | # perform gwas, use sub functions
import argparse
import torch
import numpy as np
from itertools import repeat
from perform_gwas import model, kin, perm
from preprocessing import load_files, prepare_data
import time
def gwas(arguments: argparse.Namespace, X: torch.tensor, y: torch.tensor, K: torch.tensor, covs: torch... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9228c3bc6c4b44dd29a64795186117910eaf6856 | 587 | py | Python | docker/build/face_detection/face_detector/test.py | solderzzc/DeepCamera | a415f6b62901c23c158a946ff86a5ef2063e1b24 | [
"MIT"
] | 2 | 2019-08-21T01:56:01.000Z | 2019-10-26T10:19:15.000Z | docker/build/face_detection/face_detector/test.py | solderzzc/DeepCamera | a415f6b62901c23c158a946ff86a5ef2063e1b24 | [
"MIT"
] | null | null | null | docker/build/face_detection/face_detector/test.py | solderzzc/DeepCamera | a415f6b62901c23c158a946ff86a5ef2063e1b24 | [
"MIT"
] | 4 | 2019-08-21T01:56:09.000Z | 2020-04-29T14:51:21.000Z | import face_detection as m
import time
m.init('./models/ncnn/')
print('warming up')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
start = time.time()
for i in range... | 26.681818 | 65 | 0.705281 | import face_detection as m
import time
m.init('./models/ncnn/')
print('warming up')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
start = time.time()
for i in range... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cad70fcdf46fab26d26aca87875a510488dac36c | 820 | py | Python | setup.py | l3gacyb3ta/corgi | 6d4588ee239655a75357d48f407152fd0c0458d9 | [
"Unlicense"
] | 1 | 2022-01-22T17:29:02.000Z | 2022-01-22T17:29:02.000Z | setup.py | l3gacyb3ta/corgi | 6d4588ee239655a75357d48f407152fd0c0458d9 | [
"Unlicense"
] | null | null | null | setup.py | l3gacyb3ta/corgi | 6d4588ee239655a75357d48f407152fd0c0458d9 | [
"Unlicense"
] | null | null | null | from setuptools import setup, find_packages
with open('requirements.txt') as f:
requirements = f.readlines()
with open('README.md') as f:
long_description = f.read()
setup(
name ='corgi-cli',
version ='1.0.0',
author ='Raleigh Wise',
author_email ='vibhu4agarwal@gmail.com',
url ='https://github.com/l3ga... | 24.848485 | 49 | 0.693902 | from setuptools import setup, find_packages
with open('requirements.txt') as f:
requirements = f.readlines()
with open('README.md') as f:
long_description = f.read()
setup(
name ='corgi-cli',
version ='1.0.0',
author ='Raleigh Wise',
author_email ='vibhu4agarwal@gmail.com',
url ='https://github.com/l3ga... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1bda55486c984f946877843f1b5fd0c1729e793 | 448 | py | Python | multichat/multichat/urls.py | AChubatova/channels-examples | 6d9455d869fad943c90f96be4b45e7352f3d46b7 | [
"BSD-3-Clause"
] | null | null | null | multichat/multichat/urls.py | AChubatova/channels-examples | 6d9455d869fad943c90f96be4b45e7352f3d46b7 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T23:39:59.000Z | 2021-06-10T23:39:59.000Z | multichat/multichat/urls.py | AChubatova/channels-examples | 6d9455d869fad943c90f96be4b45e7352f3d46b7 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import login, logout
from chat.views import index
urlpatterns = [
url(r'^$', index),
url(r'^accounts/login/$', login),
url(r'^account... | 29.866667 | 67 | 0.736607 | from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import login, logout
from chat.views import index
urlpatterns = [
url(r'^$', index),
url(r'^accounts/login/$', login),
url(r'^account... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53b886370b42170c16f719380aecd67727526e44 | 225 | py | Python | Exercicio_em_python/Soma_Impares.py | EduardoSlonzo/python_project | f6d9884c3dc1b37f20243c7c43a7846ccca2b6aa | [
"MIT"
] | null | null | null | Exercicio_em_python/Soma_Impares.py | EduardoSlonzo/python_project | f6d9884c3dc1b37f20243c7c43a7846ccca2b6aa | [
"MIT"
] | null | null | null | Exercicio_em_python/Soma_Impares.py | EduardoSlonzo/python_project | f6d9884c3dc1b37f20243c7c43a7846ccca2b6aa | [
"MIT"
] | 1 | 2021-02-23T18:51:52.000Z | 2021-02-23T18:51:52.000Z | print("Digite dois numeros: ")
x = int(input())
y = int(input())
if x > y:
troca = x
x = y
y = troca
soma = 0
for i in range(x, y):
if i % 2 != 0:
soma = soma + i
print(f"Soma dos impares = {soma}") | 15 | 35 | 0.506667 | print("Digite dois numeros: ")
x = int(input())
y = int(input())
if x > y:
troca = x
x = y
y = troca
soma = 0
for i in range(x, y):
if i % 2 != 0:
soma = soma + i
print(f"Soma dos impares = {soma}") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7f19c8684a3df61b865edc847cb2fe8a31ebe1db | 6,038 | py | Python | energyusage/report.py | thegreenwebfoundation/energy-usage | e3db58ca48b05b874d64a07da1fec666972b041b | [
"Apache-2.0"
] | 1 | 2020-02-04T22:05:25.000Z | 2020-02-04T22:05:25.000Z | energyusage/report.py | thegreenwebfoundation/energy-usage | e3db58ca48b05b874d64a07da1fec666972b041b | [
"Apache-2.0"
] | null | null | null | energyusage/report.py | thegreenwebfoundation/energy-usage | e3db58ca48b05b874d64a07da1fec666972b041b | [
"Apache-2.0"
] | null | null | null | from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
import energyusage.convert as convert
year = "2016"
styles... | 41.07483 | 123 | 0.592912 | from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_RIGHT, TA_CENTER
from reportlab.lib import colors... | 0 | 0 | 0 | 0 | 0 | 748 | 0 | 60 | 90 |
5f83a19ad5e1d78c43eaca9999eab13073f4b2d9 | 487 | py | Python | basics/_027_celery_with_redis_django2/hackermonn/django_with_celery/api/views.py | Haldir65/Jimmy | 53ca49cdf25482c515f6058b7c2a9c1f611e2e5f | [
"Apache-2.0"
] | null | null | null | basics/_027_celery_with_redis_django2/hackermonn/django_with_celery/api/views.py | Haldir65/Jimmy | 53ca49cdf25482c515f6058b7c2a9c1f611e2e5f | [
"Apache-2.0"
] | null | null | null | basics/_027_celery_with_redis_django2/hackermonn/django_with_celery/api/views.py | Haldir65/Jimmy | 53ca49cdf25482c515f6058b7c2a9c1f611e2e5f | [
"Apache-2.0"
] | null | null | null |
# Create your views here.
| 27.055556 | 60 | 0.755647 | from django.shortcuts import render
# Create your views here.
from rest_framework.views import APIView
from rest_framework.response import Response
class BuildTrigger(APIView):
def post(self, request):
# build_something() # This would take 1 minute to finish
build_something.apply_async()
return Response(... | 0 | 94 | 0 | 167 | 0 | 0 | 0 | 65 | 133 |
31b84bf6f2b610fe9cc0b173d7232d43f0351245 | 20,500 | py | Python | core/views.py | mcflydesigner/innorussian | 70bec97ad349f340bd66cd8234d94f8829540397 | [
"MIT"
] | 1 | 2021-04-12T18:54:37.000Z | 2021-04-12T18:54:37.000Z | core/views.py | mcflydesigner/InnoRussian | 70bec97ad349f340bd66cd8234d94f8829540397 | [
"MIT"
] | null | null | null | core/views.py | mcflydesigner/InnoRussian | 70bec97ad349f340bd66cd8234d94f8829540397 | [
"MIT"
] | null | null | null | from django.db.models import (Q, Case, When, PositiveIntegerField)
from .models import (TypesOfCard)
"""
Options for user to sort the cards on the page with cards, possible options:
1) 'DD' - cards that are showed by the ID of the cards in decreasing order
2) 'W'- firstly show card which have type `wo... | 37.408759 | 102 | 0.630049 | from django.shortcuts import render
from django.views import View
from django.views.generic.list import ListView
from django.http import JsonResponse
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.db.models import (Q, F, Case, When, PositiveInt... | 0 | 210 | 0 | 15,492 | 0 | 0 | 0 | 321 | 427 |
e9ad81c4c538882d28909a68e6aa1ce952d90d32 | 487 | py | Python | users/urls.py | Subham-Mishra/Algoscale_Task_Repo | 845fdbf86c7d0131c77a915cbf293e2b4adf9482 | [
"MIT"
] | null | null | null | users/urls.py | Subham-Mishra/Algoscale_Task_Repo | 845fdbf86c7d0131c77a915cbf293e2b4adf9482 | [
"MIT"
] | null | null | null | users/urls.py | Subham-Mishra/Algoscale_Task_Repo | 845fdbf86c7d0131c77a915cbf293e2b4adf9482 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('signup_page/',views.signuppage,name='signup_page'),
path('login_page/',views.loginpage,name='login_page'),
path('login/',views.handleLogin,name='login'),
path('logout/',views.handleLogout,nam... | 34.785714 | 61 | 0.696099 | from django.contrib import admin
from django.urls import path,include
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('signup_page/',views.signuppage,name='signup_page'),
path('login_page/',views.loginpage,name='login_page'),
path('login/',views.handleLogin,name='login'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 22 |
17e42364cfd203efdab5e0f7b61e6b6b3fabf62c | 1,875 | py | Python | tf/app.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | null | null | null | tf/app.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | null | null | null | tf/app.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | null | null | null | """
Make use of a corpus.
The advanced-API provides extra functionality of top of the core of TF.
The most notable things are downloading corpus data and methods for (pretty)
display corpus material.
The real power of the advanced API is unleashed when there are well-tuned configuration
settings for a corpus, and pos... | 26.785714 | 87 | 0.648533 | """
Make use of a corpus.
The advanced-API provides extra functionality of top of the core of TF.
The most notable things are downloading corpus data and methods for (pretty)
display corpus material.
The real power of the advanced API is unleashed when there are well-tuned configuration
settings for a corpus, and pos... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
807e744833005fd27dc5576bc97eed3a839456b7 | 19,391 | py | Python | MDEQ-Vision/lib/models/mdeq_core.py | ashwinipokle/deq | 955560601ac7b9dd3088e918850efd9ba14b7610 | [
"MIT"
] | 548 | 2019-09-05T04:25:21.000Z | 2022-03-22T01:49:35.000Z | MDEQ-Vision/lib/models/mdeq_core.py | jerryniu520126/deq | 5c0699087d8c5e058539a5ec0c6c6a863ed06a3c | [
"MIT"
] | 21 | 2019-10-04T16:36:05.000Z | 2022-03-24T02:20:28.000Z | MDEQ-Vision/lib/models/mdeq_core.py | jerryniu520126/deq | 5c0699087d8c5e058539a5ec0c6c6a863ed06a3c | [
"MIT"
] | 75 | 2019-09-05T22:40:32.000Z | 2022-03-31T09:40:44.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
sys.path.append("lib/")
sys.path.append("../")
BN_MOMENTUM = 0.1
BLOCK_GN_AFFIN... | 41.611588 | 142 | 0.610283 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import logging
import functools
from termcolor import colored
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
im... | 0 | 0 | 0 | 17,892 | 0 | 0 | 0 | 191 | 413 |
d2b0bc8fda39975a11d1e4c27089ada47b94991d | 2,345 | py | Python | tts/api.py | jphacks/C_2113 | d921e4b783aecc724110732b6ebfb98b1c54f02c | [
"MIT"
] | null | null | null | tts/api.py | jphacks/C_2113 | d921e4b783aecc724110732b6ebfb98b1c54f02c | [
"MIT"
] | null | null | null | tts/api.py | jphacks/C_2113 | d921e4b783aecc724110732b6ebfb98b1c54f02c | [
"MIT"
] | null | null | null | import base64
import numpy as np
import subprocess as sp
from playsound import playsound
# copy from https://qiita.com/to_obara/items/d8d5c92c2ea85a197e2d
def get_token() -> str:
"""
Google Text-To-Speechgcloud
tokengcloud auth print-access-token
"""
res = sp.run('gcloud auth application-default print-... | 22.990196 | 67 | 0.611087 | import base64
import numpy as np
import urllib.request
import json
import subprocess as sp
from playsound import playsound
# copy from https://qiita.com/to_obara/items/d8d5c92c2ea85a197e2d
def get_token() -> str:
"""
Google Text-To-Speechの認証した上で、gcloudをセットアップした状態で
tokenを取得するために、gcloud auth print-access-tok... | 468 | 0 | 0 | 0 | 0 | 745 | 0 | -10 | 68 |
61df1978417d686d6a7b257685bc3dd5faf1db38 | 3,454 | py | Python | addressapp/api/address.py | AbhiyantrikTechnology/DentalHub-Backend | 89802b3e7671ffe8b3d287a998c3c4f375b58f03 | [
"MIT"
] | 1 | 2021-04-03T19:57:32.000Z | 2021-04-03T19:57:32.000Z | addressapp/api/address.py | AbhiyantrikTechnology/DentalHub-Backend | 89802b3e7671ffe8b3d287a998c3c4f375b58f03 | [
"MIT"
] | null | null | null | addressapp/api/address.py | AbhiyantrikTechnology/DentalHub-Backend | 89802b3e7671ffe8b3d287a998c3c4f375b58f03 | [
"MIT"
] | null | null | null |
# class MunicipalityList(APIView):
# permission_classes = (IsPostOrIsAuthenticated,)
# serializer_class = AddressSerializer
# def get(self, request, district,format=None):
# address_obj = Address.objects.filter(district=district)
# serializer = AddressSerializer(address_obj, many=True, \
... | 42.121951 | 192 | 0.686161 | from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import permissions
from addressapp.serializers.address import DistrictSerializer,MunicipalitySerializer,\
WardSerializer,WardSerializerUpdate
from addressapp.models import Address... | 0 | 0 | 0 | 2,483 | 0 | 0 | 0 | 271 | 293 |
74c46ca8073d1cbeae8a18e23c4fdce42ad1fbb0 | 6,716 | py | Python | classifier.py | nina87513/recipe-sorting-hat | 290f0ea56c92820e2631dc48cc2bb2c45a79cce1 | [
"MIT"
] | null | null | null | classifier.py | nina87513/recipe-sorting-hat | 290f0ea56c92820e2631dc48cc2bb2c45a79cce1 | [
"MIT"
] | null | null | null | classifier.py | nina87513/recipe-sorting-hat | 290f0ea56c92820e2631dc48cc2bb2c45a79cce1 | [
"MIT"
] | null | null | null | import csv
train_docs_class_list = []
test_docs_index_list = list(range(1, 1010))
train_docs_list = []
with open('trainingdata.txt') as csvfile:
rows = csv.reader(csvfile, delimiter=' ')
for row in rows:
file_list = []
for col in row[1:-1]:
f = open('recipe_dataset/' + co... | 34.979167 | 102 | 0.647111 | import csv
from nltk.stem import PorterStemmer
import numpy as np
def tokenization(data):
for i in range(10):
data = data.replace(str(i), ' ')
return data.replace('\r\n', ' ').replace(',', ' ').replace('.', ' ').replace('(', ' ') \
.replace(')', ' ').replace('?', ' ').replace('`', ' ').replace... | 0 | 0 | 0 | 0 | 0 | 2,586 | 0 | 11 | 320 |
80895058b0f82ecfe56051254c8769ab8fdf2339 | 30,272 | py | Python | guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py | usdot-fhwa-stol/carma-platform | d45a1afbf1efdb0b8cd62fcec5a3033b7306df33 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 112 | 2020-04-27T17:06:46.000Z | 2022-03-31T15:27:14.000Z | guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py | usdot-fhwa-stol/carma-platform | d45a1afbf1efdb0b8cd62fcec5a3033b7306df33 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 982 | 2020-04-17T11:28:04.000Z | 2022-03-31T21:12:19.000Z | guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py | usdot-fhwa-stol/carma-platform | d45a1afbf1efdb0b8cd62fcec5a3033b7306df33 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 57 | 2020-05-07T15:48:11.000Z | 2022-03-09T23:31:45.000Z | #!/usr/bin/env python
"""
* Copyright (C) 2021 LEIDOS.
*
* 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 applicab... | 63.730526 | 179 | 0.687632 | #!/usr/bin/env python
"""
* Copyright (C) 2021 LEIDOS.
*
* 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 applicab... | 0 | 0 | 0 | 29,501 | 0 | 0 | 0 | 21 | 136 |
992b0ba84ca40fe322def3a1dfd61c3c3f7de53c | 391 | py | Python | binary.py | jkania7/galfacts | cd4a82d82fa7f9cb3d20f73ee1848adf1028c1cf | [
"MIT"
] | null | null | null | binary.py | jkania7/galfacts | cd4a82d82fa7f9cb3d20f73ee1848adf1028c1cf | [
"MIT"
] | null | null | null | binary.py | jkania7/galfacts | cd4a82d82fa7f9cb3d20f73ee1848adf1028c1cf | [
"MIT"
] | null | null | null | import struct
with open("fluxtime.dat","rb") as f:
bin_data = f.read()
num_entries = len(bin_data)/4
data_unpak = struct.unpack('{0}f'.format(num),bin_data)
RA_set = data_unpack[0::7]
DEC_set = data_unpack[1::7]
AST_set = data_unpack[2::7]
I_set = data_unpack[3::7]
Q_set = data_unpack[4::7]
U_set = data_unpack[... | 19.55 | 55 | 0.700767 | import struct
with open("fluxtime.dat","rb") as f:
bin_data = f.read()
num_entries = len(bin_data)/4
data_unpak = struct.unpack('{0}f'.format(num),bin_data)
RA_set = data_unpack[0::7]
DEC_set = data_unpack[1::7]
AST_set = data_unpack[2::7]
I_set = data_unpack[3::7]
Q_set = data_unpack[4::7]
U_set = data_unpack[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f06008aaf14df74f297905b8dc0d8e4b6899b2f | 2,060 | py | Python | sql/migrations/0001_initial.py | gyarab/vyuka-sql | 9ab74d3fed055bd6ae302e1aea839d769b7005d4 | [
"MIT"
] | null | null | null | sql/migrations/0001_initial.py | gyarab/vyuka-sql | 9ab74d3fed055bd6ae302e1aea839d769b7005d4 | [
"MIT"
] | null | null | null | sql/migrations/0001_initial.py | gyarab/vyuka-sql | 9ab74d3fed055bd6ae302e1aea839d769b7005d4 | [
"MIT"
] | 1 | 2020-02-12T08:47:37.000Z | 2020-02-12T08:47:37.000Z | # Generated by Django 3.0.3 on 2020-02-12 00:37
| 38.148148 | 114 | 0.550971 | # Generated by Django 3.0.3 on 2020-02-12 00:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Battle',
fields=[
... | 0 | 0 | 0 | 1,913 | 0 | 0 | 0 | 30 | 68 |
dd628c56853ea741992b0f930fa9697140051980 | 6,529 | py | Python | project_libs/ukcp18/ukcp18_ls1.py | ukcp-data/ukcp18-data-factory | 939ca5449ebb33415a3aece976ab86065066ce0b | [
"BSD-2-Clause"
] | null | null | null | project_libs/ukcp18/ukcp18_ls1.py | ukcp-data/ukcp18-data-factory | 939ca5449ebb33415a3aece976ab86065066ce0b | [
"BSD-2-Clause"
] | 8 | 2017-09-11T10:06:40.000Z | 2018-09-19T12:27:11.000Z | project_libs/ukcp18/ukcp18_ls1.py | ukcp-data/ukcp18-data-factory | 939ca5449ebb33415a3aece976ab86065066ce0b | [
"BSD-2-Clause"
] | null | null | null | """
ukcp18_ls1.py
=============
Helper functions for working with UKCP18 Land Strand 1.
"""
# Standard library imports
import os
# Third-party imports
import numpy as np
import numpy.random as npr
import numpy.ma
from numpy.ma.core import MaskedArray
import cPickle
BASEDIR = 'ukcp-test-inputs/inp... | 30.652582 | 101 | 0.60147 | """
ukcp18_ls1.py
=============
Helper functions for working with UKCP18 Land Strand 1.
"""
# Standard library imports
import os
# Third-party imports
import numpy as np
import numpy.random as npr
import numpy.ma
from numpy.ma.core import MaskedArray
import cPickle
BASEDIR = 'ukcp-test-inputs/inp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
601857946080bd85434727a8875ffdbcb4e26651 | 861 | py | Python | margen/segment01/rhythms.py | DaviRaubach/la_otra_margen | 5f7f2745d11a4dc6cd824236ad2af9af150289b2 | [
"CC0-1.0"
] | null | null | null | margen/segment01/rhythms.py | DaviRaubach/la_otra_margen | 5f7f2745d11a4dc6cd824236ad2af9af150289b2 | [
"CC0-1.0"
] | null | null | null | margen/segment01/rhythms.py | DaviRaubach/la_otra_margen | 5f7f2745d11a4dc6cd824236ad2af9af150289b2 | [
"CC0-1.0"
] | null | null | null | from abjadext import rmakers
I_rhythms = {
"matA": rmakers.stack(
rmakers.talea([1, 1, 1, 1], 8, extra_counts=[0, 1]),
rmakers.extract_trivial()
),
"rests": rmakers.stack(
rmakers.note(),
rmakers.force_rest(selector)
)
}
II_rhythms = {
"matA": rmakers.stack(
rmakers.tale... | 22.076923 | 56 | 0.610918 | import abjad
from abjadext import rmakers
def selector(argument):
sel = abjad.Selection(argument)
return sel
I_rhythms = {
"matA": rmakers.stack(
rmakers.talea([1, 1, 1, 1], 8, extra_counts=[0, 1]),
rmakers.extract_trivial()
),
"rests": rmakers.stack(
rmakers.note(),
rmaker... | 0 | 0 | 0 | 0 | 0 | 53 | 0 | -9 | 45 |
52ca8d0cca350e8ccc5c05277a5cabe3f1c04af5 | 1,620 | py | Python | kafka_parser.py | splunk-soar-connectors/kafka | 5d408bf9016d6649fa3a6084616b1f78b905548a | [
"Apache-2.0"
] | null | null | null | kafka_parser.py | splunk-soar-connectors/kafka | 5d408bf9016d6649fa3a6084616b1f78b905548a | [
"Apache-2.0"
] | 2 | 2021-12-03T19:22:14.000Z | 2022-02-07T22:34:15.000Z | kafka_parser.py | splunk-soar-connectors/kafka | 5d408bf9016d6649fa3a6084616b1f78b905548a | [
"Apache-2.0"
] | null | null | null | # File: kafka_parser.py
#
# Copyright (c) 2017-2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.153846 | 107 | 0.685802 | # File: kafka_parser.py
#
# Copyright (c) 2017-2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 0 | 0 | 0 | 0 | 923 | 0 | 8 | 45 |
7c57e08a8887dc1b9de186599d9ed8d9ce4f2341 | 84 | py | Python | actymath/__init__.py | ttamg/actymath | 37405449e0e72c44a8c300f18c8c0f6caf313f06 | [
"MIT"
] | 1 | 2021-05-22T17:58:59.000Z | 2021-05-22T17:58:59.000Z | actymath/__init__.py | ttamg/actymath | 37405449e0e72c44a8c300f18c8c0f6caf313f06 | [
"MIT"
] | null | null | null | actymath/__init__.py | ttamg/actymath | 37405449e0e72c44a8c300f18c8c0f6caf313f06 | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
| 16.8 | 37 | 0.77381 | __version__ = "0.1.0"
from .exceptions import ActyMathError
from .calc import Calc
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 45 |
d9c628c710037279944ab1b6e210ecad031d15c5 | 419 | py | Python | backend/src/accounts/migrations/0006_eventprofile_account_id.py | rcmiskin10/mob_files | dd4932c15c96bea914ffa99b72c83d471a4bfaff | [
"MIT"
] | null | null | null | backend/src/accounts/migrations/0006_eventprofile_account_id.py | rcmiskin10/mob_files | dd4932c15c96bea914ffa99b72c83d471a4bfaff | [
"MIT"
] | null | null | null | backend/src/accounts/migrations/0006_eventprofile_account_id.py | rcmiskin10/mob_files | dd4932c15c96bea914ffa99b72c83d471a4bfaff | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-07-20 02:04
| 22.052632 | 74 | 0.615752 | # Generated by Django 2.0.4 on 2018-07-20 02:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0005_auto_20180630_0147'),
]
operations = [
migrations.AddField(
model_name='eventprofile',
name='accoun... | 0 | 0 | 0 | 305 | 0 | 0 | 0 | 19 | 46 |
790c8c1d71d3b4e18a00157853ed455148a3968d | 519 | py | Python | crafters/numeric/ArrayStringReader/tests/test_arraystringreader.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | 1 | 2022-03-01T12:43:17.000Z | 2022-03-01T12:43:17.000Z | crafters/numeric/ArrayStringReader/tests/test_arraystringreader.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | null | null | null | crafters/numeric/ArrayStringReader/tests/test_arraystringreader.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .. import ArrayStringReader
def test_arraystringreader():
"""here is my test code
https://docs.pytest.org/en/stable/getting-started.html#create-your-first-test
"""
size = 8
sample_array = np.random.rand(size).astype('float32')
text = ','.join([str(x) for x in sample_a... | 25.95 | 81 | 0.687861 | import numpy as np
from .. import ArrayStringReader
def test_arraystringreader():
"""here is my test code
https://docs.pytest.org/en/stable/getting-started.html#create-your-first-test
"""
size = 8
sample_array = np.random.rand(size).astype('float32')
text = ','.join([str(x) for x in sample_a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36c9682439a39eacf61901a97633b1c7dd2fcf6c | 6,331 | py | Python | opta/commands/push.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | opta/commands/push.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | opta/commands/push.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null |
# Check if the config file is for a service or environment opta layer.
# Some commands (like push/deploy) are meant only for service layers.
#
# If the config file has the "environments" field, then it is a child/service layer.
| 34.407609 | 118 | 0.655031 | import base64
from typing import Optional, Tuple
import boto3
import click
from botocore.config import Config
from docker import from_env
from opta.amplitude import amplitude_client
from opta.core.gcp import GCP
from opta.core.generator import gen_all
from opta.core.terraform import get_terraform_outputs
from opta.ex... | 0 | 1,049 | 0 | 0 | 0 | 4,326 | 0 | 178 | 539 |
22adfdf1975336498e63384e2a3eeadd63781ec6 | 1,768 | py | Python | preprocess.py | coolioasjulio/DevanagriRecognizer | ed25c6f331cde2a19187cb7bd40790db069f469c | [
"MIT"
] | null | null | null | preprocess.py | coolioasjulio/DevanagriRecognizer | ed25c6f331cde2a19187cb7bd40790db069f469c | [
"MIT"
] | 1 | 2019-02-27T12:03:03.000Z | 2019-02-27T12:03:03.000Z | preprocess.py | coolioasjulio/DevanagriRecognizer | ed25c6f331cde2a19187cb7bd40790db069f469c | [
"MIT"
] | null | null | null | # Preprocess images
if __name__ == '__main__':
PARENT_DIR = 'resources/New'
progbar = ProgBar()
recurse(progbar, PARENT_DIR) | 29.466667 | 84 | 0.595588 | # Preprocess images
from scipy import misc
from scipy.ndimage.measurements import center_of_mass
import numpy as np
import os
from os.path import isfile, isdir
class ProgBar(object):
def __init__(self):
self.counter = 0
def progress(self):
self.counter += 1
print('.', end = ''... | 0 | 0 | 0 | 219 | 0 | 1,167 | 0 | 30 | 215 |
e4f3734b737ea7a845f6d3fe447958b565ae6345 | 375 | py | Python | samples/sample4.py | niwibe/cobrascript | 4c6a193d8745771e5fb0e277394f83e47cc7ede8 | [
"BSD-3-Clause"
] | 1 | 2015-05-03T00:25:17.000Z | 2015-05-03T00:25:17.000Z | samples/sample4.py | niwibe/cobrascript | 4c6a193d8745771e5fb0e277394f83e47cc7ede8 | [
"BSD-3-Clause"
] | null | null | null | samples/sample4.py | niwibe/cobrascript | 4c6a193d8745771e5fb0e277394f83e47cc7ede8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
x = jQuery(".item")
x.on("click", lambda e: e.preventDefault())
fooController["$inject"] = ["$scope", "$rootScope", "config"]
tttt = xxx = 222
| 18.75 | 61 | 0.634667 | # -*- coding: utf-8 -*-
x = jQuery(".item")
x.on("click", lambda e: e.preventDefault())
def fooController(scope, rootScope, config):
def updateIssue():
pass
def updateUserStory():
pass
scope.updateIssue = updateIssue
scope.updateUserStory = updateUserStory
fooController["$inject"]... | 0 | 0 | 0 | 0 | 0 | 181 | 0 | 0 | 23 |
ff50e0e05a8540ee65c277589bfea7f1be6f0195 | 929 | py | Python | tests/core/extraction/test_analyzer.py | lasta/preacher | 5e50f8eb930fac72a788e7614eb5a85903f7bde6 | [
"MIT"
] | null | null | null | tests/core/extraction/test_analyzer.py | lasta/preacher | 5e50f8eb930fac72a788e7614eb5a85903f7bde6 | [
"MIT"
] | null | null | null | tests/core/extraction/test_analyzer.py | lasta/preacher | 5e50f8eb930fac72a788e7614eb5a85903f7bde6 | [
"MIT"
] | null | null | null | from typing import TypeVar
T = TypeVar('T')
| 28.151515 | 68 | 0.68676 | from typing import Callable, Mapping, TypeVar
from unittest.mock import Mock
from lxml.etree import _Element as Element
from pytest import raises
from preacher.core.extraction.analysis import Analyzer
T = TypeVar('T')
def test_analyzer_interface():
class _IncompleteAnalyzer(Analyzer):
def for_text(self... | 0 | 0 | 0 | 354 | 0 | 330 | 0 | 86 | 113 |
46edd24c99855cd8bc6717a1ea897cde7b6a1c71 | 418 | py | Python | projects/sachinl0har/chatbots/acro.py | Dalekvim/Python | dacc73c319d835f7cda3177c2fdd7c4328828cb9 | [
"MIT"
] | null | null | null | projects/sachinl0har/chatbots/acro.py | Dalekvim/Python | dacc73c319d835f7cda3177c2fdd7c4328828cb9 | [
"MIT"
] | null | null | null | projects/sachinl0har/chatbots/acro.py | Dalekvim/Python | dacc73c319d835f7cda3177c2fdd7c4328828cb9 | [
"MIT"
] | null | null | null |
from projects.sachinl0har.chatbots.helper import run
if __name__ == "__main__":
run("Acro", acro)
| 20.9 | 97 | 0.679426 | import requests
from projects.sachinl0har.chatbots.helper import say, run
def cnt(_input: str):
print(_input)
url = f"http://api.brainshop.ai/get?bid=157984&key=3S0hhLXZ5GS2KYs4&uid=[uid]&msg=[{_input}]"
r = requests.get(url)
return r.json()['cnt']
def acro(_input, recognizer=None, microphone=None)... | 0 | 0 | 0 | 0 | 0 | 244 | 0 | -1 | 68 |
7ceea35ef7708b3f48b2321f177fbdbf342638ae | 2,051 | py | Python | src/metod_alg/check_metod_class/sog_obj_func.py | Megscammell/METOD-Algorithm | 7518145ec100599bddc880f5f52d28f9a3959108 | [
"MIT"
] | null | null | null | src/metod_alg/check_metod_class/sog_obj_func.py | Megscammell/METOD-Algorithm | 7518145ec100599bddc880f5f52d28f9a3959108 | [
"MIT"
] | 1 | 2021-11-17T09:03:17.000Z | 2021-11-17T09:03:17.000Z | src/metod_alg/check_metod_class/sog_obj_func.py | Megscammell/METOD-Algorithm | 7518145ec100599bddc880f5f52d28f9a3959108 | [
"MIT"
] | null | null | null | import numpy as np
def sog_func(x, p, exp_const, store_x0, matrix_test, store_c):
"""
Compute Sum of Gaussians function at a given point with given arguments.
Parameters
----------
point : 1-D array with shape (d, )
A point used to evaluate the function.
p : integer
Number... | 32.555556 | 76 | 0.557289 | import numpy as np
def sog_func(x, p, exp_const, store_x0, matrix_test, store_c):
"""
Compute Sum of Gaussians function at a given point with given arguments.
Parameters
----------
point : 1-D array with shape (d, )
A point used to evaluate the function.
p : integer
Number... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2daae20385c7ba18e79e61ffa19ba6337255b17 | 1,727 | py | Python | skatingAI/nets/keypoint/v3.py | na018/awesome.skating.ai | 50738d5a359dc7fd69ec676cfaa83471b8ffe2e5 | [
"MIT"
] | 21 | 2020-08-03T20:13:00.000Z | 2022-03-21T10:41:18.000Z | skatingAI/nets/keypoint/v3.py | na018/awesome.skating.ai | 50738d5a359dc7fd69ec676cfaa83471b8ffe2e5 | [
"MIT"
] | null | null | null | skatingAI/nets/keypoint/v3.py | na018/awesome.skating.ai | 50738d5a359dc7fd69ec676cfaa83471b8ffe2e5 | [
"MIT"
] | null | null | null | import tensorflow as tf
layers = tf.keras.layers
BN_MOMENTUM = 0.01
| 39.25 | 106 | 0.623046 | import tensorflow as tf
import tensorflow.keras.backend as K
from skatingAI.nets.keypoint.KPDetectorBase import KPDetectorBase
layers = tf.keras.layers
BN_MOMENTUM = 0.01
class KPDetector(KPDetectorBase):
def _build_model(self):
img_input = self.conv3x3_block(self.inputs, filter_counts=[16, 16, 33], n... | 0 | 0 | 0 | 1,529 | 0 | 0 | 0 | 59 | 68 |
2257f3ceb67f3ab1e9c10782448bd02f02fcb9ce | 590 | py | Python | diagnosticism/__init__.py | synesissoftware/diagnosticism.Python | b3f58c5616b4f5523c339fd61ea3a883d7072724 | [
"BSD-3-Clause"
] | null | null | null | diagnosticism/__init__.py | synesissoftware/diagnosticism.Python | b3f58c5616b4f5523c339fd61ea3a883d7072724 | [
"BSD-3-Clause"
] | null | null | null | diagnosticism/__init__.py | synesissoftware/diagnosticism.Python | b3f58c5616b4f5523c339fd61ea3a883d7072724 | [
"BSD-3-Clause"
] | null | null | null |
__author__ = 'Matt Wilson'
__copyright__ = 'Copyright 2019-2020, Synesis Information Systems, Copyright 2019, Synesis Software'
__credits__ = [
'Garth Lancaster',
'Matt Wilson',
]
__email__ = 'matthew@synesis.com.au'
__license__ = 'BSD-3-Clause'
__maintainer__ = 'Matt... | 29.5 | 104 | 0.688136 |
__author__ = 'Matt Wilson'
__copyright__ = 'Copyright 2019-2020, Synesis Information Systems, Copyright 2019, Synesis Software'
__credits__ = [
'Garth Lancaster',
'Matt Wilson',
]
__email__ = 'matthew@synesis.com.au'
__license__ = 'BSD-3-Clause'
__maintainer__ = 'Matt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 111 |
d90cc4d649290293cdba377350a20930515f9e89 | 6,199 | py | Python | mapmint-services/classifier/service.py | aryanxk02/mapmint | 577ddc85f17dad6274add7940de86ecda7e6c85a | [
"MIT"
] | null | null | null | mapmint-services/classifier/service.py | aryanxk02/mapmint | 577ddc85f17dad6274add7940de86ecda7e6c85a | [
"MIT"
] | null | null | null | mapmint-services/classifier/service.py | aryanxk02/mapmint | 577ddc85f17dad6274add7940de86ecda7e6c85a | [
"MIT"
] | 1 | 2019-10-10T17:33:58.000Z | 2019-10-10T17:33:58.000Z | # -*- coding: utf-8 -*-
###############################################################################
# Author: Grald Fenoy, gerald.fenoy@cartoworks.com
# Copyright (c) 2010-2014, Cartoworks Inc.
###############################################################################
# Permission is hereby granted, fre... | 39.737179 | 135 | 0.59687 | # -*- coding: utf-8 -*-
###############################################################################
# Author: Gérald Fenoy, gerald.fenoy@cartoworks.com
# Copyright (c) 2010-2014, Cartoworks Inc.
###############################################################################
# Permission is hereby granted, fr... | 2 | 0 | 0 | 0 | 0 | 4,538 | 0 | -11 | 165 |
2ae8b9076b2f230af7e1757e21755d5e1c1bb70e | 430 | py | Python | basic_email/forms.py | ArabellaTech/django-basic-email | a4bfb5a76bfdc93ff5b1354fb1b02f75fb7bbccc | [
"BSD-3-Clause"
] | 1 | 2015-09-30T12:18:11.000Z | 2015-09-30T12:18:11.000Z | basic_email/forms.py | ArabellaTech/django-basic-email | a4bfb5a76bfdc93ff5b1354fb1b02f75fb7bbccc | [
"BSD-3-Clause"
] | null | null | null | basic_email/forms.py | ArabellaTech/django-basic-email | a4bfb5a76bfdc93ff5b1354fb1b02f75fb7bbccc | [
"BSD-3-Clause"
] | 1 | 2018-03-05T19:14:58.000Z | 2018-03-05T19:14:58.000Z | # -*- coding: utf-8 -*-
| 28.666667 | 69 | 0.662791 | # -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext_lazy as _
class EmailPreviewForm(forms.Form):
email = forms.EmailField(label=_("Receiver"))
def __init__(self, *args, **kwargs):
extra = kwargs.pop('extra')
super(EmailPreviewForm, self).__init__(*a... | 0 | 0 | 0 | 301 | 0 | 0 | 0 | 37 | 67 |
03154843ed38a2f3d7257de62619063ee0ed9f77 | 1,176 | py | Python | pdfmerge/admin.py | rupin/pdfmerger | fee19523e88362d215f1a29cdab0d140f4c9385c | [
"MIT"
] | null | null | null | pdfmerge/admin.py | rupin/pdfmerger | fee19523e88362d215f1a29cdab0d140f4c9385c | [
"MIT"
] | null | null | null | pdfmerge/admin.py | rupin/pdfmerger | fee19523e88362d215f1a29cdab0d140f4c9385c | [
"MIT"
] | null | null | null | from django.contrib import admin
admin.site.register(CustomUser, CustomUserAdmin)
admin.site.register(PDFForm)
admin.site.register(Field,FieldAdmin)
admin.site.register(PDFFormField,PDFFormFieldAdmin)
admin.site.register(UserProfile,UserProfileAdmin)
admin.site.register(GeneratedPDF)
| 30.153846 | 95 | 0.798469 | from import_export.admin import ImportExportModelAdmin
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm, CustomUserChangeForm
from .models import *
class CustomUserAdmin(UserAdmin):
add_form = ... | 0 | 0 | 0 | 524 | 0 | 0 | 0 | 126 | 231 |
d4cd38987c1fdffd3e9967bfb94d9ad7a816eda0 | 3,573 | py | Python | fragment_fastq_records.py | huddlej/fasta_tools | 346e8d23d1aa9221d33c74ccf48d83d6018ed62e | [
"MIT"
] | 31 | 2016-09-22T23:22:11.000Z | 2020-09-20T04:11:58.000Z | scripts/fragment_fasta_records.py | mschatz/pacbio_variant_caller | 409706f2fc597e46b0f39664eb167ebaef6fe975 | [
"MIT"
] | 26 | 2016-08-03T18:25:41.000Z | 2019-02-21T16:50:57.000Z | scripts/fragment_fasta_records.py | mschatz/pacbio_variant_caller | 409706f2fc597e46b0f39664eb167ebaef6fe975 | [
"MIT"
] | 14 | 2016-08-02T23:29:13.000Z | 2019-09-19T08:11:40.000Z | import argparse
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import operator
import re
def fragment_sequence(sequence, window, slide=0):
"""Fragment a given sequence to the requested window length without a slide.
>>> fragment_sequence("ACTGACTG", 4, 0)
['ACTG', 'ACT... | 33.392523 | 109 | 0.619367 | import argparse
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import math
import operator
import re
def make_windows(length, window, slide):
"""
For a given length, return an iterator for intervals of length `window` with
a slide of `slide`.
>>> list(make_windows(8... | 0 | 0 | 0 | 0 | 803 | 0 | 0 | -10 | 45 |
c49406473d6d243ddd7bb146e5c86ece0a288a7c | 6,252 | py | Python | database_communication.py | Jormungandr1105/Smart_Fridge | f62f65350ba5813e14839d40aee1a2a03c3812a3 | [
"MIT"
] | null | null | null | database_communication.py | Jormungandr1105/Smart_Fridge | f62f65350ba5813e14839d40aee1a2a03c3812a3 | [
"MIT"
] | null | null | null | database_communication.py | Jormungandr1105/Smart_Fridge | f62f65350ba5813e14839d40aee1a2a03c3812a3 | [
"MIT"
] | null | null | null | """
This part communicates with the database
Author: Max Marshall
Project: Fridge Tracker
"""
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = None
try:
cred = credentials.Certificate("/home/pi/Smart_Fridge/smartfridge-28fdd-firebase-adminsdk-c... | 33.255319 | 122 | 0.558861 | """
This part communicates with the database
Author: Max Marshall
Project: Fridge Tracker
"""
import datetime
import math
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
import readings as read
import light_sensor as ls
import mario
cred = None
try:
... | 0 | 0 | 0 | 0 | 0 | 3,944 | 0 | -19 | 188 |
1e97240fdfbbfa59be37daeec97e60426e370f7c | 5,222 | py | Python | pipeline/isis/globalPipelineISIS.py | tlemoult/spectroDb | 0d674e2c7ff3beee0ccda7cfa69c6247ca7f2a2e | [
"MIT"
] | 4 | 2018-11-04T21:48:48.000Z | 2022-01-26T18:57:24.000Z | pipeline/isis/globalPipelineISIS.py | tlemoult/spectroDb | 0d674e2c7ff3beee0ccda7cfa69c6247ca7f2a2e | [
"MIT"
] | 1 | 2017-02-10T16:25:16.000Z | 2017-03-17T08:22:18.000Z | pipeline/isis/globalPipelineISIS.py | tlemoult/spectroDb | 0d674e2c7ff3beee0ccda7cfa69c6247ca7f2a2e | [
"MIT"
] | null | null | null |
import os, json, sys, shutil
from datetime import datetime
if len(sys.argv)<2:
print("nombre d'argument incorrect")
print("utiliser: ")
print(" python globalPipelineISIS.py obsId1 obsId2 ...")
print(" python globalPipelineISIS.py range obsIdStart obsIdStop ")
exit(1)
print("load configuration")
json_text=... | 30.184971 | 109 | 0.668326 |
import os,json,sys,time,shutil
from datetime import datetime
def renameCalib(path,prefix,newprefix,gen):
for filename in os.listdir(path):
if filename.startswith(prefix):
src=path+'/'+filename
dst=path+'/'+gen+'_'+filename.replace(prefix,newprefix)
#print(f"rename src:... | 0 | 0 | 0 | 0 | 0 | 1,790 | 0 | 2 | 69 |
5546113e84f75a014a55eae0c83646e1a521d9a5 | 567 | py | Python | plotting/bokeh/simple_plot.py | ashikari/tutorial | cc696ee25d94476872244222062f2ff9366d12ae | [
"MIT"
] | null | null | null | plotting/bokeh/simple_plot.py | ashikari/tutorial | cc696ee25d94476872244222062f2ff9366d12ae | [
"MIT"
] | null | null | null | plotting/bokeh/simple_plot.py | ashikari/tutorial | cc696ee25d94476872244222062f2ff9366d12ae | [
"MIT"
] | null | null | null | from bokeh.plotting import figure, output_file, show
import numpy as np
if __name__ == '__main__':
x = np.linspace(0, 2*np.pi, 100)
y_lin = x
y_sqrt = np.sqrt(x)
y_log = np.log(x)
y_sin = np.sin(x)
output_file("plot.html")
fig = figure(title="Simple Plots")
fig.line(x=x, y=y_lin, color='red', legend="Linear"... | 25.772727 | 60 | 0.675485 | from bokeh.plotting import figure, output_file, show
import numpy as np
if __name__ == '__main__':
x = np.linspace(0, 2*np.pi, 100)
y_lin = x
y_sqrt = np.sqrt(x)
y_log = np.log(x)
y_sin = np.sin(x)
output_file("plot.html")
fig = figure(title="Simple Plots")
fig.line(x=x, y=y_lin, color='red', legend="Linear"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c02a9d4937008f8f5164b7811fbc65050643d207 | 3,372 | py | Python | deplatformr/helpers/filecoin_helpers.py | deplatformer/prototype | d755624ef2828a9c4b99cad53cc6013e4572e4d2 | [
"MIT"
] | null | null | null | deplatformr/helpers/filecoin_helpers.py | deplatformer/prototype | d755624ef2828a9c4b99cad53cc6013e4572e4d2 | [
"MIT"
] | 1 | 2021-02-10T02:26:02.000Z | 2021-02-10T02:26:02.000Z | deplatformr/helpers/filecoin_helpers.py | deplatformer/prototype | d755624ef2828a9c4b99cad53cc6013e4572e4d2 | [
"MIT"
] | 1 | 2021-06-28T14:42:56.000Z | 2021-06-28T14:42:56.000Z | from datetime import datetime
from flask_user import current_user
from pygate_grpc.client import PowerGateClient
from google.protobuf.json_format import MessageToDict
from deplatformr import app, db
from deplatformr.models.filecoin_models import Ffs, Wallets
def create_ffs():
"""
Create a new Powergate Fileco... | 32.737864 | 93 | 0.653025 | import os
from datetime import datetime
from flask import flash
from flask_user import current_user
from pygate_grpc.client import PowerGateClient
from pygate_grpc.ffs import get_file_bytes, bytes_to_chunks, chunks_to_bytes
from google.protobuf.json_format import MessageToDict
from deplatformr import app, db
from depla... | 0 | 0 | 0 | 0 | 0 | 2,054 | 0 | 58 | 89 |
2b426584aa50b4b20e3e95deec6deef25d3895a5 | 2,516 | py | Python | data_prep.py | evan-tan/image_data | b3d1d5d52989697db7b62ca054cba1a10459bca0 | [
"MIT"
] | null | null | null | data_prep.py | evan-tan/image_data | b3d1d5d52989697db7b62ca054cba1a10459bca0 | [
"MIT"
] | null | null | null | data_prep.py | evan-tan/image_data | b3d1d5d52989697db7b62ca054cba1a10459bca0 | [
"MIT"
] | null | null | null | import pathlib as pl
def prepend_object_name(obj: str):
"""Rename by prepending to file names, assuming files are in sheep/ and coke/
Args:
obj (str): Text of string to prepend at start of image name
"""
for path in pl.Path(obj).iterdir():
if path.is_file():
file_name = pat... | 39.936508 | 89 | 0.511924 | import pathlib as pl
import os
def prepend_object_name(obj: str):
"""Rename by prepending to file names, assuming files are in sheep/ and coke/
Args:
obj (str): Text of string to prepend at start of image name
"""
for path in pl.Path(obj).iterdir():
if path.is_file():
file_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
f475b13d38deae4b6605a096daf94c24983a8a33 | 6,585 | py | Python | exif_viewer.py | takurooo/exif | 300d9b33b7a8664c7cf92649aa3d5237009ecf44 | [
"MIT"
] | null | null | null | exif_viewer.py | takurooo/exif | 300d9b33b7a8664c7cf92649aa3d5237009ecf44 | [
"MIT"
] | 1 | 2020-01-11T14:15:52.000Z | 2020-01-11T14:15:52.000Z | exif_viewer.py | takurooo/exif | 300d9b33b7a8664c7cf92649aa3d5237009ecf44 | [
"MIT"
] | null | null | null | # -----------------------------------
# import
# -----------------------------------
print("start exif_viewer")
# -----------------------------------
# define
# -----------------------------------
# -----------------------------------
# function
# -----------------------------------
# -------------------------... | 33.769231 | 96 | 0.618831 | # -----------------------------------
# import
# -----------------------------------
import os
import sys
import argparse
from PySide2.QtWidgets import QApplication, QMainWindow, QAction, QWidget, QStyle
from PySide2.QtWidgets import QStackedWidget, QSplitter, QTextEdit, QTreeWidget, QTreeWidgetItem
from PySide2.QtWid... | 240 | 426 | 0 | 3,347 | 0 | 1,636 | 0 | 224 | 360 |
cce16174a855baa5fbf6dce660af364102ae9139 | 100 | py | Python | hstudio/service/common.py | sbl1996/hstudio | 24c7565252b0b28552c5e1dc02e50cec019c1c9e | [
"MIT"
] | null | null | null | hstudio/service/common.py | sbl1996/hstudio | 24c7565252b0b28552c5e1dc02e50cec019c1c9e | [
"MIT"
] | null | null | null | hstudio/service/common.py | sbl1996/hstudio | 24c7565252b0b28552c5e1dc02e50cec019c1c9e | [
"MIT"
] | null | null | null | HEARTBEAT_INTERVAL = 20
DISCONNECTED_THRESHOLD = HEARTBEAT_INTERVAL * 2
HSTUDIO_HOME = "~/.hstudio" | 25 | 47 | 0.8 | HEARTBEAT_INTERVAL = 20
DISCONNECTED_THRESHOLD = HEARTBEAT_INTERVAL * 2
HSTUDIO_HOME = "~/.hstudio" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ca0e0803dc62794c21087ae1eef9e564b50d4f7 | 525 | py | Python | jp.atcoder/abc006/abc006_2/8773849.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc006/abc006_2/8773849.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc006/abc006_2/8773849.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
sys.setrecursionlimit(10**7)
N = int(sys.stdin.readline().rstrip())
MOD = 10**4 + 7
ans = tribonacci(N)[2]
print(ans)
| 16.40625 | 74 | 0.382857 | import sys
sys.setrecursionlimit(10**7)
N = int(sys.stdin.readline().rstrip())
MOD = 10**4 + 7
def tribonacci(N):
if N == 0:
return 0, 0, 1
a, b, c = tribonacci(N // 2)
a, b, c, d, e = a * a, 2 * a * b, 2 * a * c + b * b, 2 * b * c, c * c
b += a
c += a
d += a
c ... | 0 | 0 | 0 | 0 | 0 | 353 | 0 | 0 | 25 |
93443f7ce84106787213e1cc470b3f680ac36915 | 1,678 | py | Python | src/pyquickhelper/loghelper/convert_helper.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 18 | 2015-11-10T08:09:23.000Z | 2022-02-16T11:46:45.000Z | src/pyquickhelper/loghelper/convert_helper.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 321 | 2015-06-14T21:34:28.000Z | 2021-11-28T17:10:03.000Z | src/pyquickhelper/loghelper/convert_helper.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 10 | 2015-06-20T01:35:00.000Z | 2022-01-19T15:54:32.000Z | # -*- coding: utf-8 -*-
"""
@file
@brief Various functions about conversions.
"""
import datetime
def str2datetime(dt, format=None):
"""
convert a string into a datetime object, it can be:
- 2013-05-24 18:49:46
- 2013-05-24 18:49:46.568
@param dt string
@param format f... | 27.966667 | 77 | 0.508343 | # -*- coding: utf-8 -*-
"""
@file
@brief Various functions about conversions.
"""
import datetime
def str2datetime(dt, format=None):
"""
convert a string into a datetime object, it can be:
- 2013-05-24 18:49:46
- 2013-05-24 18:49:46.568
@param dt string
@param format f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
29a789654d0b5e8e5ba4a98f01950603067ab28b | 287 | py | Python | pattern/1_1_3n_2.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 37 | 2019-04-03T07:19:57.000Z | 2022-01-09T06:18:41.000Z | pattern/1_1_3n_2.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 16 | 2020-08-11T08:09:42.000Z | 2021-10-30T17:40:48.000Z | pattern/1_1_3n_2.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 130 | 2019-10-02T14:40:20.000Z | 2022-01-26T17:38:26.000Z | n=int(input("enter a number: "))
for i in range(n,0,-1):
for j in range(n,0,-1):
if(j>i):
print(j,' ',sep='',end="")
else:
print(i,' ',sep='',end="")
print()
'''
output:
enter a number: 6
6 6 6 6 6 6
6 5 5 5 5 5
6 5 4 4 4 4
6 5 4 3 3 3
6 5 4 3 2 2
6 5 4 3 2 1
'''
| 15.105263 | 32 | 0.491289 | n=int(input("enter a number: "))
for i in range(n,0,-1):
for j in range(n,0,-1):
if(j>i):
print(j,' ',sep='',end="")
else:
print(i,' ',sep='',end="")
print()
'''
output:
enter a number: 6
6 6 6 6 6 6
6 5 5 5 5 5
6 5 4 4 4 4
6 5 4 3 3 3
6 5 4 3 2 2
6 5 4 3 2 1
'''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79031374fd0c3d90fc7647c75e2c9ee9cc97362f | 1,534 | py | Python | widgets/lv_arc/lv_arc.py | ndrogness/lvgl_micropython_examples | ea2245a47af8bb8545d465d3b6611b85b9ca948b | [
"MIT"
] | 1 | 2020-11-20T00:48:38.000Z | 2020-11-20T00:48:38.000Z | widgets/lv_arc/lv_arc.py | ndrogness/lvgl_micropython_examples | ea2245a47af8bb8545d465d3b6611b85b9ca948b | [
"MIT"
] | null | null | null | widgets/lv_arc/lv_arc.py | ndrogness/lvgl_micropython_examples | ea2245a47af8bb8545d465d3b6611b85b9ca948b | [
"MIT"
] | null | null | null | import lvgl as lv
if __name__ == '__main__':
lv.init()
scr = lv.obj()
lv.scr_load(scr)
lv_arc(scr)
| 29.5 | 98 | 0.653846 | import lvgl as lv
import styles
def lv_arc(screen):
# Create the arc object on lv screen, ie a lv.scr() object
arc = lv.arc(screen)
# Set arc size
arc.set_size(150, 150)
# Set arc background style color blue
arc.add_style(arc.PART.BG, styles.gstyle_bg1)
# Set arc indicator (i.e. line) st... | 0 | 0 | 0 | 0 | 0 | 1,381 | 0 | -8 | 45 |
d27c87a393c0c6e13c9b347b511418136e100d6d | 842 | py | Python | run-cloc.py | madeso/build | 79f1d4e592e0f6ebd6bfa3db39cf4ba2b5ef98db | [
"MIT"
] | null | null | null | run-cloc.py | madeso/build | 79f1d4e592e0f6ebd6bfa3db39cf4ba2b5ef98db | [
"MIT"
] | null | null | null | run-cloc.py | madeso/build | 79f1d4e592e0f6ebd6bfa3db39cf4ba2b5ef98db | [
"MIT"
] | null | null | null | #!/usr/bin/python
main() | 27.16129 | 63 | 0.640143 | #!/usr/bin/python
import argparse
import sys
import glob
import os
import re
from subprocess import call
import itertools
def main():
parser = argparse.ArgumentParser(description="Run cloc")
parser.add_argument('files', nargs='+', help='A file')
parser.add_argument('--out', help='save the log here')
ar... | 0 | 0 | 0 | 0 | 0 | 691 | 0 | -50 | 177 |
ec033aab34bfbe7e2da2f30b32890d9fa0f2f9fe | 773 | py | Python | cdrouter/cdr_datetime.py | qacafe/cdrouter.py | 34a1b031b0325ec5ed363bf3097f242c8535c824 | [
"MIT"
] | 4 | 2017-10-27T00:29:30.000Z | 2020-05-18T07:39:18.000Z | cdrouter/cdr_datetime.py | qacafe/cdrouter.py | 34a1b031b0325ec5ed363bf3097f242c8535c824 | [
"MIT"
] | 7 | 2017-07-28T19:29:25.000Z | 2020-09-02T14:44:35.000Z | cdrouter/cdr_datetime.py | qacafe/cdrouter.py | 34a1b031b0325ec5ed363bf3097f242c8535c824 | [
"MIT"
] | 5 | 2017-07-28T19:15:12.000Z | 2020-08-26T20:09:09.000Z | #
# Copyright (c) 2017 by QA Cafe.
# All Rights Reserved.
#
"""Module for processing CDRouter datetime strings."""
| 27.607143 | 72 | 0.668823 | #
# Copyright (c) 2017 by QA Cafe.
# All Rights Reserved.
#
"""Module for processing CDRouter datetime strings."""
from datetime import datetime
from marshmallow import fields
from marshmallow.exceptions import ValidationError
class DateTime(fields.DateTime):
def __init__(self, format=None, **kwargs):
s... | 0 | 0 | 0 | 520 | 0 | 0 | 0 | 46 | 91 |
f434c1e5641f15763b1e85ab5ce19baccba16304 | 1,441 | py | Python | collecting/collecter.py | kingno21/project | 3d8e6272ce2dd952808f63c91f1e7d97f4115f03 | [
"MIT"
] | null | null | null | collecting/collecter.py | kingno21/project | 3d8e6272ce2dd952808f63c91f1e7d97f4115f03 | [
"MIT"
] | null | null | null | collecting/collecter.py | kingno21/project | 3d8e6272ce2dd952808f63c91f1e7d97f4115f03 | [
"MIT"
] | null | null | null | from BeautifulSoup import BeautifulSoup
import urllib2, urllib, threading, sys
url = "http://apk.hiapk.com/apps"
down_url = "http://apk.hiapk.com/appdown/"
info_url = "http://apk.hiapk.com/appinfo/"
num = 11
page = 5
threads = []
for mon in xrange(1, num):
print '[+] Thread %d is start' %mon
t = threading.Th... | 31.326087 | 125 | 0.523248 | from BeautifulSoup import BeautifulSoup
import urllib2, urllib, threading, sys
url = "http://apk.hiapk.com/apps"
down_url = "http://apk.hiapk.com/appdown/"
info_url = "http://apk.hiapk.com/appinfo/"
num = 11
page = 5
def makelist(n):
f = open('url{:02d}.txt'.format(n), 'w')
for i in range((n-1) * page, n * pa... | 0 | 0 | 0 | 0 | 0 | 994 | 0 | 0 | 23 |
9abd9596701e8582ee48510ba2ebb3887e404ddc | 13,371 | py | Python | NAVETTA/tests/DI_tests.py | MrAsura/NAVETTA | a7e71154c77aad5386cc0fcdf1e674adeb92bf43 | [
"BSD-3-Clause"
] | null | null | null | NAVETTA/tests/DI_tests.py | MrAsura/NAVETTA | a7e71154c77aad5386cc0fcdf1e674adeb92bf43 | [
"BSD-3-Clause"
] | null | null | null | NAVETTA/tests/DI_tests.py | MrAsura/NAVETTA | a7e71154c77aad5386cc0fcdf1e674adeb92bf43 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for Master thesis
"""
if __name__ == "__main__":
print("Execute test file " + __file__)
main()
| 65.866995 | 405 | 0.522474 | """
Tests for Master thesis
"""
import cfg
from TestSuite import runTests, SummaryType, TestUtils as TU
import re
import operator as op
def main():
seqs = cfg.sequences[cfg.hevc_A] + cfg.sequences[cfg.hevc_B]
in_names = cfg.class_sequence_names[cfg.hevc_A] + cfg.class_sequence_names[cfg.hevc_B]
ver = 27
... | 8 | 0 | 0 | 0 | 0 | 13,124 | 0 | 16 | 112 |
95805e51c39933cefade2d937b26cd7de3d4186e | 43,010 | py | Python | test/test_nexsan.py | yrro/nexsan-exporter | 7e62d6003f99ee01ca28d5ece70750518f2a9c63 | [
"MIT"
] | null | null | null | test/test_nexsan.py | yrro/nexsan-exporter | 7e62d6003f99ee01ca28d5ece70750518f2a9c63 | [
"MIT"
] | 1 | 2019-04-30T14:24:52.000Z | 2019-04-30T14:24:52.000Z | test/test_nexsan.py | yrro/nexsan-exporter | 7e62d6003f99ee01ca28d5ece70750518f2a9c63 | [
"MIT"
] | 1 | 2020-12-17T15:53:48.000Z | 2020-12-17T15:53:48.000Z |
from nexsan_exporter import nexsan
def test_opstats(opstats_xml):
'''
Tests that real-world data parses.
'''
metrics = list(nexsan.Collector(opstats_xml).collect())
assert 0 < len(metrics)
| 45.321391 | 197 | 0.618019 | import os
from xml.etree import ElementTree as ET
import pytest
from nexsan_exporter import nexsan
def test_attrib_good():
elem = ET.Element('a')
elem.attrib['good'] = 'yes'
c = nexsan.Collector(elem)
assert 1 == c.isgood(elem)
def test_attrib_bad():
elem = ET.Element('a')
elem.attrib['good'... | 0 | 10,072 | 0 | 0 | 0 | 30,798 | 0 | -2 | 1,930 |
3404fa4c395dbf8dc9e560895ba0e3303610403f | 3,242 | py | Python | server.py | taimooralam/tcp-offloader | 3bad42e8552c629ad5398c2ff782cdf6c62bf689 | [
"MIT"
] | null | null | null | server.py | taimooralam/tcp-offloader | 3bad42e8552c629ad5398c2ff782cdf6c62bf689 | [
"MIT"
] | null | null | null | server.py | taimooralam/tcp-offloader | 3bad42e8552c629ad5398c2ff782cdf6c62bf689 | [
"MIT"
] | null | null | null | # Echo server program
import socket
import cPickle as pickle
import sys
import os
HOST = '' # Symbolic name meaning all available interfaces
PORT = 6000 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
SESSION_BEGIN = 0... | 33.770833 | 152 | 0.586983 | # Echo server program
import socket
import cPickle as pickle
import sys
import os
HOST = '' # Symbolic name meaning all available interfaces
PORT = 6000 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
SESSION_BEGIN = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
a1b7e19d5a5264e4c99e5e68e686e88b9ef40833 | 7,722 | py | Python | macapype/nodes/correct_bias.py | Macatools/macapype | 50820e2ab948c91c5362771d51688edd09b72499 | [
"BSD-3-Clause"
] | 7 | 2020-07-04T04:04:03.000Z | 2022-03-24T14:35:45.000Z | macapype/nodes/correct_bias.py | Macatools/macapype | 50820e2ab948c91c5362771d51688edd09b72499 | [
"BSD-3-Clause"
] | 95 | 2020-01-02T16:41:20.000Z | 2021-12-07T15:50:41.000Z | macapype/nodes/correct_bias.py | Macatools/macapype | 50820e2ab948c91c5362771d51688edd09b72499 | [
"BSD-3-Clause"
] | 9 | 2019-11-14T12:46:14.000Z | 2022-01-26T09:44:21.000Z |
# T1xT2BiasFieldCorrection
| 35.1 | 79 | 0.577959 | import os
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec,
TraitedSpec)
from nipype.interfaces.base import traits, File
# T1xT2BiasFieldCorrection
class T1xT2BiasFieldCorrectionInputSpec(CommandLineInputSpec):
t1_file = File(
exists=True,
... | 0 | 0 | 0 | 7,445 | 0 | 0 | 0 | 112 | 134 |
c0e5cef6d881e16c1c00c2febf9fdc35c074f60d | 633 | py | Python | callblocker/wsgi.py | gmega/callblocker | 212ca8521ce53adb8c97acf06e03c1c5d291adf9 | [
"BSD-3-Clause"
] | 9 | 2019-12-02T23:59:44.000Z | 2022-03-01T09:59:48.000Z | callblocker/wsgi.py | gmega/callblocker | 212ca8521ce53adb8c97acf06e03c1c5d291adf9 | [
"BSD-3-Clause"
] | 7 | 2021-04-08T19:25:38.000Z | 2022-02-26T15:09:02.000Z | callblocker/wsgi.py | gmega/callblocker | 212ca8521ce53adb8c97acf06e03c1c5d291adf9 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for callblocker project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.conf import settings
from django.core.wsgi import get_wsgi_application... | 23.444444 | 78 | 0.800948 | """
WSGI config for callblocker project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.conf import settings
from django.core.wsgi import get_wsgi_application... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2721d2b4ac551efa08f0890cacb7de0c9198e8ae | 865 | py | Python | test/test_polygon_from_session.py | sdadia/polygonscan-python | 6ef00e5e47d3a37203af3f05d7e344fb30e83409 | [
"MIT"
] | 4 | 2022-01-10T21:58:02.000Z | 2022-03-27T20:21:35.000Z | test/test_polygon_from_session.py | yusufseyrek/polygonscan-python | c58a8190e41a5c9bac0a5e88db809e5e207b1c77 | [
"MIT"
] | 3 | 2021-09-25T05:10:27.000Z | 2021-11-21T04:56:29.000Z | test/test_polygon_from_session.py | yusufseyrek/polygonscan-python | c58a8190e41a5c9bac0a5e88db809e5e207b1c77 | [
"MIT"
] | 4 | 2021-09-25T05:11:08.000Z | 2022-03-09T01:01:33.000Z | import os
CONFIG_PATH = "polygon/configs/stable.json"
API_KEY = os.environ["API_KEY"]
| 28.833333 | 60 | 0.736416 | import os
from unittest import TestCase
from unittest.async_case import IsolatedAsyncioTestCase
from aiohttp import ClientSession
from polygonscan.core.async_client import AsyncClient
from polygonscan.core.sync_client import SyncClient
from requests import Session
CONFIG_PATH = "polygon/configs/stable.json"
API_KEY ... | 0 | 0 | 205 | 243 | 0 | 0 | 0 | 123 | 206 |
4bea4d6a362b91e6e75fc05831de551515ca2ef9 | 3,588 | py | Python | WebScraper.py | tacpc/LinkedInWebScrape | 65fe7d46c72bbaa264d67f008566ea0dcee2061e | [
"MIT"
] | null | null | null | WebScraper.py | tacpc/LinkedInWebScrape | 65fe7d46c72bbaa264d67f008566ea0dcee2061e | [
"MIT"
] | null | null | null | WebScraper.py | tacpc/LinkedInWebScrape | 65fe7d46c72bbaa264d67f008566ea0dcee2061e | [
"MIT"
] | null | null | null | """ NOT USED
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
"""
#-----------------------------------------------------------------------------------# | 38.170213 | 160 | 0.597547 | import time
import random
from selenium import webdriver
""" NOT USED
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
"""
class LinkedIn_WebScraper:
d... | 2 | 0 | 0 | 3,192 | 0 | 0 | 0 | -9 | 89 |