hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a5106b6c718102f4d5b8963e2760bc144a99bea9 | 2,561 | py | Python | src/AModel.py | LangArthur/emotions-detection | 76bc9c70241d583fb89d0e6019dbcdda9034a602 | [
"MIT"
] | null | null | null | src/AModel.py | LangArthur/emotions-detection | 76bc9c70241d583fb89d0e6019dbcdda9034a602 | [
"MIT"
] | null | null | null | src/AModel.py | LangArthur/emotions-detection | 76bc9c70241d583fb89d0e6019dbcdda9034a602 | [
"MIT"
] | 1 | 2021-05-13T18:50:59.000Z | 2021-05-13T18:50:59.000Z | #
# Created on Tue May 11 2021
#
# Arthur Lang
# AModel.py
#
import tensorflow
import numpy
from abc import ABC, abstractmethod
class AModel(ABC):
def __init__(self, weightPath = None, modelPath = None):
self._hasWeight = False
if (modelPath != None):
self.model = tensorflow.keras.mo... | 34.608108 | 128 | 0.660289 |
32dda2fbf5d930878fd3c24a4723c72bfb278016 | 141 | py | Python | src/section5/profilesapi/profiles/admin.py | Kayofpimentel/django_course | f4408bb02319d3fa8580f41e62bd9910609442eb | [
"MIT"
] | null | null | null | src/section5/profilesapi/profiles/admin.py | Kayofpimentel/django_course | f4408bb02319d3fa8580f41e62bd9910609442eb | [
"MIT"
] | null | null | null | src/section5/profilesapi/profiles/admin.py | Kayofpimentel/django_course | f4408bb02319d3fa8580f41e62bd9910609442eb | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Profile, ProfileStatus
admin.site.register(Profile)
admin.site.register(ProfileStatus)
| 23.5 | 42 | 0.836879 |
6f4f78e0c196e953080248bb324a3c3623971f66 | 949 | py | Python | ML/website-scraping-w-python-master/Chapter 6/pythonanywhere/pythonanywhere/berlin/berlin/pipelines.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | ML/website-scraping-w-python-master/Chapter 6/pythonanywhere/pythonanywhere/berlin/berlin/pipelines.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | ML/website-scraping-w-python-master/Chapter 6/pythonanywhere/pythonanywhere/berlin/berlin/pipelines.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pymysql.cursors
insert_template = """INSERT INTO berlinsights (name, description) VALUES (%s, %s)"""
class BerlinMySQLPipeline(object):
def process_item(self, item, spider):
connection = pymysql.connect(host='???', # TODO add your database host
... | 37.96 | 102 | 0.514226 |
1eacc4c710d46a9b62355c9d6e1b38f5a8be7bfd | 662 | py | Python | manage.py | abhishekkushwaha4u/vitolx-backend | c280bc5095307d854bb050a5b495a9cedc985673 | [
"MIT"
] | 2 | 2021-06-09T15:21:51.000Z | 2021-06-09T15:26:31.000Z | manage.py | Shounak-bhattacharya/vitolx-backend | c280bc5095307d854bb050a5b495a9cedc985673 | [
"MIT"
] | null | null | null | manage.py | Shounak-bhattacharya/vitolx-backend | c280bc5095307d854bb050a5b495a9cedc985673 | [
"MIT"
] | 1 | 2021-06-10T05:26:47.000Z | 2021-06-10T05:26:47.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'vitolx.settings')
try:
from django.core.management import execute_from_command_line
except Impor... | 28.782609 | 73 | 0.678248 |
dfb649b7a35700d7049e4dcd5691a0465c5a3388 | 12,411 | py | Python | scripts/eo_rgb_plot.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | 1 | 2016-12-04T18:01:49.000Z | 2016-12-04T18:01:49.000Z | scripts/eo_rgb_plot.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | 13 | 2017-03-16T15:44:21.000Z | 2019-08-19T16:56:04.000Z | scripts/eo_rgb_plot.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | null | null | null | from flyingpigeon import eodata
import glob
import subprocess
# from subprocess import CalledProcessError
DIR = '/home/nils/birdhouse/var/lib/pywps/cache/flyingpigeon/scihub.copernicus/S2B_MSIL1C_20171220T092359_N0206_R093_T33PVL_20171220T130518.SAFE'
jps = []
for filename in glob.glob(DIR + '/GRANULE/*/IMG_DATA/*jp2... | 30.344743 | 202 | 0.655386 |
119477ec95f872983b7c60921ee299022b4f88c9 | 154 | py | Python | tests/installation_test.py | Fladdimir/casymda | 6cf599bed2229c4aff9bca31350604b38ef76138 | [
"MIT"
] | 19 | 2020-04-18T14:47:37.000Z | 2022-03-26T14:18:21.000Z | tests/installation_test.py | Fladdimir/casymda | 6cf599bed2229c4aff9bca31350604b38ef76138 | [
"MIT"
] | 4 | 2020-03-17T21:01:58.000Z | 2021-09-24T21:07:25.000Z | tests/installation_test.py | Fladdimir/casymda | 6cf599bed2229c4aff9bca31350604b38ef76138 | [
"MIT"
] | 4 | 2020-05-09T16:31:57.000Z | 2022-01-23T09:11:19.000Z | """test the installation"""
from casymda import __version__
def test_version():
"""version should not be none"""
assert __version__ is not None
| 19.25 | 36 | 0.714286 |
fd74b01d1563778d805c95a60cfd8f9cb5f88b65 | 771 | py | Python | 482. License Key Formatting.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 482. License Key Formatting.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 482. License Key Formatting.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | """Something wrong with Leetcode's testing"""
class Solution(object):
def licenseKeyFormatting(self, S, K):
"""
:type S: str
:type K: int
:rtype: str
"""
parts = S.split('-')
words = list()
buff = list()
for i in xrange(len(parts)-1, -1, -1):
... | 28.555556 | 47 | 0.424125 |
88138193a632ac135fe2ccad994ebe78396f92ee | 6,930 | py | Python | src/tests/ftest/pool/BadConnect.py | phylcrandall/daos | 7a6adf9733f12538afcea44cced450b0fd4ad31d | [
"Apache-2.0"
] | null | null | null | src/tests/ftest/pool/BadConnect.py | phylcrandall/daos | 7a6adf9733f12538afcea44cced450b0fd4ad31d | [
"Apache-2.0"
] | null | null | null | src/tests/ftest/pool/BadConnect.py | phylcrandall/daos | 7a6adf9733f12538afcea44cced450b0fd4ad31d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
(C) Copyright 2018 Intel Corporation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | 37.258065 | 79 | 0.607792 |
48ecd22898b49c7ef0759ce72240197290218b55 | 2,440 | py | Python | fedimap/user_agent_test.py | VyrCossont/fedimap | ba945a4be70277d1af6683825f16c45016edfd09 | [
"MIT"
] | null | null | null | fedimap/user_agent_test.py | VyrCossont/fedimap | ba945a4be70277d1af6683825f16c45016edfd09 | [
"MIT"
] | null | null | null | fedimap/user_agent_test.py | VyrCossont/fedimap | ba945a4be70277d1af6683825f16c45016edfd09 | [
"MIT"
] | null | null | null | import unittest
from fedimap.user_agent import InstanceUserAgent, classify_user_agent
class TestAccessLog(unittest.TestCase):
def test_mastodon(self):
expected = InstanceUserAgent(
pattern_name='mastodon',
server='Mastodon',
version='2.6.5',
url='https://ex... | 38.125 | 96 | 0.636475 |
ffa632a01ffef3947a59aa8dab3a312d4e0c376c | 7,497 | py | Python | discovery-provider/tests/test_profile_completion_challenge.py | atticwip/audius-protocol | 9758e849fae01508fa1d27675741228b11533e6e | [
"Apache-2.0"
] | null | null | null | discovery-provider/tests/test_profile_completion_challenge.py | atticwip/audius-protocol | 9758e849fae01508fa1d27675741228b11533e6e | [
"Apache-2.0"
] | null | null | null | discovery-provider/tests/test_profile_completion_challenge.py | atticwip/audius-protocol | 9758e849fae01508fa1d27675741228b11533e6e | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import redis
from src.models import User, Block, Repost, RepostType, Save, Follow, SaveType
from src.utils.db_session import get_db
from src.challenges.profile_challenge import profile_challenge_manager
from src.challenges.challenge_event_bus import ChallengeEventBus, ChallengeEvent
from s... | 36.931034 | 118 | 0.612112 |
a3b53067bc38e436509573ad81a522ee66f9f072 | 58,328 | py | Python | dense_correspondence/dataset/spartan_dataset_masked.py | htung0101/pytorch-dense-correspondence | 5a6eb07e4fec63d0d24a25712c0094255fb310e3 | [
"BSD-3-Clause"
] | null | null | null | dense_correspondence/dataset/spartan_dataset_masked.py | htung0101/pytorch-dense-correspondence | 5a6eb07e4fec63d0d24a25712c0094255fb310e3 | [
"BSD-3-Clause"
] | null | null | null | dense_correspondence/dataset/spartan_dataset_masked.py | htung0101/pytorch-dense-correspondence | 5a6eb07e4fec63d0d24a25712c0094255fb310e3 | [
"BSD-3-Clause"
] | null | null | null | from dense_correspondence.dataset.dense_correspondence_dataset_masked import DenseCorrespondenceDataset, ImageType
import os
import numpy as np
import logging
import glob
import random
import copy
import torch
# note that this is the torchvision provided by the warmspringwinds
# pytorch-segmentation-detection repo. ... | 43.463487 | 227 | 0.636247 |
5a241865c18a007645c6d26e1b21ee4a72faf881 | 184 | py | Python | openregister/representations/txt.py | psd/openregister | 7aa831464f2917c5be7a5ae34ff4c0de96451811 | [
"MIT"
] | null | null | null | openregister/representations/txt.py | psd/openregister | 7aa831464f2917c5be7a5ae34ff4c0de96451811 | [
"MIT"
] | null | null | null | openregister/representations/txt.py | psd/openregister | 7aa831464f2917c5be7a5ae34ff4c0de96451811 | [
"MIT"
] | null | null | null | from ..item import Item
from .yaml import Writer as _Writer
from .yaml import load, dump
content_type = "text/plain; charset=utf-8"
Writer = _Writer
Item.txt = property(dump, load)
| 18.4 | 42 | 0.744565 |
829f3767953f60f285df0a404cf20b1f4ea50660 | 8,864 | py | Python | server/service/manager/bike_connection_manager.py | dragorhast/server | a5ad238e630c3b575e3bc3c51718e7ebfff1e4d1 | [
"MIT"
] | 5 | 2018-11-28T11:33:25.000Z | 2022-03-27T12:50:02.000Z | server/service/manager/bike_connection_manager.py | dragorhast/server | a5ad238e630c3b575e3bc3c51718e7ebfff1e4d1 | [
"MIT"
] | 124 | 2018-10-07T21:31:02.000Z | 2019-03-26T11:51:00.000Z | server/service/manager/bike_connection_manager.py | dragorhast/server | a5ad238e630c3b575e3bc3c51718e7ebfff1e4d1 | [
"MIT"
] | null | null | null | """
Bike Connection Manager
-----------------------
The bike connection manager handles all currently connected bikes, allowing users
to send and receive information requests as well as caching the most recent location.
Responsibilities
================
This object handles everything needed for connected bikes.
- t... | 40.474886 | 120 | 0.677234 |
dd58049c1581211d119be7af849f89cfef377d17 | 12,500 | py | Python | reports/nova_usage_audit.py | PreetiKamble29/stacktach | f4f905393a0d7eaa226a72b6a27b61e4ef52211d | [
"Apache-2.0"
] | null | null | null | reports/nova_usage_audit.py | PreetiKamble29/stacktach | f4f905393a0d7eaa226a72b6a27b61e4ef52211d | [
"Apache-2.0"
] | 4 | 2020-02-28T10:27:34.000Z | 2022-02-02T01:13:09.000Z | reports/nova_usage_audit.py | PreetiKamble29/stacktach | f4f905393a0d7eaa226a72b6a27b61e4ef52211d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.537538 | 81 | 0.61688 |
38c7e28854f3bc00a51a815b202f5c52cecdc753 | 27,518 | py | Python | ml3d/tf/models/randlanet.py | krshrimali/Open3D-ML | e6352ee84d38a4b90c71dd7f376f5570fe849537 | [
"MIT"
] | 1 | 2022-03-30T05:15:06.000Z | 2022-03-30T05:15:06.000Z | ml3d/tf/models/randlanet.py | krshrimali/Open3D-ML | e6352ee84d38a4b90c71dd7f376f5570fe849537 | [
"MIT"
] | null | null | null | ml3d/tf/models/randlanet.py | krshrimali/Open3D-ML | e6352ee84d38a4b90c71dd7f376f5570fe849537 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from tqdm import tqdm
from sklearn.neighbors import KDTree
from .base_model import BaseModel
from ...datasets.augment import SemsegAugmentation
from ...utils import MODEL
from ...datasets.utils import (DataProcessing, trans_normalize, trans_crop_pc)
class RandLANet(BaseMod... | 37.337856 | 116 | 0.544226 |
5c91d9242a2178372c23e308049f2738943b2a35 | 11,606 | py | Python | scipy/misc/common.py | ChadFulton/scipy | 0e9ff35d1498fe9bb89053188abc3dd24b02d193 | [
"BSD-3-Clause"
] | 1 | 2019-04-27T16:04:14.000Z | 2019-04-27T16:04:14.000Z | scipy/misc/common.py | joferkington/scipy | 6a7327e8bb8248b2ea165180bc602edf1ab33dda | [
"BSD-3-Clause"
] | null | null | null | scipy/misc/common.py | joferkington/scipy | 6a7327e8bb8248b2ea165180bc602edf1ab33dda | [
"BSD-3-Clause"
] | null | null | null | """
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from __future__ import division, print_function, absolute_import
import numpy
import numpy as np
from numpy import (exp, log, asarray, arange, newaxis, hstack, product, array,
zeros, eye, poly1d, r_, sum, ... | 26.497717 | 93 | 0.561434 |
f9c535ac6deabb525de6f0aaa2eddef0d264427f | 4,223 | py | Python | client/paddleflow/pipeline/dsl/compiler/step_compiler.py | qiaoshuangshuang/PaddleFlow | 15155a553587f18b09d4edfc604cb64a1fbe01a7 | [
"Apache-2.0"
] | 23 | 2021-12-31T02:36:13.000Z | 2022-03-29T07:38:43.000Z | client/paddleflow/pipeline/dsl/compiler/step_compiler.py | qiaoshuangshuang/PaddleFlow | 15155a553587f18b09d4edfc604cb64a1fbe01a7 | [
"Apache-2.0"
] | 10 | 2022-01-05T08:47:37.000Z | 2022-03-29T11:59:43.000Z | client/paddleflow/pipeline/dsl/compiler/step_compiler.py | qiaoshuangshuang/PaddleFlow | 15155a553587f18b09d4edfc604cb64a1fbe01a7 | [
"Apache-2.0"
] | 19 | 2021-12-30T14:37:24.000Z | 2022-03-23T03:30:32.000Z | #!/usr/bin/env python3
"""
Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
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... | 29.739437 | 96 | 0.602179 |
f3dbfddd32b93a9fbe9e1133db3b2bcbc74bcab6 | 685 | py | Python | titanium_silver/cpp_lang.py | Rahul-RB/titanium-silver | 7d62e194e26adf15e26f6a84cbfc454cf5db5a7e | [
"MIT"
] | 1 | 2019-09-13T18:55:43.000Z | 2019-09-13T18:55:43.000Z | titanium_silver/cpp_lang.py | Rahul-RB/titanium-silver | 7d62e194e26adf15e26f6a84cbfc454cf5db5a7e | [
"MIT"
] | 1 | 2019-04-22T15:49:49.000Z | 2019-04-22T15:49:50.000Z | titanium_silver/cpp_lang.py | Rahul-RB/titanium-silver | 7d62e194e26adf15e26f6a84cbfc454cf5db5a7e | [
"MIT"
] | null | null | null | import os
from titanium_silver.lang_container import LangContainer
class CppContainer(LangContainer):
def __init__(self):
pass
def run_container(self, cli):
self.configure()
# pdb.set_trace()
return super().run_container(cli)
def configure(self):
container_no = se... | 34.25 | 210 | 0.640876 |
de2689ef6572e4bb39466485df320a594b4abc12 | 235,996 | py | Python | riptable/tests/test_merge.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | null | null | null | riptable/tests/test_merge.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | null | null | null | riptable/tests/test_merge.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | null | null | null | from collections import Counter
import operator
import unittest
import pytest
import itertools
from typing import Tuple, List, NamedTuple, Optional, Union
import numpy
import numpy as np
from numpy.testing import assert_array_equal, assert_array_compare
import riptable as rt
from riptable.rt_utils import no... | 35.47745 | 213 | 0.492741 |
d982d218550bf3328402a88481f4fd88ab1ff571 | 771 | py | Python | portal/migrations/versions/91351a73e6e2_.py | ivan-c/truenth-portal | 0b9d39ae43f42ea3413ed9634f295f5d856cbc77 | [
"BSD-3-Clause"
] | 3 | 2017-01-15T10:11:57.000Z | 2018-10-02T23:46:44.000Z | portal/migrations/versions/91351a73e6e2_.py | pep8speaks/true_nth_usa_portal | 31ff755b0cfe61ab908e2a399e3c41ef17ca8c16 | [
"BSD-3-Clause"
] | 876 | 2016-04-04T20:45:11.000Z | 2019-02-28T00:10:36.000Z | portal/migrations/versions/91351a73e6e2_.py | pep8speaks/true_nth_usa_portal | 31ff755b0cfe61ab908e2a399e3c41ef17ca8c16 | [
"BSD-3-Clause"
] | 9 | 2016-04-13T01:18:55.000Z | 2018-09-19T20:44:23.000Z | from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: 91351a73e6e2
Revises: 63262fe95b9c
Create Date: 2018-03-08 15:34:22.391417
"""
# revision identifiers, used by Alembic.
revision = '91351a73e6e2'
down_revision = '63262fe95b9c'
def upgrade():
# ### commands auto generated by Alembic ... | 26.586207 | 80 | 0.712062 |
ae2f267d782bfa6e5151f5ac6409302b273f8c99 | 2,484 | py | Python | pythonparser/test/test_diagnostic.py | OxfordIonTrapGroup/pythonparser | 960c8fac329e45592b082bc411eaf2552f92048c | [
"MIT"
] | 67 | 2016-01-05T19:15:55.000Z | 2022-03-02T12:16:56.000Z | pythonparser/test/test_diagnostic.py | OxfordIonTrapGroup/pythonparser | 960c8fac329e45592b082bc411eaf2552f92048c | [
"MIT"
] | 23 | 2015-09-01T13:36:21.000Z | 2021-12-20T09:00:39.000Z | pythonparser/test/test_diagnostic.py | OxfordIonTrapGroup/pythonparser | 960c8fac329e45592b082bc411eaf2552f92048c | [
"MIT"
] | 19 | 2016-11-04T07:59:07.000Z | 2022-03-25T17:05:39.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from .. import source, diagnostic
import unittest
class DiagnosticTestCase(unittest.TestCase):
def setUp(self):
self.buffer = source.Buffer("x + (1 + 'a')\n")
def test_message(self):
diag = diagnostic.Diagnosti... | 37.636364 | 82 | 0.559581 |
ce1aabfa5ea6f6f9d301e776b80de7e2f48ce193 | 3,024 | py | Python | website/crawl/scr/scr/settings.py | eternidad33/docsearch | 8e7ab4600c99389d6bbe7d0264825dd31705ffe7 | [
"MIT"
] | 8 | 2021-03-13T10:22:15.000Z | 2021-12-30T12:46:25.000Z | website/crawl/scr/scr/settings.py | eternidad33/docsearch | 8e7ab4600c99389d6bbe7d0264825dd31705ffe7 | [
"MIT"
] | null | null | null | website/crawl/scr/scr/settings.py | eternidad33/docsearch | 8e7ab4600c99389d6bbe7d0264825dd31705ffe7 | [
"MIT"
] | 6 | 2021-03-30T15:22:10.000Z | 2021-12-30T12:50:56.000Z | # Scrapy settings for scr project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.htm... | 33.977528 | 103 | 0.77381 |
d93184bf1d3be884417d7b657efd66401785e1c2 | 1,499 | py | Python | testproject/tests.py | RichardOfWard/djapps | dd1f20619cf0c4d3d364cedf0fce8bcc503a262d | [
"BSD-3-Clause"
] | 2 | 2015-05-18T13:50:28.000Z | 2015-05-18T14:47:13.000Z | testproject/tests.py | RichardOfWard/djapps | dd1f20619cf0c4d3d364cedf0fce8bcc503a262d | [
"BSD-3-Clause"
] | null | null | null | testproject/tests.py | RichardOfWard/djapps | dd1f20619cf0c4d3d364cedf0fce8bcc503a262d | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
from unittest import TestCase as BaseTestCase
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testproject.settings")
class TestCase(BaseTestCase):
def assertIs(self, a, b):
if sys.version_info[:2] == (2, 6):
return self.assertTrue(a is b)
else:
return ... | 28.826923 | 71 | 0.66511 |
c67bc44ae9eb5c6f52648b94d79549b347f49ac9 | 9,848 | py | Python | tf/convert/tf.py | ancient-data/text-fabric | c1ccd4a4dc451e94a789f138576576c5d7f13474 | [
"MIT"
] | 10 | 2017-10-30T22:38:00.000Z | 2018-12-12T06:10:10.000Z | tf/convert/tf.py | dirkroorda/text-fabric | c0a49f092ceda3e7bab91fd0f1aa84e2dc029cf4 | [
"MIT"
] | 37 | 2017-10-19T12:06:54.000Z | 2018-12-13T10:18:23.000Z | tf/convert/tf.py | dirkroorda/text-fabric | c0a49f092ceda3e7bab91fd0f1aa84e2dc029cf4 | [
"MIT"
] | 3 | 2018-02-28T12:37:21.000Z | 2018-06-23T08:32:54.000Z | """
# Raw, unoptimized data from TF files
"""
import sys
import os
from ..core.helpers import normpath, expanduser, unexpanduser
DATA_TYPES = ("str", "int")
DATA_TYPE_STR = ", ".join(DATA_TYPES)
def explode(inPath, outPath):
"""Explodes .tf files into non-optimized .tf files without metadata.
An exploded... | 30.968553 | 87 | 0.487307 |
d6ecd33d9c1ff76ad786cb4fb00cc5c2196d6ebe | 1,414 | py | Python | loan/model_evaluate.py | ahmed14-cell/loan-prediction | cbc76fe557d38c259a993b7649a92c18a96295e4 | [
"MIT"
] | null | null | null | loan/model_evaluate.py | ahmed14-cell/loan-prediction | cbc76fe557d38c259a993b7649a92c18a96295e4 | [
"MIT"
] | null | null | null | loan/model_evaluate.py | ahmed14-cell/loan-prediction | cbc76fe557d38c259a993b7649a92c18a96295e4 | [
"MIT"
] | null | null | null | """This script evaluates the accuracy of the model trained."""
import numpy as np
from config import Config
from pipeline import Workflow
from sklearn.metrics import precision_score, recall_score, accuracy_score
from sklearn.metrics import f1_score
from sklearn.model_selection import cross_val_predict
# Create a file ... | 37.210526 | 73 | 0.788543 |
f1a84836fb422e6a612c0fe121049b8f7143bfb1 | 66 | py | Python | regal/__init__.py | psurply/ReGAL | b0634a64b141ed34969d8e3c54073da2904bb345 | [
"MIT"
] | 43 | 2018-06-03T12:40:43.000Z | 2022-01-31T07:55:54.000Z | regal/__init__.py | psurply/ReGAL | b0634a64b141ed34969d8e3c54073da2904bb345 | [
"MIT"
] | 4 | 2019-12-26T10:01:21.000Z | 2020-08-17T02:56:20.000Z | regal/__init__.py | psurply/ReGAL | b0634a64b141ed34969d8e3c54073da2904bb345 | [
"MIT"
] | 5 | 2021-05-27T00:26:11.000Z | 2022-01-01T12:25:12.000Z | from regal.pnr.pnr import pnr
from regal.synth.synth import synth
| 22 | 35 | 0.818182 |
66f0cfb81ce2aae5ed42eabcc39b693c13c1dc71 | 7,079 | py | Python | conductor/clients/parameter_values_control.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 1 | 2020-11-30T01:45:08.000Z | 2020-11-30T01:45:08.000Z | conductor/clients/parameter_values_control.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 8 | 2021-02-23T00:18:12.000Z | 2022-03-12T00:54:50.000Z | conductor/clients/parameter_values_control.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 1 | 2020-11-08T14:54:21.000Z | 2020-11-08T14:54:21.000Z | import json
import numpy as np
import sys
import collections
import variables_config
from PyQt4 import QtGui, QtCore, Qt
from PyQt4.QtCore import pyqtSignal
from twisted.internet.defer import inlineCallbacks
sys.path.append('../../client_tools')
from connection import connection
from widgets import NeatSpinBox
clas... | 34.70098 | 87 | 0.648679 |
ea2f0cfe726356cbc59e74024f5b7ba673c2e25d | 8,623 | py | Python | rename.py | mateusjdev/Rename-to-hash | 7d943a6b4935c0541990d62c7f420dd50539da9a | [
"MIT"
] | null | null | null | rename.py | mateusjdev/Rename-to-hash | 7d943a6b4935c0541990d62c7f420dd50539da9a | [
"MIT"
] | null | null | null | rename.py | mateusjdev/Rename-to-hash | 7d943a6b4935c0541990d62c7f420dd50539da9a | [
"MIT"
] | null | null | null | import os
import sys
import hashlib
import json
import argparse
def hash(file, method):
if not os.path.isdir(file):
f = open(file, 'rb')
sum = ""
if method == "sha1":
sum = hashlib.sha1(f.read()).hexdigest()
elif method == "sha224":
sum = hashlib.sha224(f.re... | 35.195918 | 99 | 0.497043 |
daf242ac5140b8ef75d3d1254419cda5cc3091ec | 15,420 | py | Python | rllib/tests/test_nested_observation_spaces.py | roalexan/ray | f097427382de84e1697fbd3121ac4ed0f5629b0c | [
"Apache-2.0"
] | 1 | 2021-02-04T00:19:27.000Z | 2021-02-04T00:19:27.000Z | rllib/tests/test_nested_observation_spaces.py | roalexan/ray | f097427382de84e1697fbd3121ac4ed0f5629b0c | [
"Apache-2.0"
] | null | null | null | rllib/tests/test_nested_observation_spaces.py | roalexan/ray | f097427382de84e1697fbd3121ac4ed0f5629b0c | [
"Apache-2.0"
] | null | null | null | from gym import spaces
from gym.envs.registration import EnvSpec
import gym
import pickle
import unittest
import ray
from ray.rllib.agents.a3c import A2CTrainer
from ray.rllib.agents.pg import PGTrainer
from ray.rllib.agents.pg.pg_tf_policy import PGTFPolicy
from ray.rllib.env import MultiAgentEnv
from ray.rllib.env.b... | 34.808126 | 78 | 0.566083 |
e283b0a9e1d305f946cc5ffeb0286eb1e9d00409 | 1,073 | py | Python | LeetCode/0075. Sort Colors/Solution.py | InnoFang/oh-my-algorithms | f559dba371ce725a926725ad28d5e1c2facd0ab2 | [
"Apache-2.0"
] | 19 | 2018-08-26T03:10:58.000Z | 2022-03-07T18:12:52.000Z | LeetCode/0075. Sort Colors/Solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | null | null | null | LeetCode/0075. Sort Colors/Solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | 6 | 2020-03-16T23:00:06.000Z | 2022-01-13T07:02:08.000Z | class Solution:
def sortColors(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
-----------------------------------------
86 / 86 test cases passed.
Status: Accepted
Runtime: 59 ms
"""
ze... | 24.953488 | 74 | 0.437092 |
aa6fb5e3ca4ae946fbdd0e4d114ed7a5acd5cb6f | 771 | py | Python | reporeport.py | evmaksimenko/reporeport | 8196fc3fa2ce57fe8713b98247d39dd8d54ccbb6 | [
"Apache-2.0"
] | null | null | null | reporeport.py | evmaksimenko/reporeport | 8196fc3fa2ce57fe8713b98247d39dd8d54ccbb6 | [
"Apache-2.0"
] | null | null | null | reporeport.py | evmaksimenko/reporeport | 8196fc3fa2ce57fe8713b98247d39dd8d54ccbb6 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import util.common as common
import util.reporter as rep
log_format = '%(filename)s[LINE:%(lineno)3d]# %(levelname)-8s %(message)s'
logging.basicConfig(format=log_format, level=logging.ERROR)
if __name__ == "__main__":
params = common.parse_input_parameters()
work_dir = common.get_... | 28.555556 | 75 | 0.713359 |
4d5554886c9c3882c02b90883acbfc47d56d7766 | 746 | py | Python | code/922.sort-array-by-parity-ii.py | ProHiryu/leetcode | 1f42a102ab89b6e7c20f38dd8b435255f2ab4418 | [
"MIT"
] | 3 | 2019-01-24T03:22:51.000Z | 2021-09-10T14:52:42.000Z | code/922.sort-array-by-parity-ii.py | ProHiryu/leetcode | 1f42a102ab89b6e7c20f38dd8b435255f2ab4418 | [
"MIT"
] | null | null | null | code/922.sort-array-by-parity-ii.py | ProHiryu/leetcode | 1f42a102ab89b6e7c20f38dd8b435255f2ab4418 | [
"MIT"
] | 2 | 2019-10-15T04:24:51.000Z | 2020-12-16T02:40:55.000Z | #
# @lc app=leetcode id=922 lang=python3
#
# [922] Sort Array By Parity II
#
# @lc code=start
class Solution:
def sortArrayByParityII(self, a: List[int]) -> List[int]:
i = 0 # pointer for even misplaced
j = 1 # pointer for odd misplaced
sz = len(a)
# invariant: for every mi... | 24.064516 | 68 | 0.451743 |
b34f49a5da820e8a14edb0086dcf0de8a1913833 | 4,833 | py | Python | cifar10_models/vgg.py | ufukefe/PyTorch_CIFAR10 | 366ebaaf47e975c1f540232e77fd1a180e961f05 | [
"MIT"
] | 292 | 2020-04-19T05:00:10.000Z | 2022-03-25T03:46:58.000Z | cifar10_models/vgg.py | ufukefe/PyTorch_CIFAR10 | 366ebaaf47e975c1f540232e77fd1a180e961f05 | [
"MIT"
] | 12 | 2020-05-13T14:12:39.000Z | 2021-07-01T15:31:05.000Z | cifar10_models/vgg.py | ufukefe/PyTorch_CIFAR10 | 366ebaaf47e975c1f540232e77fd1a180e961f05 | [
"MIT"
] | 107 | 2020-05-05T10:05:02.000Z | 2022-03-19T05:13:32.000Z | import os
import torch
import torch.nn as nn
__all__ = [
"VGG",
"vgg11_bn",
"vgg13_bn",
"vgg16_bn",
"vgg19_bn",
]
class VGG(nn.Module):
def __init__(self, features, num_classes=10, init_weights=True):
super(VGG, self).__init__()
self.features = features
# CIFAR 10 (7,... | 27.936416 | 86 | 0.543555 |
32fb338307c925e532195b569206e304648c6475 | 7,374 | py | Python | object_detector/lcd_api.py | pranav-nb/raspberry_pi_pico | 0bf19dee46eb61bfbdd67805e44ac45b14185fc7 | [
"Unlicense"
] | null | null | null | object_detector/lcd_api.py | pranav-nb/raspberry_pi_pico | 0bf19dee46eb61bfbdd67805e44ac45b14185fc7 | [
"Unlicense"
] | null | null | null | object_detector/lcd_api.py | pranav-nb/raspberry_pi_pico | 0bf19dee46eb61bfbdd67805e44ac45b14185fc7 | [
"Unlicense"
] | null | null | null | import time
class LcdApi:
"""Implements the API for talking with HD44780 compatible character LCDs.
This class only knows what commands to send to the LCD, and not how to get
them to the LCD.
It is expected that a derived class will implement the hal_xxx functions.
"""
# The following... | 36.87 | 79 | 0.587876 |
b3a8ae6e370076235e189824bcccd96a67069c21 | 27,168 | py | Python | jax/experimental/jax2tf/shape_poly.py | LenaMartens/jax | ddaef095bbef6571fd4f790e046db2b08bcfb964 | [
"Apache-2.0"
] | null | null | null | jax/experimental/jax2tf/shape_poly.py | LenaMartens/jax | ddaef095bbef6571fd4f790e046db2b08bcfb964 | [
"Apache-2.0"
] | null | null | null | jax/experimental/jax2tf/shape_poly.py | LenaMartens/jax | ddaef095bbef6571fd4f790e046db2b08bcfb964 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.841689 | 149 | 0.667955 |
df923cfb81bb9f497f839feb072ea52282cecc43 | 131,703 | py | Python | keystone/tests/unit/test_v3_assignment.py | nuxeh/keystone | ae61c5c081e1917213ef94e33dda43ae0c9c4b55 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_v3_assignment.py | nuxeh/keystone | ae61c5c081e1917213ef94e33dda43ae0c9c4b55 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_v3_assignment.py | nuxeh/keystone | ae61c5c081e1917213ef94e33dda43ae0c9c4b55 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 42.198975 | 79 | 0.615096 |
cbde86244896cf5e21280e2ee007e5f1153b7a08 | 13,404 | py | Python | onmt/modules/Transformer/Layers.py | tecdan/Pretrained_Models_NMT | 58b4a873ff03fbba0c438c8e846eef19c897866a | [
"MIT"
] | 1 | 2021-12-05T10:25:53.000Z | 2021-12-05T10:25:53.000Z | onmt/modules/Transformer/Layers.py | tecdan/Pretrained_Models_NMT | 58b4a873ff03fbba0c438c8e846eef19c897866a | [
"MIT"
] | null | null | null | onmt/modules/Transformer/Layers.py | tecdan/Pretrained_Models_NMT | 58b4a873ff03fbba0c438c8e846eef19c897866a | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.init as init
import torch.nn.utils.weight_norm as WeightNorm
import onmt
import torch.nn.functional as F
from onmt.modules.Bottle import Bottle
from onmt.modules.StaticDropout import StaticDropout
from onmt.modules.Linea... | 36.523161 | 156 | 0.615936 |
832131384d27d698a9b7420623ac5096042f628d | 832 | py | Python | Lab3/ENGR 102 Lab 3/Lab 3-Activity 2 Team2.py | iconjone/Engineering-102 | a59518b667f42e14be49e6c9d96ed21a53a4e748 | [
"MIT"
] | null | null | null | Lab3/ENGR 102 Lab 3/Lab 3-Activity 2 Team2.py | iconjone/Engineering-102 | a59518b667f42e14be49e6c9d96ed21a53a4e748 | [
"MIT"
] | null | null | null | Lab3/ENGR 102 Lab 3/Lab 3-Activity 2 Team2.py | iconjone/Engineering-102 | a59518b667f42e14be49e6c9d96ed21a53a4e748 | [
"MIT"
] | null | null | null | # By submitting this assignment, all team members agree to the following:
# “Aggies do not lie, cheat, or steal, or tolerate those who do”
# “I have not given or received any unauthorized aid on this assignment”
#
# Names: Evan Farkas
# Tarik Dawson
# Section: 510
# Assignment: Lab Assignment 3
# Date: ... | 37.818182 | 73 | 0.694712 |
fe06f986bf52d85d069e16ebe9440440c7ec756e | 29,259 | py | Python | test/test_dhcp6.py | ydy1234/vpp | 9f9e969f149e40044fee9d2e47b7dd96f3ae4dfa | [
"Apache-2.0"
] | 1 | 2020-05-21T16:26:02.000Z | 2020-05-21T16:26:02.000Z | test/test_dhcp6.py | ydy1234/vpp | 9f9e969f149e40044fee9d2e47b7dd96f3ae4dfa | [
"Apache-2.0"
] | 2 | 2018-09-10T21:43:09.000Z | 2021-06-01T22:36:51.000Z | test/test_dhcp6.py | ydy1234/vpp | 9f9e969f149e40044fee9d2e47b7dd96f3ae4dfa | [
"Apache-2.0"
] | 1 | 2018-09-04T09:01:23.000Z | 2018-09-04T09:01:23.000Z | from scapy.layers.dhcp6 import DHCP6_Advertise, DHCP6OptClientId, \
DHCP6OptStatusCode, DHCP6OptPref, DHCP6OptIA_PD, DHCP6OptIAPrefix, \
DHCP6OptServerId, DHCP6_Solicit, DHCP6_Reply, DHCP6_Request, DHCP6_Renew, \
DHCP6_Rebind, DUID_LL, DHCP6_Release, DHCP6OptElapsedTime, DHCP6OptIA_NA, \
DHCP6OptIAAddre... | 37.802326 | 79 | 0.592946 |
f21bfaf7bc30a88a91e29c9ace6115083ad48938 | 8,660 | py | Python | main_hyperparams.py | bamtercelboo/pytorch_Sequence_Label | 0f3a5b1a0e9cd8b97ce5b78ee0ee2682996cc542 | [
"Apache-2.0"
] | 6 | 2018-03-28T02:24:46.000Z | 2020-09-27T02:26:50.000Z | main_hyperparams.py | bamtercelboo/pytorch_Sequence_Label | 0f3a5b1a0e9cd8b97ce5b78ee0ee2682996cc542 | [
"Apache-2.0"
] | null | null | null | main_hyperparams.py | bamtercelboo/pytorch_Sequence_Label | 0f3a5b1a0e9cd8b97ce5b78ee0ee2682996cc542 | [
"Apache-2.0"
] | null | null | null | # @Author : bamtercelboo
# @Datetime : 2018/1/30 19:50
# @File : main_hyperparams.py.py
# @Last Modify Time : 2018/1/30 19:50
# @Contact : bamtercelboo@{gmail.com, 163.com}
"""
FILE : main_hyperparams.py.py
FUNCTION : main
"""
import os
import sys
import argparse
import datetime
import torch
from DataLoader.... | 48.379888 | 158 | 0.712471 |
fe51672bf4e41da374abd0895b4bdfe36adc23c2 | 232 | py | Python | tests/unit/test_cli.py | neuro-inc/neuro-flow | 5f793112a63bd27a6cc608ed6bc13e403943d213 | [
"Apache-2.0"
] | 13 | 2020-09-29T17:07:01.000Z | 2021-08-02T02:54:31.000Z | tests/unit/test_cli.py | neuro-inc/neuro-flow | 5f793112a63bd27a6cc608ed6bc13e403943d213 | [
"Apache-2.0"
] | 163 | 2020-09-30T08:50:06.000Z | 2022-03-25T01:04:43.000Z | tests/unit/test_cli.py | neuromation/neuro-flow | c29d61247a4afa3b341474d226e08e976f59345c | [
"Apache-2.0"
] | 1 | 2021-04-14T05:44:34.000Z | 2021-04-14T05:44:34.000Z | def test_imports_ok() -> None:
# This test verifies that cli at least imports properly on
# in all supported envs and python versions
#
# Will be replaced with some proper e2e tests
import neuro_flow.cli # noqa
| 33.142857 | 62 | 0.702586 |
e83d0bb6a498d34ef5dcdd31819e4595289f5671 | 75 | py | Python | tests/bundles/sqlalchemy/_bundles/backref/__init__.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | 69 | 2018-10-10T01:59:11.000Z | 2022-03-29T17:29:30.000Z | tests/bundles/sqlalchemy/_bundles/backref/__init__.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | 18 | 2018-11-17T12:42:02.000Z | 2021-05-22T18:45:27.000Z | tests/bundles/sqlalchemy/_bundles/backref/__init__.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | 7 | 2018-10-12T16:20:25.000Z | 2021-10-06T12:18:21.000Z | from flask_unchained import Bundle
class BackrefBundle(Bundle):
pass
| 12.5 | 34 | 0.786667 |
5453b05e45ae584a1e1c07af473fbb448b661341 | 6,255 | py | Python | pbpstats/data_loader/nba_enhanced_pbp_loader.py | pauldevos/pbpstats | 71c0b5e2bd45d0ca031646c70cd1c1f30c6a7152 | [
"MIT"
] | null | null | null | pbpstats/data_loader/nba_enhanced_pbp_loader.py | pauldevos/pbpstats | 71c0b5e2bd45d0ca031646c70cd1c1f30c6a7152 | [
"MIT"
] | null | null | null | pbpstats/data_loader/nba_enhanced_pbp_loader.py | pauldevos/pbpstats | 71c0b5e2bd45d0ca031646c70cd1c1f30c6a7152 | [
"MIT"
] | null | null | null | import os
import json
from collections import defaultdict
from pbpstats import NBA_STRING
from pbpstats.overrides import IntDecoder
from pbpstats.resources.enhanced_pbp import FieldGoal, Foul, FreeThrow, StartOfPeriod
class NbaEnhancedPbpLoader(object):
"""
Class for shared methods between :obj:`~pbpstats.da... | 47.748092 | 143 | 0.624141 |
6a4218f5fea3558d10235934d2775da60e2c989c | 3,704 | py | Python | tool/dispatch.py | aistcrypt/Lifted-ElGamal | 48eabfe961d51989c988deaff73eb5a93f04331e | [
"BSD-3-Clause"
] | 18 | 2015-08-12T23:12:33.000Z | 2021-05-19T15:39:11.000Z | tool/dispatch.py | aistcrypt/Lifted-ElGamal | 48eabfe961d51989c988deaff73eb5a93f04331e | [
"BSD-3-Clause"
] | 2 | 2016-03-17T15:52:54.000Z | 2016-06-16T08:28:04.000Z | tool/dispatch.py | aistcrypt/Lifted-ElGamal | 48eabfe961d51989c988deaff73eb5a93f04331e | [
"BSD-3-Clause"
] | 4 | 2015-05-06T08:07:03.000Z | 2021-01-30T13:31:21.000Z | # switch dispatch method
# syntax
import sys, re
BASE_NAME = 'elgamal_impl::ElgamalT<elgamal_disp::local::FpType%d>::%s'
TYPE_NUM_TBL = [0, 3, 4, 6, 9]
# @dispatch(inClassName, code);
# inClassName : replace @inClassName in code with 'BASE_NAME % type + inClassName'
RE_BASE_FEATURE_NOSTR = re.compile('@baseFeatureNo... | 28.274809 | 134 | 0.656048 |
f2862b5b035b8721de31d8aeca4f7e36c390c7db | 75,539 | py | Python | nuitka/tree/ComplexCallHelperFunctions.py | sthagen/Nuitka-Nuitka | 023dc76eeafd9c53ee2a51931474ddd98a3ba083 | [
"Apache-2.0"
] | null | null | null | nuitka/tree/ComplexCallHelperFunctions.py | sthagen/Nuitka-Nuitka | 023dc76eeafd9c53ee2a51931474ddd98a3ba083 | [
"Apache-2.0"
] | null | null | null | nuitka/tree/ComplexCallHelperFunctions.py | sthagen/Nuitka-Nuitka | 023dc76eeafd9c53ee2a51931474ddd98a3ba083 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 35.036642 | 93 | 0.583672 |
b30d4afe9a490fd639bbf47444b2a5775cdf49c4 | 561 | py | Python | tests/python/initialization.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/python/initialization.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/python/initialization.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
"""
Verify that the common initialization pattern short-circuits correctly
"""
def foo(arg=None):
return arg or throw()
def throw():
raise NotImplementedError("on purpose")
def test()... | 14.384615 | 70 | 0.631016 |
496bccb9efabd573463d10568212d9b2a1ccb8f6 | 404 | py | Python | 234_Palindrome Linked List.py | carryking1988/carryleetcode | 9d6b353e8f235219d0b9e4feb131bfea6fe3ef21 | [
"MIT"
] | null | null | null | 234_Palindrome Linked List.py | carryking1988/carryleetcode | 9d6b353e8f235219d0b9e4feb131bfea6fe3ef21 | [
"MIT"
] | null | null | null | 234_Palindrome Linked List.py | carryking1988/carryleetcode | 9d6b353e8f235219d0b9e4feb131bfea6fe3ef21 | [
"MIT"
] | null | null | null | # Given the head of a singly linked list, return true if it is a palindrome.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
def isPalindrome(head):
rev = None
original_list = head
while original_list:
rev = ListNode(original_list.val,rev)
... | 28.857143 | 76 | 0.665842 |
55eecb3125f2718b869ac3f2aa91612cdd490611 | 1,644 | py | Python | send_to_influx.py | iandees/xfinity-to-influxdb | 8b95fe1bcb4a68f549b9c3d007a1cadb8f9f5f7c | [
"MIT"
] | null | null | null | send_to_influx.py | iandees/xfinity-to-influxdb | 8b95fe1bcb4a68f549b9c3d007a1cadb8f9f5f7c | [
"MIT"
] | null | null | null | send_to_influx.py | iandees/xfinity-to-influxdb | 8b95fe1bcb4a68f549b9c3d007a1cadb8f9f5f7c | [
"MIT"
] | null | null | null | import os
import sys
import time
from datetime import datetime
from influxdb import InfluxDBClient
from xfinity_usage.xfinity_usage import XfinityUsage
def main():
xfinity_username = os.environ.get('XFINITY_USERNAME')
xfinity_password = os.environ.get('XFINITY_PASSWORD')
if not (xfinity_username and xfini... | 28.344828 | 99 | 0.613139 |
403ab042a0646d55c1e095e46ab31ab3ec44b89a | 718 | py | Python | bartpy/diagnostics/diagnostics.py | OmerRonen/bartpy | bc6aae8bc1d09c33a66d463394e1cce8aed1608b | [
"MIT"
] | 147 | 2018-09-17T16:53:38.000Z | 2022-03-30T22:40:37.000Z | bartpy/diagnostics/diagnostics.py | OmerRonen/bartpy | bc6aae8bc1d09c33a66d463394e1cce8aed1608b | [
"MIT"
] | 35 | 2018-09-25T06:27:35.000Z | 2022-01-21T19:33:09.000Z | bartpy/diagnostics/diagnostics.py | OmerRonen/bartpy | bc6aae8bc1d09c33a66d463394e1cce8aed1608b | [
"MIT"
] | 24 | 2019-03-21T11:46:11.000Z | 2022-03-20T02:06:11.000Z | from matplotlib import pyplot as plt
from bartpy.diagnostics.residuals import plot_qq, plot_homoskedasity_diagnostics
from bartpy.diagnostics.sampling import plot_tree_mutation_acceptance_rate
from bartpy.diagnostics.sigma import plot_sigma_convergence
from bartpy.diagnostics.trees import plot_tree_depth
from bartpy.s... | 37.789474 | 80 | 0.793872 |
6aae82d1ccc187bd179d719674e58ff9aae14ddc | 2,026 | py | Python | src/amulet/command_line/curses_line.py | Amulet-Team/Amulet-cli | 3d4e5d05ff3fc4869baedcfebab9aa8e62dfb3db | [
"MIT"
] | 1 | 2019-09-28T23:35:01.000Z | 2019-09-28T23:35:01.000Z | src/amulet/command_line/curses_line.py | Amulet-Team/Amulet-cli | 3d4e5d05ff3fc4869baedcfebab9aa8e62dfb3db | [
"MIT"
] | null | null | null | src/amulet/command_line/curses_line.py | Amulet-Team/Amulet-cli | 3d4e5d05ff3fc4869baedcfebab9aa8e62dfb3db | [
"MIT"
] | null | null | null | import curses
from io import StringIO
class CursesProgram:
def __init__(self):
self._commands = {}
self._complex_commands = {}
# self._modes = ModeStack()
self._retry_modules = []
self._modules = []
# self._load_commands_and_modes()
self._entry_history = ... | 28.138889 | 81 | 0.513327 |
9e073a57fb1eade4bf157a04d367d65d64eccd80 | 3,091 | py | Python | tests/core/fixtures.py | jespino/chia-blockchain | 6518b2bf42d03b29e83d1701900dfb0ede52d5b0 | [
"Apache-2.0"
] | null | null | null | tests/core/fixtures.py | jespino/chia-blockchain | 6518b2bf42d03b29e83d1701900dfb0ede52d5b0 | [
"Apache-2.0"
] | 57 | 2021-05-04T06:27:04.000Z | 2022-03-22T17:05:47.000Z | tests/core/fixtures.py | jespino/chia-blockchain | 6518b2bf42d03b29e83d1701900dfb0ede52d5b0 | [
"Apache-2.0"
] | null | null | null | import pickle
import aiosqlite
import pytest
from typing import List
from pathlib import Path
from src.full_node.block_store import BlockStore
from src.consensus.blockchain import Blockchain
from src.full_node.coin_store import CoinStore
from src.types.full_block import FullBlock
from src.util.path import mkdir
from te... | 33.236559 | 99 | 0.717244 |
e2b1742dd4a7fec3cbeeff9f17745c206335b4dd | 12,316 | py | Python | kin_phase1/model/kin_cnn_models.py | leekh7411/ai-hackathon-2018 | 70bc064103bbf8ea960182027e239d7cd43539a1 | [
"MIT"
] | null | null | null | kin_phase1/model/kin_cnn_models.py | leekh7411/ai-hackathon-2018 | 70bc064103bbf8ea960182027e239d7cd43539a1 | [
"MIT"
] | null | null | null | kin_phase1/model/kin_cnn_models.py | leekh7411/ai-hackathon-2018 | 70bc064103bbf8ea960182027e239d7cd43539a1 | [
"MIT"
] | null | null | null | '''
old version models
keep for reuse
'''
import tensorflow as tf
import numpy as np
FLAGS = tf.app.flags.FLAGS
BN_EPSILON = 0.001
tf.app.flags.DEFINE_float('weight_decay', 0.0002, '''scale for l2 regularization''')
def summary_layer(layer1,layer2='None',tag='None'):
print('--------------------------------... | 43.519435 | 129 | 0.614404 |
a24b927a3aaa6bddb2c4f7050e3c39c35585fd9f | 28,705 | py | Python | tests/test_glue.py | pstanton237/cloud-custodian | a3c7fb077c69bc3472f6960887199e597539a512 | [
"Apache-2.0"
] | 1,787 | 2016-04-18T21:25:59.000Z | 2018-12-03T17:16:48.000Z | tests/test_glue.py | pstanton237/cloud-custodian | a3c7fb077c69bc3472f6960887199e597539a512 | [
"Apache-2.0"
] | 2,238 | 2016-04-19T22:21:50.000Z | 2018-12-03T22:45:56.000Z | tests/test_glue.py | pstanton237/cloud-custodian | a3c7fb077c69bc3472f6960887199e597539a512 | [
"Apache-2.0"
] | 650 | 2016-04-18T20:53:21.000Z | 2018-11-29T21:40:32.000Z | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
import time
import json
from c7n.exceptions import PolicyValidationError
from .common import event_data
class TestGlueConnections(BaseTest):
def test_connections_query(self):
session_factory = self... | 37.57199 | 115 | 0.528758 |
e02c9fac987b7e93b83ae12c1c4f5bc2885fe16e | 1,729 | py | Python | server/walmart.py | yanglinz/product-search | ad2c5d372944526dd2c6fe4888eb8920e39e2d26 | [
"MIT"
] | 1 | 2018-08-23T19:58:03.000Z | 2018-08-23T19:58:03.000Z | server/walmart.py | yanglinz/product-search | ad2c5d372944526dd2c6fe4888eb8920e39e2d26 | [
"MIT"
] | 10 | 2020-09-06T01:28:36.000Z | 2022-03-03T22:41:59.000Z | server/walmart.py | yanglinz/product-search | ad2c5d372944526dd2c6fe4888eb8920e39e2d26 | [
"MIT"
] | null | null | null | import requests
from django.conf import settings
class WalmartServiceException(Exception):
"""A generic custom exception for 400/500 errors from walmart API
"""
class WalmartServiceRecommendationMissingException(Exception):
"""A custom exception for missing recommendation for an item
"""
base_para... | 25.80597 | 69 | 0.686524 |
a99b71b9ef5dc9ddaf3750781b2587cd8cbcb7dd | 4,750 | py | Python | analysis/SWITCH.py | cpadavis/SpaceWarps | e25056b4b3f2df1c7348f18bc8e4995d91d2ac04 | [
"MIT"
] | null | null | null | analysis/SWITCH.py | cpadavis/SpaceWarps | e25056b4b3f2df1c7348f18bc8e4995d91d2ac04 | [
"MIT"
] | null | null | null | analysis/SWITCH.py | cpadavis/SpaceWarps | e25056b4b3f2df1c7348f18bc8e4995d91d2ac04 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# ======================================================================
import swap
import sys,getopt,time
import numpy as np
from client import *
# ======================================================================
def SWITCH(argv):
"""
NAME
SWITCH.py
PURPOSE
... | 30.844156 | 77 | 0.486105 |
9264c12fe897d5dec7b8694b0522b91ef20abb89 | 752 | py | Python | app/models/domain/users.py | ilya-goldin/kanban-board-app | 3c7026aedb0e21eaccc26a2ac4a37f0b6a91a122 | [
"MIT"
] | null | null | null | app/models/domain/users.py | ilya-goldin/kanban-board-app | 3c7026aedb0e21eaccc26a2ac4a37f0b6a91a122 | [
"MIT"
] | null | null | null | app/models/domain/users.py | ilya-goldin/kanban-board-app | 3c7026aedb0e21eaccc26a2ac4a37f0b6a91a122 | [
"MIT"
] | null | null | null | from app.models.common import DateTimeModelMixin, IDModelMixin
from app.models.domain.base import BaseDomainModel
from app.services import security
class User(BaseDomainModel):
username: str
email: str
first_name: str
last_name: str
is_active: bool
is_project_manager: bool
photo: bytes | N... | 27.851852 | 83 | 0.724734 |
14caf6a5068a495217ffcac7f0e85f54500b4271 | 2,050 | py | Python | algs4/depth_first_paths.py | dumpmemory/algs4-py | 8555076b554583b5438ed5180e2815cf049fb233 | [
"MIT"
] | 230 | 2018-02-27T02:26:44.000Z | 2022-03-29T10:26:57.000Z | algs4/depth_first_paths.py | dumpmemory/algs4-py | 8555076b554583b5438ed5180e2815cf049fb233 | [
"MIT"
] | 5 | 2018-04-06T12:08:56.000Z | 2021-12-19T09:44:58.000Z | algs4/depth_first_paths.py | dumpmemory/algs4-py | 8555076b554583b5438ed5180e2815cf049fb233 | [
"MIT"
] | 55 | 2018-02-27T02:26:45.000Z | 2022-03-30T03:51:41.000Z | """
Execution: python depth_first_paths.py G s
Data files: https://algs4.cs.princeton.edu/41graph/tinyCG.txt
https://algs4.cs.princeton.edu/41graph/tinyG.txt
https://algs4.cs.princeton.edu/41graph/mediumG.txt
https://algs4.cs.princeton.edu/41graph/largeG.txt
... | 24.117647 | 67 | 0.495122 |
df4daef87698ee975604198c65c3626e9c29715e | 871 | py | Python | src/google/events/cloud/scheduler/v1/SchedulerJobData.py | busunkim96/google-cloudevents-python | c4acb56d725516d09051f75aa5bcf77887913218 | [
"Apache-2.0"
] | null | null | null | src/google/events/cloud/scheduler/v1/SchedulerJobData.py | busunkim96/google-cloudevents-python | c4acb56d725516d09051f75aa5bcf77887913218 | [
"Apache-2.0"
] | null | null | null | src/google/events/cloud/scheduler/v1/SchedulerJobData.py | busunkim96/google-cloudevents-python | c4acb56d725516d09051f75aa5bcf77887913218 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.291667 | 80 | 0.743972 |
370515f1e72209c51e3194e24898fa2e47781af0 | 18,967 | py | Python | cirq-core/cirq/experiments/t2_decay_experiment.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/experiments/t2_decay_experiment.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/experiments/t2_decay_experiment.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 41.232609 | 100 | 0.662783 |
78621d4026932197a70400a276ac6fc6e156bc09 | 7,026 | py | Python | square/api/gift_card_activities_api.py | sdolemelipone/square-python-sdk | 4674d4867542ff5a32dc29a4bde483e62df065fb | [
"Apache-2.0"
] | 75 | 2019-08-15T14:40:47.000Z | 2022-03-05T16:24:00.000Z | square/api/gift_card_activities_api.py | sdolemelipone/square-python-sdk | 4674d4867542ff5a32dc29a4bde483e62df065fb | [
"Apache-2.0"
] | 13 | 2019-12-10T20:14:02.000Z | 2022-02-01T15:31:37.000Z | square/api/gift_card_activities_api.py | sdolemelipone/square-python-sdk | 4674d4867542ff5a32dc29a4bde483e62df065fb | [
"Apache-2.0"
] | 41 | 2019-10-20T20:53:45.000Z | 2022-02-10T02:18:18.000Z | # -*- coding: utf-8 -*-
from square.api_helper import APIHelper
from square.http.api_response import ApiResponse
from square.api.base_api import BaseApi
from square.http.auth.o_auth_2 import OAuth2
class GiftCardActivitiesApi(BaseApi):
"""A Controller to access Endpoints in the square API."""
def __init__(... | 41.821429 | 120 | 0.602619 |
af408d8e3fe6e3617e1fc8e48f8ee102d9c3ddb5 | 15,454 | py | Python | opensky_network_client/models.py | eurocontrol-swim/opensky-network-client | 03d80d38d3d0e1bc1538bac0681d4f9be935f094 | [
"BSD-3-Clause"
] | null | null | null | opensky_network_client/models.py | eurocontrol-swim/opensky-network-client | 03d80d38d3d0e1bc1538bac0681d4f9be935f094 | [
"BSD-3-Clause"
] | null | null | null | opensky_network_client/models.py | eurocontrol-swim/opensky-network-client | 03d80d38d3d0e1bc1538bac0681d4f9be935f094 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2019 EUROCONTROL
==========================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and... | 42.456044 | 120 | 0.636275 |
773c494b94f081ad00cc80561c5c628e057eaa10 | 2,802 | py | Python | tests/test_tag.py | lucventurini/pafpy | 11db6359487a3317b51d700db45552daf1d35774 | [
"Unlicense"
] | null | null | null | tests/test_tag.py | lucventurini/pafpy | 11db6359487a3317b51d700db45552daf1d35774 | [
"Unlicense"
] | null | null | null | tests/test_tag.py | lucventurini/pafpy | 11db6359487a3317b51d700db45552daf1d35774 | [
"Unlicense"
] | null | null | null | import pytest
from pafpy.tag import InvalidTagFormat, Tag
class TestStr:
def test_str_value(self):
tag = Tag(tag="tg", type="A", value="P")
actual = str(tag)
expected = "tg:A:P"
assert actual == expected
def test_int_value(self):
tag = Tag(tag="NM", type="i", value=... | 23.948718 | 57 | 0.580657 |
8fb86d8fe5067ce2ef3c8bd42d0013f3d2ea87cd | 9,603 | py | Python | demucs/__main__.py | ragatti/demucs | 30132b6d02ccb6b58e249e75e81a94ebcde3ce60 | [
"MIT"
] | 2 | 2021-06-20T11:42:13.000Z | 2021-06-20T11:43:01.000Z | demucs/__main__.py | ragatti/demucs | 30132b6d02ccb6b58e249e75e81a94ebcde3ce60 | [
"MIT"
] | null | null | null | demucs/__main__.py | ragatti/demucs | 30132b6d02ccb6b58e249e75e81a94ebcde3ce60 | [
"MIT"
] | 4 | 2020-04-10T05:27:14.000Z | 2021-05-20T23:10:31.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import json
import os
import sys
import time
from dataclasses import dataclass, field
from fractions import Fraction
impor... | 35.305147 | 100 | 0.558888 |
fabc443483e09abdf9cf7006f6c70e867482350b | 569 | py | Python | cogs/__init__.py | turbomam/cogs | df2c89c0c6adcadfbe565ebcad58d1574205fb18 | [
"BSD-3-Clause"
] | 5 | 2020-06-30T19:03:34.000Z | 2022-01-04T21:26:11.000Z | cogs/__init__.py | turbomam/cogs | df2c89c0c6adcadfbe565ebcad58d1574205fb18 | [
"BSD-3-Clause"
] | 89 | 2020-06-09T19:46:24.000Z | 2022-02-11T01:26:11.000Z | cogs/__init__.py | turbomam/cogs | df2c89c0c6adcadfbe565ebcad58d1574205fb18 | [
"BSD-3-Clause"
] | 2 | 2020-06-30T17:53:45.000Z | 2022-02-02T23:49:25.000Z | # __init__.py
from cogs.add import add
from cogs.add import add_all
from cogs.apply import apply
from cogs.clear import clear
from cogs.connect import connect
from cogs.delete import delete
from cogs.diff import diff
from cogs.fetch import fetch
from cogs.ignore import ignore
from cogs.init import init
from cogs.ls imp... | 24.73913 | 38 | 0.810193 |
546582dec7672abd50154ee2dda3f2aaf0a67c93 | 2,375 | py | Python | YearII/SemesterIII/ProgrammingInPython/Practicals/strings/main.py | sudiptog81/ducscode | 4a60fb6d9a5769f9c487d0a65e557632af469903 | [
"MIT"
] | 7 | 2020-03-18T09:17:03.000Z | 2022-01-12T09:36:45.000Z | YearII/SemesterIII/ProgrammingInPython/Practicals/strings/main.py | gourabdas-88006/ducscode | 19f047e02f43af430f904782850a66be32b0ff89 | [
"MIT"
] | 1 | 2020-08-27T10:33:00.000Z | 2020-08-27T10:33:00.000Z | YearII/SemesterIII/ProgrammingInPython/Practicals/strings/main.py | gourabdas-88006/ducscode | 19f047e02f43af430f904782850a66be32b0ff89 | [
"MIT"
] | 4 | 2020-04-23T14:52:03.000Z | 2021-10-03T19:55:27.000Z | '''
Write a menu driven program to perform the following on strings:
(a) Find the length of string.
(b) Return maximum of three strings.
(c) Accept a string and replace all vowels with "#"
(d) Find number of words in the given string.
(e) Check whether the string is a palindrome or not.
Written by Su... | 23.75 | 65 | 0.484632 |
6f11d02db89a29bd036e3ce0c4a2b416463d04a8 | 419 | py | Python | 4_print_data.py | believeohiozua/python_mysql | 11fcc21c4672446e0a0b021eef72d3429b582aec | [
"MIT"
] | null | null | null | 4_print_data.py | believeohiozua/python_mysql | 11fcc21c4672446e0a0b021eef72d3429b582aec | [
"MIT"
] | null | null | null | 4_print_data.py | believeohiozua/python_mysql | 11fcc21c4672446e0a0b021eef72d3429b582aec | [
"MIT"
] | 2 | 2020-11-23T14:29:23.000Z | 2020-11-23T14:33:04.000Z | import pymysql
#database connection
connection = pymysql.Connect(host="localhost", user="root", passwd="", database="databaseName")
cursor = connection.cursor()
# queries for retrievint all rows
retrive = "Select * from Artists;"
#executing the quires
cursor.execute(retrive)
rows = cursor.fetchall()
for row in rows... | 22.052632 | 96 | 0.756563 |
e2b17efdc9d5709699a5bb09819571c96e89cc61 | 3,003 | py | Python | examples/basics/mnist-tfslim.py | layolu/tensorpack | 97360e5b8ca9ce03d8a18b3abef5abfc92cb9907 | [
"Apache-2.0"
] | 5 | 2020-10-16T07:11:24.000Z | 2021-07-19T06:48:23.000Z | examples/basics/mnist-tfslim.py | layolu/tensorpack | 97360e5b8ca9ce03d8a18b3abef5abfc92cb9907 | [
"Apache-2.0"
] | 14 | 2020-09-25T22:35:13.000Z | 2022-02-10T01:45:31.000Z | examples/basics/mnist-tfslim.py | layolu/tensorpack | 97360e5b8ca9ce03d8a18b3abef5abfc92cb9907 | [
"Apache-2.0"
] | 4 | 2020-12-25T20:24:30.000Z | 2021-08-31T14:10:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: mnist-tfslim.py
"""
MNIST ConvNet example using TensorFlow-slim.
Mostly the same as 'mnist-convnet.py',
the only differences are:
1. use slim.layers, slim.arg_scope, etc
2. use slim names to summarize weights
"""
import tensorflow as tf
import tensorflow.... | 33.366667 | 109 | 0.621046 |
92ab38b45357b4967d4311f5f9225bbd0dd86e43 | 2,393 | py | Python | timemachines/skatertools/data/live.py | wx-b/timemachines | 5ab914adf265928eda26ca637881d6ccd5e794a9 | [
"MIT"
] | 1 | 2021-12-03T15:02:51.000Z | 2021-12-03T15:02:51.000Z | timemachines/skatertools/data/live.py | wx-b/timemachines | 5ab914adf265928eda26ca637881d6ccd5e794a9 | [
"MIT"
] | null | null | null | timemachines/skatertools/data/live.py | wx-b/timemachines | 5ab914adf265928eda26ca637881d6ccd5e794a9 | [
"MIT"
] | null | null | null | try:
from microprediction import MicroReader
have_micro = True
except ImportError:
have_micro = False
import random
# Live data streams at www.microprediction.com
if have_micro:
def random_stream_name(min_len=500,exclude_str=None, include_str=None):
""" Randomly selected univariate series
... | 31.486842 | 106 | 0.622649 |
f5092fe83cba5a6d6eb01969bc422688692b3edf | 6,976 | py | Python | Cliente/mymodule.py | andresvisco/anviAdium | e0e7d27576eb1f385f129cee997b45674cf8bd1c | [
"MIT"
] | null | null | null | Cliente/mymodule.py | andresvisco/anviAdium | e0e7d27576eb1f385f129cee997b45674cf8bd1c | [
"MIT"
] | 1 | 2021-07-03T14:33:00.000Z | 2021-07-03T14:33:00.000Z | Cliente/mymodule.py | andresvisco/anviAdium | e0e7d27576eb1f385f129cee997b45674cf8bd1c | [
"MIT"
] | null | null | null | # - *- coding: utf- 8 - *-
import xlwings
from xlwings import Range
from cargarExcel import cargarExcelDataframe
import math
import logginProcess
import urllib.request
from urllib.error import HTTPError, URLError
import json
import pandas as pd
URL_SERVICIO_WEB = 'http://viscoandres.pythonanywhere.com/' #?tipo='
# URL... | 32 | 180 | 0.65281 |
fba67a3f7e7fb463337025e8bde5b8a610b1cebf | 2,363 | py | Python | Back-End/Python/Basics/Part -1 - Functional/01 - Variables-Memory/04optimization_interning.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 25 | 2021-04-28T02:51:26.000Z | 2022-03-24T13:58:04.000Z | Back-End/Python/Basics/Part -1 - Functional/01 - Variables-Memory/04optimization_interning.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 1 | 2022-03-03T23:33:41.000Z | 2022-03-03T23:35:41.000Z | Back-End/Python/Basics/Part -1 - Functional/01 - Variables-Memory/04optimization_interning.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 15 | 2021-05-30T01:35:20.000Z | 2022-03-25T12:38:25.000Z |
# Interning strings (making them singleton objects) means that testing
# for string equality can be done faster by comparing the memory address:
a = 'this_is_a_long_string'
b = 'this_is_a_long_string'
print('a==b:', a == b)
print('a is b:', a is b)
# a==b: True
# a is b: True
# Here's where this technique fails:
b ... | 22.721154 | 121 | 0.648752 |
2e222d640fb508af65ba70e155126b388ec22fb9 | 3,588 | py | Python | src/genGif.py | mitre-cyber-academy/2013-grabbag-200 | f1d1ed9fe554f19a8a2e4d8ec0e5d95667756228 | [
"Apache-2.0"
] | null | null | null | src/genGif.py | mitre-cyber-academy/2013-grabbag-200 | f1d1ed9fe554f19a8a2e4d8ec0e5d95667756228 | [
"Apache-2.0"
] | null | null | null | src/genGif.py | mitre-cyber-academy/2013-grabbag-200 | f1d1ed9fe554f19a8a2e4d8ec0e5d95667756228 | [
"Apache-2.0"
] | null | null | null | from PIL import Image, ImageFont, ImageDraw
import numpy as np
import argparse
import math
import os.path
import tempfile
import shutil
import images2gif
def main():
parser = argparse.ArgumentParser(
description='Generate a scrolling gif')
parser.add_argument('flag',
help='The flag, of the form MCA-12345678')
... | 24.080537 | 70 | 0.704292 |
fd0f1a8487a7d70ee038fc947f4d9990987db02b | 8,681 | py | Python | make.py | PizzaRules668/Tensorflow-Image-Synthetic-Data-Generator | acc1ec0f300b1188b50a2484577c993e64c80334 | [
"MIT"
] | null | null | null | make.py | PizzaRules668/Tensorflow-Image-Synthetic-Data-Generator | acc1ec0f300b1188b50a2484577c993e64c80334 | [
"MIT"
] | null | null | null | make.py | PizzaRules668/Tensorflow-Image-Synthetic-Data-Generator | acc1ec0f300b1188b50a2484577c993e64c80334 | [
"MIT"
] | null | null | null | import cv2
import glob
import os
import urllib.request
import random
import argparse
import numpy as np
import pandas as pd
import xml.etree.ElementTree as ET
import imutils
# Make the Synthetic images
def edit(totalimg):
num = 0
imagecount = 0
count = 1
totalimg = totalimg * args.n
for a in range... | 32.758491 | 142 | 0.534961 |
f639cbf4a14eee398490056b2d37ea3c7b2d55a9 | 480 | py | Python | src/9/defining_classes_programmatically/example1.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/9/defining_classes_programmatically/example1.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/9/defining_classes_programmatically/example1.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # Example of making a class manually from parts
# Methods
def __init__(self, name, shares, price):
self.name = name
self.shares = shares
self.price = price
def cost(self):
return self.shares * self.price
cls_dict = {
'__init__' : __init__,
'cost' : cost,
}
# Make a class
import types
Stock ... | 18.461538 | 72 | 0.63125 |
f453d97a0d90c2bc789ef57248f17a5c413c23a3 | 3,607 | py | Python | SCX10Twist.py | AlienHerald/ROS_SCX10_Chassis | 88898888b1dc386ae601b8ef213f33368104560b | [
"Unlicense"
] | null | null | null | SCX10Twist.py | AlienHerald/ROS_SCX10_Chassis | 88898888b1dc386ae601b8ef213f33368104560b | [
"Unlicense"
] | null | null | null | SCX10Twist.py | AlienHerald/ROS_SCX10_Chassis | 88898888b1dc386ae601b8ef213f33368104560b | [
"Unlicense"
] | null | null | null | #!usr/bin/python3
import rospy
from geometry_msgs.msg import Twist
from board import SCL, SDA
import busio
from adafruit_pca9685 import PCA9685
from adafruit_motor import servo
import time
import Jetson.GPIO as GPIO
i2c = busio.I2C(SCL, SDA)
print("adding i2c bus")
pca = PCA9685(i2c)
print("i2c bus added")
pca.freq... | 22.685535 | 75 | 0.600776 |
0851547e7e33f5c8d861e95ec98aa3c5078c1988 | 4,260 | py | Python | cumodoro/component/frame.py | gisodal/cumodoro | a2025df04805f367c83c216dcfb0c284714a4d74 | [
"MIT"
] | 32 | 2016-03-22T09:13:50.000Z | 2022-02-24T22:55:08.000Z | cumodoro/component/frame.py | gisodal/cumodoro | a2025df04805f367c83c216dcfb0c284714a4d74 | [
"MIT"
] | 3 | 2015-08-06T10:14:47.000Z | 2017-07-06T09:54:14.000Z | cumodoro/component/frame.py | gisodal/cumodoro | a2025df04805f367c83c216dcfb0c284714a4d74 | [
"MIT"
] | 1 | 2017-07-05T12:57:20.000Z | 2017-07-05T12:57:20.000Z | import curses
from cumodoro.error import *
import cumodoro.globals as globals
import logging
log = logging.getLogger('cumodoro')
class Frame(object):
def __init__(self):
self.exception_on_x = True
self.focus = False
self.manual_focus = True
self.window = None
self.name = ''
... | 35.798319 | 233 | 0.49061 |
34786420dd61e46c9144ac25cbf052ffbfb77b01 | 19,343 | py | Python | diofant/utilities/lambdify.py | diofant/omg | 72fd45f832240d1ded6f0a411e97bb9f7aa9f1d2 | [
"BSD-3-Clause"
] | null | null | null | diofant/utilities/lambdify.py | diofant/omg | 72fd45f832240d1ded6f0a411e97bb9f7aa9f1d2 | [
"BSD-3-Clause"
] | null | null | null | diofant/utilities/lambdify.py | diofant/omg | 72fd45f832240d1ded6f0a411e97bb9f7aa9f1d2 | [
"BSD-3-Clause"
] | null | null | null | """
This module provides convenient functions to transform diofant expressions to
lambda functions which can be used to calculate numerical values very fast.
"""
from __future__ import annotations
import inspect
import textwrap
import typing
from ..core.compatibility import is_sequence, iterable
from ..external impo... | 32.673986 | 91 | 0.608696 |
769ee0d3e99cfc9ffa7986fb895c5da00903d5ad | 1,170 | py | Python | var/spack/repos/builtin/packages/r-foreign/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-foreign/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/r-foreign/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RForeign(RPackage):
"""Read Data Stored by 'Minitab', 'S', 'SAS', 'SPSS', 'Stata',... | 43.333333 | 98 | 0.719658 |
2d0f93282931d19e901574aedb4494d1fce2b493 | 127 | py | Python | lj.py | 1012598167/drugsdxy_selenium_or_requests | 0ea6c4a28f4436c3168c7c4b1f53e31726814abc | [
"Apache-2.0"
] | null | null | null | lj.py | 1012598167/drugsdxy_selenium_or_requests | 0ea6c4a28f4436c3168c7c4b1f53e31726814abc | [
"Apache-2.0"
] | null | null | null | lj.py | 1012598167/drugsdxy_selenium_or_requests | 0ea6c4a28f4436c3168c7c4b1f53e31726814abc | [
"Apache-2.0"
] | null | null | null | import requests
from lxml import etree
a=requests.get('http://www.baidu.com')
tree=etree.HTML(a.text)
print(tree.xpath('//a'))
| 21.166667 | 38 | 0.732283 |
b2666a8bede9df2d2ee95bebdc79df9c93d59834 | 6,219 | py | Python | test/TestCliRolePaths.py | bluikko/ansible-lint | acf35ee2a937e372af2b8e075b1dbdb875bc18a1 | [
"MIT"
] | 1 | 2021-06-24T20:54:27.000Z | 2021-06-24T20:54:27.000Z | test/TestCliRolePaths.py | bluikko/ansible-lint | acf35ee2a937e372af2b8e075b1dbdb875bc18a1 | [
"MIT"
] | 2 | 2021-06-02T04:42:21.000Z | 2021-07-23T13:40:00.000Z | test/TestCliRolePaths.py | bluikko/ansible-lint | acf35ee2a937e372af2b8e075b1dbdb875bc18a1 | [
"MIT"
] | 1 | 2021-07-10T08:52:23.000Z | 2021-07-10T08:52:23.000Z | # pylint: disable=preferred-module # FIXME: remove once migrated per GH-725
import os
import unittest
from pathlib import Path
from typing import Dict
import pytest
from ansiblelint.testing import run_ansible_lint
from ansiblelint.text import strip_ansi_escape
class TestCliRolePaths(unittest.TestCase):
def set... | 35.135593 | 105 | 0.652677 |
ec769653278492ff363f735e31a71c761c423241 | 4,321 | py | Python | src/py/flwr/client/grpc_client/connection.py | DataDexter/flower | cb66854dcbf2e0c5bf14ee48149053a84be8a3be | [
"Apache-2.0"
] | null | null | null | src/py/flwr/client/grpc_client/connection.py | DataDexter/flower | cb66854dcbf2e0c5bf14ee48149053a84be8a3be | [
"Apache-2.0"
] | null | null | null | src/py/flwr/client/grpc_client/connection.py | DataDexter/flower | cb66854dcbf2e0c5bf14ee48149053a84be8a3be | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 37.573913 | 87 | 0.697061 |
3ce9de3bc6f97b061de05d7726f78b5f6fcae547 | 811 | py | Python | tests/test_currencies.py | madisvain/vatcomply | ce3a5bed4122c24045362b45b66bb41f7190e1ff | [
"MIT"
] | 9 | 2021-04-06T18:45:26.000Z | 2022-03-15T21:20:54.000Z | tests/test_currencies.py | madisvain/vatcomply | ce3a5bed4122c24045362b45b66bb41f7190e1ff | [
"MIT"
] | 14 | 2021-03-31T20:26:14.000Z | 2022-03-31T06:42:48.000Z | tests/test_currencies.py | madisvain/vatcomply | ce3a5bed4122c24045362b45b66bb41f7190e1ff | [
"MIT"
] | null | null | null | from starlette.testclient import TestClient
from app import app
class TestCurrenciesAPI(object):
# def test_currencies_api_unauth(self):
# with TestClient(app) as client:
# response = client.get("/currencies")
# assert response.status_code == 403
def test_currencies_api(self)... | 36.863636 | 95 | 0.607891 |
1b9da10804f28c9b509dae52cfb3cdd918d8f4ca | 1,666 | py | Python | feature_extractor/feature_extractor_test.py | PandaJules/youtube-8m | 2a652b05043fd066fd4d06685a6f019b3ff6b723 | [
"Apache-2.0"
] | 1 | 2018-01-30T14:11:12.000Z | 2018-01-30T14:11:12.000Z | feature_extractor/feature_extractor_test.py | PandaJules/youtube-8m | 2a652b05043fd066fd4d06685a6f019b3ff6b723 | [
"Apache-2.0"
] | null | null | null | feature_extractor/feature_extractor_test.py | PandaJules/youtube-8m | 2a652b05043fd066fd4d06685a6f019b3ff6b723 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 32.038462 | 79 | 0.761705 |
d411672b8b819e282592bdaf979992efefbfe097 | 349 | py | Python | v2.5.7/otp/ai/passlib/utils/md4.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v2.5.7/otp/ai/passlib/utils/md4.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v2.5.7/otp/ai/passlib/utils/md4.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from warnings import warn
warn('the module \'passlib.utils.md4\' is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0, please use \'lookup_hash("md4").const()\' from \'passlib.crypto\' instead', DeprecationWarning)
__all__ = [
'md4']
from otp.ai.passlib.crypto.digest import lookup_hash
md4 = lookup_hash... | 49.857143 | 203 | 0.753582 |
af532a12c74654a432254c75137277da388e53ad | 6,161 | py | Python | model-optimizer/mo/front/common/partial_infer/eltwise_test.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | 3 | 2020-02-09T23:25:37.000Z | 2021-01-19T09:44:12.000Z | model-optimizer/mo/front/common/partial_infer/eltwise_test.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | null | null | null | model-optimizer/mo/front/common/partial_infer/eltwise_test.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | 2 | 2020-04-18T16:24:39.000Z | 2021-01-19T09:42:19.000Z | """
Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 40.801325 | 92 | 0.475897 |
9f5e06e59af1769f5e767ef8f155ce14bc9511e4 | 250 | py | Python | creten/orders/OrderSellMarket.py | nardew/Creten | 15ddb0b52e6f2afec2c79b3c731fccb34a2c63d6 | [
"MIT"
] | 9 | 2019-12-17T10:42:40.000Z | 2021-12-02T23:07:05.000Z | creten/orders/OrderSellMarket.py | nardew/Creten | 15ddb0b52e6f2afec2c79b3c731fccb34a2c63d6 | [
"MIT"
] | null | null | null | creten/orders/OrderSellMarket.py | nardew/Creten | 15ddb0b52e6f2afec2c79b3c731fccb34a2c63d6 | [
"MIT"
] | 6 | 2019-03-04T15:01:10.000Z | 2022-01-12T23:22:55.000Z | from orders.Order import Order
from orders.OrderType import OrderType
from orders.OrderSide import OrderSide
class OrderSellMarket(Order):
def __init__(self, qty):
super(OrderSellMarket, self).__init__(OrderSide.SELL, OrderType.MARKET, qty = qty) | 35.714286 | 84 | 0.812 |
dfa84d728e2f94ca71d705c1ecc4b9f2f5794810 | 944 | py | Python | google-cloud-sdk/lib/surface/datapol/__init__.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/datapol/__init__.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/datapol/__init__.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 29.5 | 74 | 0.753178 |
b5afb7353055d0fa8b4dc565532383a4260b1eef | 761 | py | Python | config.py | Bakley/Questioner-ADC | bfc9f99224005437ad92d914faafdcc5155d71b9 | [
"MIT"
] | null | null | null | config.py | Bakley/Questioner-ADC | bfc9f99224005437ad92d914faafdcc5155d71b9 | [
"MIT"
] | 9 | 2019-01-09T05:42:12.000Z | 2019-01-23T17:51:41.000Z | config.py | Bakley/Questioner-ADC | bfc9f99224005437ad92d914faafdcc5155d71b9 | [
"MIT"
] | 5 | 2019-01-08T15:57:48.000Z | 2019-01-11T09:21:03.000Z | import os
class Config():
"""
Base configuration class with minimal settings
"""
DEBUG = False
TESTING = False
JWT_KEY = os.environ.get('SECRET_KEY')
class Development(Config):
"""
Developer class to set variable for debugging
"""
DEBUG = True
DATABASE_URI = os.getenv('DE... | 17.697674 | 87 | 0.638633 |
3711ff285a2327e45da9a0efcd0c0f8904fac2e0 | 2,479 | py | Python | pyjs/src/pyjs/lib/datetime.py | certik/pyjamas | 5bb72e63e50f09743ac986f4c9690ba50c499ba9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-09-19T09:14:16.000Z | 2018-09-19T09:14:16.000Z | pyjs/src/pyjs/lib/datetime.py | emk/pyjamas | d7633919d1ec9cd4a36675e356c7e5de71ac2a67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | pyjs/src/pyjs/lib/datetime.py | emk/pyjamas | d7633919d1ec9cd4a36675e356c7e5de71ac2a67 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-08-13T20:32:25.000Z | 2019-08-13T20:32:25.000Z | from __pyjamas__ import JS
class Datetime:
def __init__(self, year=None, month=None, day=None, hours=None, minutes=None, seconds=None, microseconds=None, tzinfo=None):
if tzinfo != None:
raise NontImplementedError("tzinfo")
JS("""
if (microseconds !== null)
self.date = new ... | 24.79 | 128 | 0.630496 |
cf738a8f61e7ba9aa7e914013af7137d9b90960c | 96 | py | Python | spacy/lang/nb/lemmatizer/_adverbs.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | 5 | 2019-04-19T06:27:29.000Z | 2019-12-02T13:30:47.000Z | spacy/lang/nb/lemmatizer/_adverbs.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | null | null | null | spacy/lang/nb/lemmatizer/_adverbs.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | 2 | 2019-04-19T06:27:18.000Z | 2019-10-04T12:39:15.000Z | # coding: utf8
from __future__ import unicode_literals
ADVERBS = set("""
""".split()) | 13.714286 | 40 | 0.635417 |
ea57c158691204873c2c8930c63853cb3bed9f99 | 12,919 | py | Python | contrib/linearize/linearize-data.py | asuka431/fujicoin-22.0 | 9e338be2116022f0d18df153298b8881e6145f04 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-data.py | asuka431/fujicoin-22.0 | 9e338be2116022f0d18df153298b8881e6145f04 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-data.py | asuka431/fujicoin-22.0 | 9e338be2116022f0d18df153298b8881e6145f04 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2020 The Baricoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import struct
import re
imp... | 36.806268 | 123 | 0.599737 |
e3e2dc70da53e28b1b9365c74d533c55b586416d | 6,541 | py | Python | mmaction/models/trackers/sim_siam_base_att_inv_tracker.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | mmaction/models/trackers/sim_siam_base_att_inv_tracker.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | mmaction/models/trackers/sim_siam_base_att_inv_tracker.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | import warnings
from collections import defaultdict
import torch
from mmcv.cnn import build_plugin_layer
from mmaction.utils import add_prefix
from .. import builder
from ..backbones import ResNet
from ..heads import SimSiamHead
from ..registry import TRACKERS
from .vanilla_tracker import VanillaTracker
@TRACKERS.r... | 42.474026 | 79 | 0.586302 |
51252ad79d02a6a84b10b4cd1af7bfa9b4ec73d3 | 628 | py | Python | Python Scrips/Min & Max Sepal Lenght.py | Gerrydh/Project-Code | 0451e90ce814b25c4512d0743f9a0214f6a435c3 | [
"Apache-2.0"
] | null | null | null | Python Scrips/Min & Max Sepal Lenght.py | Gerrydh/Project-Code | 0451e90ce814b25c4512d0743f9a0214f6a435c3 | [
"Apache-2.0"
] | null | null | null | Python Scrips/Min & Max Sepal Lenght.py | Gerrydh/Project-Code | 0451e90ce814b25c4512d0743f9a0214f6a435c3 | [
"Apache-2.0"
] | null | null | null | # Ger Hanlon, 02.04.2018
# This scripts returns the max and min Sepal Lenghts (Column 0)
# https://stackoverflow.com/questions/46281738
with open("Iris data2.csv") as file:
lines = file.read().split("\n") #Read lines
num_list = []
for line in lines:
try:
item = line.split(",")[1] #Choose 4th colum... | 34.888889 | 81 | 0.667197 |
86b62dd77f2f39b7ecb6ced4d3c47c46631e86ac | 2,143 | py | Python | zygoat/components/frontend/__init__.py | knitHacker/zygoat | dcbd6a6bb8c6e6ef9338ca17b3935946514f3808 | [
"MIT"
] | 1 | 2020-05-13T23:51:14.000Z | 2020-05-13T23:51:14.000Z | zygoat/components/frontend/__init__.py | knitHacker/zygoat | dcbd6a6bb8c6e6ef9338ca17b3935946514f3808 | [
"MIT"
] | null | null | null | zygoat/components/frontend/__init__.py | knitHacker/zygoat | dcbd6a6bb8c6e6ef9338ca17b3935946514f3808 | [
"MIT"
] | null | null | null | import logging
import os
import shutil
from zygoat.components import Component
from zygoat.constants import Projects, Phases
from zygoat.utils.shell import run
from zygoat.utils.files import use_dir
from .dockerfile import dockerfile
from .gitignore import gitignore
from .prettier import prettier
from .eslint import ... | 27.831169 | 83 | 0.662156 |
dbe9a787e00a4c400aca61202873dd16ee3a0408 | 9,948 | py | Python | elasticsearch/connection_pool.py | alviandk/elasticsearch-py | cea8e864037239ce5b1c3cd49e85703362b71875 | [
"Apache-2.0"
] | 190 | 2017-12-13T05:01:42.000Z | 2021-11-15T23:35:54.000Z | elasticsearch/connection_pool.py | alviandk/elasticsearch-py | cea8e864037239ce5b1c3cd49e85703362b71875 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:30:08.000Z | 2021-06-01T21:52:42.000Z | elasticsearch/connection_pool.py | alviandk/elasticsearch-py | cea8e864037239ce5b1c3cd49e85703362b71875 | [
"Apache-2.0"
] | 22 | 2017-12-13T04:36:46.000Z | 2021-07-29T07:37:41.000Z | import time
import random
import logging
import threading
try:
from Queue import PriorityQueue, Empty
except ImportError:
from queue import PriorityQueue, Empty
from .exceptions import ImproperlyConfigured
logger = logging.getLogger('elasticsearch')
class ConnectionSelector(object):
"""
Simple class... | 37.969466 | 96 | 0.655509 |
f955dfa490aede7521970026acf4611450de40c8 | 7,804 | py | Python | tests/handlers/test_message.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | null | null | null | tests/handlers/test_message.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | null | null | null | tests/handlers/test_message.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2021-09-27T14:45:52.000Z | 2021-09-27T14:45:52.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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 require... | 36.638498 | 86 | 0.658765 |
f6cdcb9a419d8da5929577bb82d225468ba3c44b | 5,612 | py | Python | tests/test.py | WISDEM/FrequencyDomain | 5c837c6ea110499c95fccc8d427295620aca7b30 | [
"Apache-2.0"
] | 10 | 2021-03-12T03:43:07.000Z | 2022-01-27T10:24:39.000Z | tests/test.py | WISDEM/FrequencyDomain | 5c837c6ea110499c95fccc8d427295620aca7b30 | [
"Apache-2.0"
] | 6 | 2021-05-20T05:38:39.000Z | 2022-03-21T22:58:47.000Z | tests/test.py | WISDEM/FrequencyDomain | 5c837c6ea110499c95fccc8d427295620aca7b30 | [
"Apache-2.0"
] | 7 | 2021-03-15T05:08:01.000Z | 2022-03-24T18:00:30.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 29 13:38:05 2021
@author: shousner
"""
import unittest
import numpy as np
import numpy.testing as npt
import raft
import yaml
import os
class TestOC3Spar(unittest.TestCase):
@classmethod
def setUpClass(self):
raft_dir = os.path.dirnam... | 34.641975 | 137 | 0.664647 |
fdef15db7984a840896d82f5655814ae985ca05c | 3,213 | py | Python | pkgs/conf-pkg/src/genie/libs/conf/device/nxos/device.py | kecorbin/genielibs | 5d3951b8911013691822e73e9c3d0f557ca10f43 | [
"Apache-2.0"
] | null | null | null | pkgs/conf-pkg/src/genie/libs/conf/device/nxos/device.py | kecorbin/genielibs | 5d3951b8911013691822e73e9c3d0f557ca10f43 | [
"Apache-2.0"
] | null | null | null | pkgs/conf-pkg/src/genie/libs/conf/device/nxos/device.py | kecorbin/genielibs | 5d3951b8911013691822e73e9c3d0f557ca10f43 | [
"Apache-2.0"
] | null | null | null | '''
Device class for devices with nxos OS.
'''
__all__ = (
'Device',
)
from enum import Enum
import logging
import re
from genie.decorator import managedattribute
from genie.conf.base.attributes import AttributesHelper
from genie.conf.base.cli import CliConfigBuilder
from genie.conf.base.config import CliConfig
... | 34.180851 | 110 | 0.590725 |
94682a3f88c03588927e4f649c45e6b12c1f2d47 | 557 | py | Python | covid19_utils.py | Pomidorka1234/covid-19 | 2f2258c4747e8821340d526af0611e2d2e9f230c | [
"MIT"
] | null | null | null | covid19_utils.py | Pomidorka1234/covid-19 | 2f2258c4747e8821340d526af0611e2d2e9f230c | [
"MIT"
] | null | null | null | covid19_utils.py | Pomidorka1234/covid-19 | 2f2258c4747e8821340d526af0611e2d2e9f230c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
#Assemble images
import cv2
import numpy as np
im1 = cv2.imread('images/charts/france/incidence_taux_france.jpeg')
im2 = cv2.imread('images/charts/france/subplots_dep_incidence.jpeg')
im_h = cv2.hconcat([im1, im2])
cv2.imwrite('images/charts/france/tests_combinaison.j... | 24.217391 | 68 | 0.759425 |
bbf86f67ee392fd9401af3bb943b23f563fabfda | 6,032 | py | Python | tests/features/ml_test_evaluation_steps.py | osroca/bigmler | 8e4ccaea8fa5329674c7e6909381a9688a8bb24b | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:57.000Z | 2021-08-30T20:18:57.000Z | tests/features/ml_test_evaluation_steps.py | osroca/bigmler | 8e4ccaea8fa5329674c7e6909381a9688a8bb24b | [
"Apache-2.0"
] | null | null | null | tests/features/ml_test_evaluation_steps.py | osroca/bigmler | 8e4ccaea8fa5329674c7e6909381a9688a8bb24b | [
"Apache-2.0"
] | 1 | 2021-08-30T20:19:05.000Z | 2021-08-30T20:19:05.000Z | import os
import time
import csv
import json
from lettuce import step, world
from subprocess import check_call, CalledProcessError
from bigmler.checkpoint import file_number_of_lines
from common_steps import check_debug
@step(r'I create BigML multi-label resources tagged as "(.*)" with "(.*)" label separator and "(\d*... | 44.681481 | 242 | 0.64821 |
a81b38e207b1dabe638b719434bbaaef47318e6e | 8,750 | py | Python | trivial_tools/containers/class_carousel.py | IgorZyktin/trivial_tools | a1256e62d9345b9623850e37bd63df7ce52b81c8 | [
"MIT"
] | null | null | null | trivial_tools/containers/class_carousel.py | IgorZyktin/trivial_tools | a1256e62d9345b9623850e37bd63df7ce52b81c8 | [
"MIT"
] | null | null | null | trivial_tools/containers/class_carousel.py | IgorZyktin/trivial_tools | a1256e62d9345b9623850e37bd63df7ce52b81c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Контейнер с бегущим индексом, в который постоянно можно добавлять элементы
На базе этого контейнера предполагается собирать структуры для вычисления динамических
характеристик непрерывного потока входных данных в реальном времени.
Например вычисление скользящего среднего.
... | 32.894737 | 97 | 0.582057 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.