hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f5b0e701cd31fe438d6456b8dfe17515a304be | 11,956 | py | Python | app/user/tests/test_user_api.py | grotvignelli/6chan_project | 5fb6f86abc444b2701cf3c5890a7a8947e45534f | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | grotvignelli/6chan_project | 5fb6f86abc444b2701cf3c5890a7a8947e45534f | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | grotvignelli/6chan_project | 5fb6f86abc444b2701cf3c5890a7a8947e45534f | [
"MIT"
] | null | null | null | import datetime
import tempfile
import os
import shutil
from unittest.mock import patch
from PIL import Image
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.conf import settings
from rest_framework import status
from rest_framework.test imp... | 34.062678 | 79 | 0.640683 | import datetime
import tempfile
import os
import shutil
from unittest.mock import patch
from PIL import Image
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.conf import settings
from rest_framework import status
from rest_framework.test imp... | true | true |
f7f5b19149a76915f1a380024cfde6affe4247ef | 31,533 | py | Python | commands/feature_matrix_construction/main/run_pwRK3.py | cancerregulome/gidget | 6c9e9a37f9992267c7505c7a396ff7e2638599ab | [
"MIT"
] | 3 | 2016-02-22T21:29:23.000Z | 2020-09-19T07:38:21.000Z | commands/feature_matrix_construction/main/run_pwRK3.py | cancerregulome/gidget | 6c9e9a37f9992267c7505c7a396ff7e2638599ab | [
"MIT"
] | 1 | 2015-01-16T02:33:59.000Z | 2015-01-16T02:33:59.000Z | commands/feature_matrix_construction/main/run_pwRK3.py | cancerregulome/gidget | 6c9e9a37f9992267c7505c7a396ff7e2638599ab | [
"MIT"
] | 2 | 2015-12-27T08:40:12.000Z | 2021-03-01T06:30:23.000Z | #!/usr/bin/env python
import argparse
import commands
import getpass
import os
import os.path
import sys
import time
from env import gidgetConfigVars
import miscIO
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
def cleanString(aType):
aString = ""
for ii in range(len(aType... | 36.244828 | 139 | 0.534171 |
import argparse
import commands
import getpass
import os
import os.path
import sys
import time
from env import gidgetConfigVars
import miscIO
outName = tmpDir13 + "/" + str(numJobs) + ".pw"
## cmdString = "1 " + gidgetConfigVars['TCGAFMP_PAIRWISE_ROOT'] + "/pairwise-2.1.2"
... | false | true |
f7f5b260d4ffc764a73dfd6af01d53b0896e49f8 | 1,506 | py | Python | sqlglot/optimizer/eliminate_subqueries.py | kelsin/sqlglot | e1cfecfa77c43d9fea070c888e4b266b32475c0f | [
"MIT"
] | null | null | null | sqlglot/optimizer/eliminate_subqueries.py | kelsin/sqlglot | e1cfecfa77c43d9fea070c888e4b266b32475c0f | [
"MIT"
] | null | null | null | sqlglot/optimizer/eliminate_subqueries.py | kelsin/sqlglot | e1cfecfa77c43d9fea070c888e4b266b32475c0f | [
"MIT"
] | null | null | null | import itertools
import sqlglot
import sqlglot.expressions as exp
from sqlglot.optimizer.simplify import simplify
from sqlglot.optimizer.scope import traverse_scope
def eliminate_subqueries(expression):
"""
Rewrite duplicate subqueries from sqlglot AST.
Example:
>>> import sqlglot
>>> ex... | 31.375 | 99 | 0.648738 | import itertools
import sqlglot
import sqlglot.expressions as exp
from sqlglot.optimizer.simplify import simplify
from sqlglot.optimizer.scope import traverse_scope
def eliminate_subqueries(expression):
expression = simplify(expression)
queries = {}
for scope in traverse_scope(expression):
query... | true | true |
f7f5b2f89b9ec9f4dc2fed70b8e8dd147565c709 | 4,283 | py | Python | tracks/Lars_Loop.py | dp770/aws_deepracer_worksheet | 162b8f1c643c5b8ece33b9f9a35b7b4a513f905f | [
"MIT"
] | 1 | 2022-02-28T23:13:02.000Z | 2022-02-28T23:13:02.000Z | tracks/Lars_Loop.py | dp770/aws_deepracer_worksheet | 162b8f1c643c5b8ece33b9f9a35b7b4a513f905f | [
"MIT"
] | 1 | 2022-01-10T17:22:33.000Z | 2022-03-14T23:44:03.000Z | tracks/Lars_Loop.py | dp770/aws_deepracer_worksheet | 162b8f1c643c5b8ece33b9f9a35b7b4a513f905f | [
"MIT"
] | 1 | 2022-01-16T10:45:30.000Z | 2022-01-16T10:45:30.000Z | track_width = 1.0668000500506656
track_original = [(1.5632755160331726, -1.4320791363716125), (2.0709489583969116, -1.4242927730083466),
(2.578621983528137, -1.4164928197860718), (3.086295962333679, -1.408689171075821),
(3.593969464302063, -1.4008894562721252), (4.097454071044922, -1... | 97.340909 | 106 | 0.651179 | track_width = 1.0668000500506656
track_original = [(1.5632755160331726, -1.4320791363716125), (2.0709489583969116, -1.4242927730083466),
(2.578621983528137, -1.4164928197860718), (3.086295962333679, -1.408689171075821),
(3.593969464302063, -1.4008894562721252), (4.097454071044922, -1... | true | true |
f7f5b3a4dfb8e6b7e2b8a25169ca1eb8e16fa85c | 1,696 | py | Python | MetaHeuristics/TSA.py | roycek7/operation_research | 37f01b7fcd93494a7de38459c324132516724b99 | [
"MIT"
] | 1 | 2021-04-17T17:33:30.000Z | 2021-04-17T17:33:30.000Z | MetaHeuristics/TSA.py | roycek7/operation_research | 37f01b7fcd93494a7de38459c324132516724b99 | [
"MIT"
] | null | null | null | MetaHeuristics/TSA.py | roycek7/operation_research | 37f01b7fcd93494a7de38459c324132516724b99 | [
"MIT"
] | null | null | null | import math
import random
import pylab
def Distance(p1, p2):
return math.hypot(p1[0] - p2[0], p1[1] - p2[1])
nLoc = 150
N = range(nLoc)
Square = 1000
random.seed(nLoc)
Pos = [(random.randint(0, Square), random.randint(0, Square)) for i in N]
D = [[Distance(Pos[i], Pos[j]) for j in N] for i in N]
def Cost(Path... | 22.918919 | 98 | 0.544811 | import math
import random
import pylab
def Distance(p1, p2):
return math.hypot(p1[0] - p2[0], p1[1] - p2[1])
nLoc = 150
N = range(nLoc)
Square = 1000
random.seed(nLoc)
Pos = [(random.randint(0, Square), random.randint(0, Square)) for i in N]
D = [[Distance(Pos[i], Pos[j]) for j in N] for i in N]
def Cost(Path... | true | true |
f7f5b3cabe73aac5f136dc82fb6bbd942125c592 | 9,414 | py | Python | libraries/botbuilder-dialogs/botbuilder/dialogs/choices/find.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 388 | 2019-05-07T15:53:21.000Z | 2022-03-28T20:29:46.000Z | libraries/botbuilder-dialogs/botbuilder/dialogs/choices/find.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 1,286 | 2019-05-07T23:38:19.000Z | 2022-03-31T10:44:16.000Z | libraries/botbuilder-dialogs/botbuilder/dialogs/choices/find.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 168 | 2019-05-14T20:23:25.000Z | 2022-03-16T06:49:14.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import Callable, List, Union
from .choice import Choice
from .find_choices_options import FindChoicesOptions, FindValuesOptions
from .found_choice import FoundChoice
from .found_value import FoundValue
from .mode... | 37.807229 | 112 | 0.578606 |
from typing import Callable, List, Union
from .choice import Choice
from .find_choices_options import FindChoicesOptions, FindValuesOptions
from .found_choice import FoundChoice
from .found_value import FoundValue
from .model_result import ModelResult
from .sorted_value import SortedValue
from .token import Token
f... | true | true |
f7f5b453307c130d4a81b92e6af87c95a74db22f | 2,176 | py | Python | plugins/tts/google.py | ollmer/jasper-client | 49b76c248c9550ff50e37f549915de2034d22050 | [
"MIT"
] | null | null | null | plugins/tts/google.py | ollmer/jasper-client | 49b76c248c9550ff50e37f549915de2034d22050 | [
"MIT"
] | null | null | null | plugins/tts/google.py | ollmer/jasper-client | 49b76c248c9550ff50e37f549915de2034d22050 | [
"MIT"
] | null | null | null | import os
import yaml
import tempfile
from abstract_tts import AbstractMp3TTSEngine
from src import diagnose
from src import paths
try:
import gtts
except ImportError:
pass
class GoogleTTS(AbstractMp3TTSEngine):
"""
Uses the Google TTS online translator
Requires pymad and gTTS to be available
... | 31.536232 | 76 | 0.551471 | import os
import yaml
import tempfile
from abstract_tts import AbstractMp3TTSEngine
from src import diagnose
from src import paths
try:
import gtts
except ImportError:
pass
class GoogleTTS(AbstractMp3TTSEngine):
SLUG = "google-tts"
def __init__(self, language='en'):
super(self.__class__, s... | true | true |
f7f5b5b75ec025fdb789f099439d5eb0efc3090c | 666 | py | Python | src/garage/tf/baselines/__init__.py | researchai/unsupervised_meta_rl | 9ca4b41438277ef6cfea047482b98de9da07815a | [
"MIT"
] | null | null | null | src/garage/tf/baselines/__init__.py | researchai/unsupervised_meta_rl | 9ca4b41438277ef6cfea047482b98de9da07815a | [
"MIT"
] | null | null | null | src/garage/tf/baselines/__init__.py | researchai/unsupervised_meta_rl | 9ca4b41438277ef6cfea047482b98de9da07815a | [
"MIT"
] | null | null | null | """Baseline estimators for TensorFlow-based algorithms."""
from garage.tf.baselines.continuous_mlp_baseline import ContinuousMLPBaseline
from garage.tf.baselines.continuous_mlp_baseline_with_model import (
ContinuousMLPBaselineWithModel)
from garage.tf.baselines.gaussian_cnn_baseline_with_model import (
Gaussia... | 39.176471 | 77 | 0.834835 | from garage.tf.baselines.continuous_mlp_baseline import ContinuousMLPBaseline
from garage.tf.baselines.continuous_mlp_baseline_with_model import (
ContinuousMLPBaselineWithModel)
from garage.tf.baselines.gaussian_cnn_baseline_with_model import (
GaussianCNNBaselineWithModel)
from garage.tf.baselines.gaussian_co... | true | true |
f7f5b5d1a9627c743637d92860a3322a2c8de443 | 460 | py | Python | src/config.py | chander/lambda-to-slack | 973060bccc6c32036ea2178845c566974111d178 | [
"MIT"
] | null | null | null | src/config.py | chander/lambda-to-slack | 973060bccc6c32036ea2178845c566974111d178 | [
"MIT"
] | null | null | null | src/config.py | chander/lambda-to-slack | 973060bccc6c32036ea2178845c566974111d178 | [
"MIT"
] | null | null | null | """Environment configuration values used by lambda functions."""
import os
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
SLACK_URL = os.getenv('SLACK_URL')
MESSAGE_CONFIGS = []
for I in range(1, 21):
slack_url = os.getenv(f'SLACK_URL{str(I).zfill(2)}', None)
contains_string = os.getenv(f'CONTAINS_STRING{str(I).z... | 30.666667 | 74 | 0.697826 |
import os
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
SLACK_URL = os.getenv('SLACK_URL')
MESSAGE_CONFIGS = []
for I in range(1, 21):
slack_url = os.getenv(f'SLACK_URL{str(I).zfill(2)}', None)
contains_string = os.getenv(f'CONTAINS_STRING{str(I).zfill(2)}', None)
if slack_url and contains_string:
ME... | true | true |
f7f5b5fca5ebb7c8b6b4c3166040bf2f78f518e2 | 6,692 | py | Python | django/links/views.py | kehanlu/shorten-url | 57b97a3dc1ac973273bda7109199ad3d80c2b061 | [
"MIT"
] | 1 | 2018-07-10T02:31:10.000Z | 2018-07-10T02:31:10.000Z | django/links/views.py | kehanlu/shorten_url | 57b97a3dc1ac973273bda7109199ad3d80c2b061 | [
"MIT"
] | 2 | 2018-07-13T02:06:00.000Z | 2018-07-13T15:40:08.000Z | django/links/views.py | kehanlu/shorten_url | 57b97a3dc1ac973273bda7109199ad3d80c2b061 | [
"MIT"
] | null | null | null | import base64
import datetime
import hashlib
import json
from django.conf import settings
from django.http import JsonResponse, HttpResponsePermanentRedirect
from django.shortcuts import render, redirect
from django.utils import timezone
from .models import ShortURL, Viewer
#
BASE_URL = 'http://localhost:8000/links/... | 33.128713 | 155 | 0.610281 | import base64
import datetime
import hashlib
import json
from django.conf import settings
from django.http import JsonResponse, HttpResponsePermanentRedirect
from django.shortcuts import render, redirect
from django.utils import timezone
from .models import ShortURL, Viewer
BASE_URL = 'http://localhost:8000/links/'... | true | true |
f7f5b6a9f5578c5540db5539d1d7268292c197fd | 9,721 | py | Python | tests/text_extraction_tests.py | campagnucci/querido-diario-toolbox | 3ec99564ae92f1b5456f351f34e7745b4385c79e | [
"MIT"
] | 20 | 2020-10-30T19:52:12.000Z | 2021-11-12T12:51:58.000Z | tests/text_extraction_tests.py | campagnucci/querido-diario-toolbox | 3ec99564ae92f1b5456f351f34e7745b4385c79e | [
"MIT"
] | 26 | 2020-10-30T19:58:44.000Z | 2022-03-31T01:41:55.000Z | tests/text_extraction_tests.py | campagnucci/querido-diario-toolbox | 3ec99564ae92f1b5456f351f34e7745b4385c79e | [
"MIT"
] | 9 | 2020-10-30T20:15:33.000Z | 2022-02-18T16:44:15.000Z | import os
from unittest import TestCase
from querido_diario_toolbox import Gazette, Page
class TextExtractionTests(TestCase):
def setUp(self):
ROOT = "tests/bin"
self.TIKA_PATH = ROOT + "/tika-app-1.24.1.jar"
self.TABULA_PATH = ROOT + "/tabula-1.0.4-jar-with-dependencies.jar"
def tea... | 41.900862 | 85 | 0.701265 | import os
from unittest import TestCase
from querido_diario_toolbox import Gazette, Page
class TextExtractionTests(TestCase):
def setUp(self):
ROOT = "tests/bin"
self.TIKA_PATH = ROOT + "/tika-app-1.24.1.jar"
self.TABULA_PATH = ROOT + "/tabula-1.0.4-jar-with-dependencies.jar"
def tea... | true | true |
f7f5b6f2fa8645346df530bb577d2011be042e99 | 20,563 | py | Python | enodeb_status.py | aweimeow/enodebd | e1cd20693153e6b85e5d1bf9d21af2501c358601 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | enodeb_status.py | aweimeow/enodebd | e1cd20693153e6b85e5d1bf9d21af2501c358601 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | enodeb_status.py | aweimeow/enodebd | e1cd20693153e6b85e5d1bf9d21af2501c358601 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # SPDX-FileCopyrightText: 2020 The Magma Authors.
# SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
#
# SPDX-License-Identifier: BSD-3-Clause
import json
import os
from collections import namedtuple
from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Union
from lte.pr... | 34.559664 | 86 | 0.674123 |
import json
import os
from collections import namedtuple
from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Union
from lte.protos.enodebd_pb2 import SingleEnodebStatus
from lte.protos.mconfig import mconfigs_pb2
from common import serialization_utils
import metrics
from data_models.data_model_parame... | true | true |
f7f5b70acdaabea9aaa0d2f5fe59f3eb051b6bfa | 503 | py | Python | home/migrations/0004_auto_20201214_2150.py | Vlad-404/phot-portfolio | ff3fba512645c0781755bf5b6f7cc455f09b3c5b | [
"BSD-Source-Code"
] | 1 | 2021-01-05T15:52:19.000Z | 2021-01-05T15:52:19.000Z | home/migrations/0004_auto_20201214_2150.py | Vlad-404/phot-portfolio | ff3fba512645c0781755bf5b6f7cc455f09b3c5b | [
"BSD-Source-Code"
] | null | null | null | home/migrations/0004_auto_20201214_2150.py | Vlad-404/phot-portfolio | ff3fba512645c0781755bf5b6f7cc455f09b3c5b | [
"BSD-Source-Code"
] | 1 | 2021-01-05T18:44:47.000Z | 2021-01-05T18:44:47.000Z | # Generated by Django 3.1.3 on 2020-12-14 21:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0003_auto_20201207_1420'),
]
operations = [
migrations.AlterModelOptions(
name='categories',
options={'verbose_name_... | 22.863636 | 60 | 0.596421 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0003_auto_20201207_1420'),
]
operations = [
migrations.AlterModelOptions(
name='categories',
options={'verbose_name_plural': 'Categories'},
),
migr... | true | true |
f7f5b7e4ab065bc50dec055f0514aeef65e45998 | 504 | py | Python | tests/dataset_merge/dataset_merge_test.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | 6 | 2020-09-03T13:10:49.000Z | 2021-03-10T01:13:49.000Z | tests/dataset_merge/dataset_merge_test.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | 11 | 2020-05-22T09:43:29.000Z | 2021-03-24T10:55:49.000Z | tests/dataset_merge/dataset_merge_test.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | null | null | null | import unittest
import zipfile
class DatasetMergeTest(unittest.TestCase):
def test_dataset(self):
with zipfile.ZipFile('tests/dataset_merge/dataset.zip') as zf:
self.assertEqual(
sorted(zf.namelist()),
['data1.in', 'data2.in', 'data3.ans', 'data3.in'])
def ... | 26.526316 | 70 | 0.621032 | import unittest
import zipfile
class DatasetMergeTest(unittest.TestCase):
def test_dataset(self):
with zipfile.ZipFile('tests/dataset_merge/dataset.zip') as zf:
self.assertEqual(
sorted(zf.namelist()),
['data1.in', 'data2.in', 'data3.ans', 'data3.in'])
def ... | true | true |
f7f5bbd8b2efc772a612d7c71766823f2686d797 | 45,421 | py | Python | readthedocs/projects/tests/test_build_tasks.py | joaovitor3/readthedocs.org | ff9938cc58ded092e01ae601fca22fc012c764f4 | [
"MIT"
] | null | null | null | readthedocs/projects/tests/test_build_tasks.py | joaovitor3/readthedocs.org | ff9938cc58ded092e01ae601fca22fc012c764f4 | [
"MIT"
] | null | null | null | readthedocs/projects/tests/test_build_tasks.py | joaovitor3/readthedocs.org | ff9938cc58ded092e01ae601fca22fc012c764f4 | [
"MIT"
] | null | null | null | import os
from unittest import mock
from django.conf import settings
from django.test import TestCase
from django.utils import timezone
import django_dynamic_fixture as fixture
import pytest
from readthedocs.builds.constants import (
EXTERNAL,
BUILD_STATUS_FAILURE,
BUILD_STATE_FINISHED,
BUILD_STATUS... | 33.54579 | 144 | 0.487946 | import os
from unittest import mock
from django.conf import settings
from django.test import TestCase
from django.utils import timezone
import django_dynamic_fixture as fixture
import pytest
from readthedocs.builds.constants import (
EXTERNAL,
BUILD_STATUS_FAILURE,
BUILD_STATE_FINISHED,
BUILD_STATUS... | true | true |
f7f5bc496f5a86a65d9930b6ea8d4d59610ecb17 | 12,282 | py | Python | var/spack/repos/builtin/packages/cudnn/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-06-28T02:20:15.000Z | 2021-06-28T02:20:15.000Z | var/spack/repos/builtin/packages/cudnn/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-03-05T22:27:10.000Z | 2021-09-28T20:28:06.000Z | var/spack/repos/builtin/packages/cudnn/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-06-28T04:48:37.000Z | 2021-06-28T04:48:37.000Z | # Copyright 2013-2021 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)
import os
import platform
from spack import *
_versions = {
# cuDNN 8.2.4
'8.2.4.15-11.4': {
'Linux-x86_... | 47.789883 | 102 | 0.703306 |
import os
import platform
from spack import *
_versions = {
'8.2.4.15-11.4': {
'Linux-x86_64': '0e5d2df890b9967efa6619da421310d97323565a79f05a1a8cb9b7165baad0d7',
'Linux-ppc64le': 'af8749ca83fd6bba117c8bee31b787b7f204946e864294030ee0091eb7d3577e',
'Linux-aarch64': '48b11f19e9cd34... | true | true |
f7f5bd20d407393cdf4da3a5333fb860782150b3 | 175 | py | Python | examples/DeepBlueAI/AutoCV2/kakaobrain2/skeleton2/optim/__init__.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | 3 | 2020-12-15T02:40:43.000Z | 2021-01-14T02:32:13.000Z | examples/DeepBlueAI/AutoCV2/kakaobrain2/skeleton2/optim/__init__.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | null | null | null | examples/DeepBlueAI/AutoCV2/kakaobrain2/skeleton2/optim/__init__.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | 4 | 2021-01-07T05:41:38.000Z | 2021-04-07T08:02:22.000Z | # -*- coding: utf-8 -*-
# pylint: disable=wildcard-import
from __future__ import absolute_import
from .optimizers2 import *
from .scheduler2 import *
from .sgdw2 import SGDW
| 21.875 | 38 | 0.754286 |
from __future__ import absolute_import
from .optimizers2 import *
from .scheduler2 import *
from .sgdw2 import SGDW
| true | true |
f7f5bd3af4717698726f9b6f33f0f5576bb7b9d8 | 49,814 | py | Python | autotest/osr/osr_esri.py | kartverket/gdal | 5ae18e641a3dedd9bd83f072ffcd8008d1d3a868 | [
"MIT"
] | 3 | 2016-07-25T16:30:13.000Z | 2022-02-11T11:09:08.000Z | autotest/osr/osr_esri.py | kartverket/gdal | 5ae18e641a3dedd9bd83f072ffcd8008d1d3a868 | [
"MIT"
] | null | null | null | autotest/osr/osr_esri.py | kartverket/gdal | 5ae18e641a3dedd9bd83f072ffcd8008d1d3a868 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test some ESRI specific translation issues.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
############################################... | 42.906115 | 565 | 0.618922 | true | true | |
f7f5bda15c469db8f225aad16ad3d8871fdef33c | 394 | py | Python | bindings/pydeck/tests/fixtures.py | StijnAmeloot/deck.gl | d67688e3f71a37e2f021dde6681bb1516bebac2b | [
"MIT"
] | 7,702 | 2016-04-19T15:56:09.000Z | 2020-04-14T19:03:13.000Z | bindings/pydeck/tests/fixtures.py | StijnAmeloot/deck.gl | d67688e3f71a37e2f021dde6681bb1516bebac2b | [
"MIT"
] | 3,126 | 2016-04-20T23:04:42.000Z | 2020-04-14T22:46:02.000Z | bindings/pydeck/tests/fixtures.py | StijnAmeloot/deck.gl | d67688e3f71a37e2f021dde6681bb1516bebac2b | [
"MIT"
] | 1,526 | 2016-05-07T06:55:07.000Z | 2020-04-14T18:52:19.000Z | import glob
import json
import os
import logging
here = os.path.dirname(os.path.abspath(__file__))
fixture_path = os.path.join(here, "./fixtures/")
json_glob = os.path.join(fixture_path, "*.json")
fixtures = {}
for fname in glob.glob(json_glob):
fixture_text = open(fname).read()
fixture_name = os.path.basen... | 23.176471 | 63 | 0.715736 | import glob
import json
import os
import logging
here = os.path.dirname(os.path.abspath(__file__))
fixture_path = os.path.join(here, "./fixtures/")
json_glob = os.path.join(fixture_path, "*.json")
fixtures = {}
for fname in glob.glob(json_glob):
fixture_text = open(fname).read()
fixture_name = os.path.basen... | true | true |
f7f5bdadbd38e935ad2f80602d3dbf8de084c816 | 35,200 | py | Python | python3-alpha/python3-src/Lib/test/test_tempfile.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 4 | 2016-05-04T07:05:22.000Z | 2020-09-24T00:21:05.000Z | python3-alpha/python3-src/Lib/test/test_tempfile.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | null | null | null | python3-alpha/python3-src/Lib/test/test_tempfile.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 1 | 2018-12-12T03:06:17.000Z | 2018-12-12T03:06:17.000Z | # tempfile.py unit tests.
import tempfile
import os
import sys
import re
import warnings
import unittest
from test import support
if hasattr(os, 'stat'):
import stat
has_stat = 1
else:
has_stat = 0
has_textmode = (tempfile._text_openflags != tempfile._bin_openflags)
has_spawnl = hasattr(os, 'spawnl')
#... | 32.532348 | 100 | 0.5775 |
import tempfile
import os
import sys
import re
import warnings
import unittest
from test import support
if hasattr(os, 'stat'):
import stat
has_stat = 1
else:
has_stat = 0
has_textmode = (tempfile._text_openflags != tempfile._bin_openflags)
has_spawnl = hasattr(os, 'spawnl')
if sys.platform in ('ope... | true | true |
f7f5be4efb1389a6b77a671f867be48566e8a37e | 131 | py | Python | config.py | safeers/Glimpses-journal | 65a71a8be5b0b0812170a684b85cd39ac2f4a1fe | [
"MIT"
] | 1 | 2021-03-04T09:30:34.000Z | 2021-03-04T09:30:34.000Z | config.py | safeers/Glimpses-journal | 65a71a8be5b0b0812170a684b85cd39ac2f4a1fe | [
"MIT"
] | null | null | null | config.py | safeers/Glimpses-journal | 65a71a8be5b0b0812170a684b85cd39ac2f4a1fe | [
"MIT"
] | null | null | null | DEBUG = False
SECRET_KEY = 'ENTER YOU KEY HERE'
SQLALCHEMY_DATABASE_URI = 'sqlite:///db/glimpses.db'
SESSION_PERMANENT = False
| 26.2 | 53 | 0.748092 | DEBUG = False
SECRET_KEY = 'ENTER YOU KEY HERE'
SQLALCHEMY_DATABASE_URI = 'sqlite:///db/glimpses.db'
SESSION_PERMANENT = False
| true | true |
f7f5be7417959f74dffbd6184c2997f823c1523a | 1,224 | py | Python | code-experiments/build/python/python/solvers.py | ysakanaka/coco | ebd5c30ccc83910755e379322b23d60a4b72ef38 | [
"BSD-3-Clause"
] | null | null | null | code-experiments/build/python/python/solvers.py | ysakanaka/coco | ebd5c30ccc83910755e379322b23d60a4b72ef38 | [
"BSD-3-Clause"
] | null | null | null | code-experiments/build/python/python/solvers.py | ysakanaka/coco | ebd5c30ccc83910755e379322b23d60a4b72ef38 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import numpy as np
# ===============================================
# the most basic example solver
# ===============================================
def random_search(fun, lbounds, ubounds, budget):
"""Efficient implementation of uniform random sea... | 42.206897 | 73 | 0.556373 | from __future__ import absolute_import, division, print_function
import numpy as np
def random_search(fun, lbounds, ubounds, budget):
lbounds, ubounds = np.array(lbounds), np.array(ubounds)
dim, x_min, f_min = len(lbounds), None, None
max_chunk_size = 1 + 4e4 / dim
while budget > 0:
chunk = ... | true | true |
f7f5be8655097ceab1f46f42527ed396366cf2c0 | 1,674 | py | Python | richtext_blog/admin.py | timmygee/django-richtext-blog | 88bf111039f8ed65212d6bfd45d72a0948094b71 | [
"BSD-3-Clause"
] | 1 | 2021-04-07T13:29:26.000Z | 2021-04-07T13:29:26.000Z | richtext_blog/admin.py | timmygee/django-richtext-blog | 88bf111039f8ed65212d6bfd45d72a0948094b71 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T21:06:37.000Z | 2021-06-10T17:22:41.000Z | richtext_blog/admin.py | timmygee/django-richtext-blog | 88bf111039f8ed65212d6bfd45d72a0948094b71 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from models import Post, Comment, Tag
from forms import PostFormAdmin
class CommentInline(admin.TabularInline):
"""
Inline definition for comments
"""
model = Comment
extra = 0
class PostAdmin(admin.ModelAdmin):
form = PostFormAdmin
fields = ('title', 'slu... | 32.192308 | 79 | 0.654719 | from django.contrib import admin
from models import Post, Comment, Tag
from forms import PostFormAdmin
class CommentInline(admin.TabularInline):
model = Comment
extra = 0
class PostAdmin(admin.ModelAdmin):
form = PostFormAdmin
fields = ('title', 'slug', 'tags', 'content', 'comments_closed')
searc... | true | true |
f7f5bfc9ccef1d53f581db598903ab2e20a2c931 | 1,000 | py | Python | Fontes_Databricks/tools/registrarModelos_pkl.py | marciodelima/case2_santander_engml_stream | 9df333b38b59b6459b7654d49d834159572e583c | [
"Apache-2.0"
] | null | null | null | Fontes_Databricks/tools/registrarModelos_pkl.py | marciodelima/case2_santander_engml_stream | 9df333b38b59b6459b7654d49d834159572e583c | [
"Apache-2.0"
] | null | null | null | Fontes_Databricks/tools/registrarModelos_pkl.py | marciodelima/case2_santander_engml_stream | 9df333b38b59b6459b7654d49d834159572e583c | [
"Apache-2.0"
] | null | null | null | # Databricks notebook source
try:
import mlflow
import mlflow.sklearn
import pickle
import sklearn.ensemble.forest
except:
%pip install mlflow
%pip install -U scikit-learn==0.21.3
# COMMAND ----------
import mlflow
import mlflow.sklearn
import pickle
import sklearn.ensemble.forest
from mlflo... | 23.809524 | 111 | 0.709 |
try:
import mlflow
import mlflow.sklearn
import pickle
import sklearn.ensemble.forest
except:
%pip install mlflow
%pip install -U scikit-learn==0.21.3
import mlflow
import mlflow.sklearn
import pickle
import sklearn.ensemble.forest
from mlflow.tracking import MlflowClient
def registrarMod... | false | true |
f7f5bfe7441456eea5e19c5239e14688e607d2f6 | 347 | py | Python | __init__.py | krisgesling/example-prompts-skill | 6c7af1c04c2e98ac3a1684a31bd38d1ec34773c6 | [
"Apache-2.0"
] | null | null | null | __init__.py | krisgesling/example-prompts-skill | 6c7af1c04c2e98ac3a1684a31bd38d1ec34773c6 | [
"Apache-2.0"
] | null | null | null | __init__.py | krisgesling/example-prompts-skill | 6c7af1c04c2e98ac3a1684a31bd38d1ec34773c6 | [
"Apache-2.0"
] | null | null | null | from mycroft import MycroftSkill, intent_file_handler
class ExamplePrompts(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
@intent_file_handler('prompts.example.intent')
def handle_prompts_example(self, message):
self.speak_dialog('prompts.example')
def create_skill():
... | 21.6875 | 53 | 0.743516 | from mycroft import MycroftSkill, intent_file_handler
class ExamplePrompts(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
@intent_file_handler('prompts.example.intent')
def handle_prompts_example(self, message):
self.speak_dialog('prompts.example')
def create_skill():
... | true | true |
f7f5bff8edbd5af7441e254a709676c225d5b99c | 563 | py | Python | packages/python/plotly/plotly/validators/isosurface/lighting/_vertexnormalsepsilon.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/lighting/_vertexnormalsepsilon.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/lighting/_vertexnormalsepsilon.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class VertexnormalsepsilonValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="vertexnormalsepsilon",
parent_name="isosurface.lighting",
**kwargs,
):
super(VertexnormalsepsilonValidator, self).__in... | 29.631579 | 82 | 0.619893 | import _plotly_utils.basevalidators
class VertexnormalsepsilonValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="vertexnormalsepsilon",
parent_name="isosurface.lighting",
**kwargs,
):
super(VertexnormalsepsilonValidator, self).__in... | true | true |
f7f5c009b199bc7ef9a5027e3b0529619dd07115 | 310 | py | Python | tests/tensortrade/unit/stochastic/processes/test_ornstein_uhlenbeck.py | bwcknr/tensortrade | 376f5e4cc4ad7df271774088884fbe88f8feb7d8 | [
"Apache-2.0"
] | 34 | 2020-06-05T22:39:53.000Z | 2022-01-09T03:09:12.000Z | tests/tensortrade/unit/stochastic/processes/test_ornstein_uhlenbeck.py | bwcknr/tensortrade | 376f5e4cc4ad7df271774088884fbe88f8feb7d8 | [
"Apache-2.0"
] | 1 | 2022-01-17T06:38:27.000Z | 2022-01-17T06:38:27.000Z | tests/tensortrade/unit/stochastic/processes/test_ornstein_uhlenbeck.py | bwcknr/tensortrade | 376f5e4cc4ad7df271774088884fbe88f8feb7d8 | [
"Apache-2.0"
] | 8 | 2020-06-01T12:09:53.000Z | 2022-01-18T14:45:29.000Z |
from tensortrade.stochastic import ornstein
def test_shape():
frame = ornstein(
base_price=7000,
base_volume=15000,
start_date='2018-01-01',
start_date_format='%Y-%m-%d',
times_to_generate=1500,
time_frame='1d'
)
assert frame.shape == (1500, 5)
| 18.235294 | 43 | 0.603226 |
from tensortrade.stochastic import ornstein
def test_shape():
frame = ornstein(
base_price=7000,
base_volume=15000,
start_date='2018-01-01',
start_date_format='%Y-%m-%d',
times_to_generate=1500,
time_frame='1d'
)
assert frame.shape == (1500, 5)
| true | true |
f7f5c146a419f052cf8ece01dbb0fdbc582900c1 | 10,646 | py | Python | test/utils/spark_common.py | kamalsharma2/horovod | 69c33290f8cc43073fade45619e80d9ffb3b9653 | [
"Apache-2.0"
] | 2 | 2019-03-12T09:13:50.000Z | 2019-04-01T04:40:45.000Z | test/utils/spark_common.py | kamalsharma2/horovod | 69c33290f8cc43073fade45619e80d9ffb3b9653 | [
"Apache-2.0"
] | 6 | 2021-10-05T21:23:43.000Z | 2021-12-13T23:19:10.000Z | test/utils/spark_common.py | kamalsharma2/horovod | 69c33290f8cc43073fade45619e80d9ffb3b9653 | [
"Apache-2.0"
] | 3 | 2021-05-29T06:12:49.000Z | 2022-02-24T06:34:59.000Z | # Copyright 2019 Uber Technologies, 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 applica... | 36.710345 | 98 | 0.604358 |
import contextlib
import os
import platform
import pytest
import stat
import sys
import threading
import time
from tempfile import TemporaryDirectory
import numpy as np
from pyspark.ml import Pipeline
from pyspark.ml.feature import VectorAssembler
from pyspark.ml.linalg import DenseVector, VectorUDT
f... | true | true |
f7f5c19c7d6083ee486243895480d339cb88424c | 994 | py | Python | isi_sdk_7_2/test/test_storagepool_tier_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_7_2/test/test_storagepool_tier_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_7_2/test/test_storagepool_tier_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 2
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_7_2
from isi... | 24.243902 | 111 | 0.732394 |
from __future__ import absolute_import
import unittest
import isi_sdk_7_2
from isi_sdk_7_2.models.storagepool_tier_create_params import StoragepoolTierCreateParams
from isi_sdk_7_2.rest import ApiException
class TestStoragepoolTierCreateParams(unittest.TestCase):
def setUp(self):
pass
def te... | true | true |
f7f5c26c667a211d33e76e25789ac36c66c98844 | 88 | py | Python | src/wsgi.py | notalab/api | 7afc0f9896c0d4b5f81605f671f13a9168c78380 | [
"MIT"
] | null | null | null | src/wsgi.py | notalab/api | 7afc0f9896c0d4b5f81605f671f13a9168c78380 | [
"MIT"
] | null | null | null | src/wsgi.py | notalab/api | 7afc0f9896c0d4b5f81605f671f13a9168c78380 | [
"MIT"
] | null | null | null | from app import server as application
if __name__ == "__main__":
application.run()
| 17.6 | 37 | 0.727273 | from app import server as application
if __name__ == "__main__":
application.run()
| true | true |
f7f5c2c7a18f0b161b88356a9d716a4b3735882f | 3,587 | py | Python | nikola/plugins/command_install_theme.py | servalproject/nikola | 4d78504d93597894f3da4a434dfafdec907601a7 | [
"MIT"
] | 1 | 2015-12-14T21:38:33.000Z | 2015-12-14T21:38:33.000Z | nikola/plugins/command_install_theme.py | servalproject/nikola | 4d78504d93597894f3da4a434dfafdec907601a7 | [
"MIT"
] | null | null | null | nikola/plugins/command_install_theme.py | servalproject/nikola | 4d78504d93597894f3da4a434dfafdec907601a7 | [
"MIT"
] | null | null | null | # Copyright (c) 2012 Roberto Alsina y otros.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, copy, modify, merge, pub... | 33.839623 | 77 | 0.583775 |
from __future__ import print_function
import os
import json
from io import BytesIO
try:
import requests
except ImportError:
requests = None
from nikola.plugin_categories import Command
from nikola import utils
class CommandInstallTheme(Command):
name = "install_theme"
doc_... | true | true |
f7f5c2d63dba77ef9936bd159c67774e2fd84d48 | 18,208 | py | Python | pythonProject1/venv/Lib/site-packages/asyncgui/_multierror.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/asyncgui/_multierror.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/asyncgui/_multierror.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | import sys
import traceback
import textwrap
import warnings
exc_key = id
################################################################
# MultiError
################################################################
def _filter_impl(handler, root_exc):
# We have a tree of MultiError's, like:
#
# MultiE... | 36.416 | 99 | 0.634172 | import sys
import traceback
import textwrap
import warnings
exc_key = id
modified, then the 'raise' here makes this
# frame show up in the traceback; otherwise, we leave no trace.)
class MultiErrorCatcher:
_handler = None
def __enter__(self):
pass
def __exit__(self, etype, exc, tb):
if ... | true | true |
f7f5c3805e224faa0e6f4135b79f272a7f215658 | 694 | py | Python | examples/cxx/exceptions/example_test.py | cablelabs/esp-idf | a8f9a65f251a33cd5a5deaf14e95ca417abad41b | [
"Apache-2.0"
] | 8,747 | 2016-08-18T14:58:24.000Z | 2022-03-31T20:58:55.000Z | examples/cxx/exceptions/example_test.py | cablelabs/esp-idf | a8f9a65f251a33cd5a5deaf14e95ca417abad41b | [
"Apache-2.0"
] | 8,603 | 2016-08-20T08:55:56.000Z | 2022-03-31T23:04:01.000Z | examples/cxx/exceptions/example_test.py | cablelabs/esp-idf | a8f9a65f251a33cd5a5deaf14e95ca417abad41b | [
"Apache-2.0"
] | 6,380 | 2016-08-18T18:17:00.000Z | 2022-03-31T22:25:57.000Z | from __future__ import print_function
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
def test_examples_system_cpp_exceptions(env, extra_data):
dut = env.get_dut('cpp_exceptions_example', 'examples/cxx/exceptions')
# start test
dut.start_app()
lines ... | 28.916667 | 82 | 0.651297 | from __future__ import print_function
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
def test_examples_system_cpp_exceptions(env, extra_data):
dut = env.get_dut('cpp_exceptions_example', 'examples/cxx/exceptions')
dut.start_app()
lines = ['app_main... | true | true |
f7f5c3a340fc76671335f919b083f33982664084 | 37,744 | py | Python | src/v5.3/resources/swagger_client/api/grading_periods_api.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 2 | 2021-04-27T17:18:17.000Z | 2021-04-27T19:14:39.000Z | src/v5.3/resources/swagger_client/api/grading_periods_api.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | null | null | null | src/v5.3/resources/swagger_client/api/grading_periods_api.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 1 | 2022-01-06T09:43:11.000Z | 2022-01-06T09:43:11.000Z | # coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... | 52.132597 | 578 | 0.653905 |
from __future__ import absolute_import
import re
import six
from swagger_client.api_client import ApiClient
class GradingPeriodsApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def delete_grad... | true | true |
f7f5c443f2c5959b87c2e5bd81cb08ddad82aedb | 6,625 | py | Python | venv/Lib/site-packages/pybrain/optimization/distributionbased/cmaes.py | ishatserka/MachineLearningAndDataAnalysisCoursera | e82e772df2f4aec162cb34ac6127df10d14a625a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pybrain/optimization/distributionbased/cmaes.py | ishatserka/MachineLearningAndDataAnalysisCoursera | e82e772df2f4aec162cb34ac6127df10d14a625a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pybrain/optimization/distributionbased/cmaes.py | ishatserka/MachineLearningAndDataAnalysisCoursera | e82e772df2f4aec162cb34ac6127df10d14a625a | [
"MIT"
] | null | null | null | __author__ = 'Tom Schaul, tom@idsia.ch; Sun Yi, yi@idsia.ch'
from numpy import floor, log, eye, zeros, array, sqrt, sum, dot, tile, outer, real
from numpy import exp, diag, power, ravel
from numpy.linalg import eig, norm
from numpy.random import randn
from pybrain.optimization.optimizer import ContinuousOptimizer
c... | 51.356589 | 133 | 0.594868 | __author__ = 'Tom Schaul, tom@idsia.ch; Sun Yi, yi@idsia.ch'
from numpy import floor, log, eye, zeros, array, sqrt, sum, dot, tile, outer, real
from numpy import exp, diag, power, ravel
from numpy.linalg import eig, norm
from numpy.random import randn
from pybrain.optimization.optimizer import ContinuousOptimizer
c... | false | true |
f7f5c450ee28aaa23a1f58b9fcf6f616c0b08313 | 3,225 | py | Python | tests/test_latent.py | kecsap/cleanlab | e54adb5f7ec7537c02dd9f3eff473765a087c707 | [
"MIT"
] | 2 | 2020-04-21T11:54:10.000Z | 2020-07-03T02:59:36.000Z | tests/test_latent.py | Royzon/cleanlab | e592e2ae2278018c8fdac33f20fd58659a825c3d | [
"MIT"
] | null | null | null | tests/test_latent.py | Royzon/cleanlab | e592e2ae2278018c8fdac33f20fd58659a825c3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from __future__ import print_function, absolute_import, division, unicode_literals, with_statement
from cleanlab import latent_algebra, latent_estimation
import numpy as np
import pytest
s = [0] * 10 + [1] * 5 + [2] * 15
nm = np.array([
[1.0, 0.0, 0.2],
[0.0, 0.7, 0.2]... | 27.564103 | 98 | 0.569612 |
from __future__ import print_function, absolute_import, division, unicode_literals, with_statement
from cleanlab import latent_algebra, latent_estimation
import numpy as np
import pytest
s = [0] * 10 + [1] * 5 + [2] * 15
nm = np.array([
[1.0, 0.0, 0.2],
[0.0, 0.7, 0.2],
[0.0, 0.3, 0.6]
])
def test_... | true | true |
f7f5c4640348689f7e2fc71a23715f9bc217fc03 | 4,981 | py | Python | tequila_fab/ansible.py | caktus/tequila-fab | 8b216db76fe959d010b7bf286e76ad9d8c68c7b8 | [
"BSD-3-Clause"
] | null | null | null | tequila_fab/ansible.py | caktus/tequila-fab | 8b216db76fe959d010b7bf286e76ad9d8c68c7b8 | [
"BSD-3-Clause"
] | 2 | 2019-04-01T13:35:04.000Z | 2019-09-06T15:10:36.000Z | tequila_fab/ansible.py | caktus/tequila-fab | 8b216db76fe959d010b7bf286e76ad9d8c68c7b8 | [
"BSD-3-Clause"
] | null | null | null | import configparser
import functools
import os
import os.path
# FIXME: when we drop Python 2 support, change the comment-style type annotations to Python 3 style.
import yaml
from fabric.api import env, local
from fabric.colors import red, green, yellow
from fabric.decorators import task
from fabric.tasks import exec... | 33.655405 | 131 | 0.62899 | import configparser
import functools
import os
import os.path
import yaml
from fabric.api import env, local
from fabric.colors import red, green, yellow
from fabric.decorators import task
from fabric.tasks import execute
from fabric.utils import abort
@functools.lru_cache(maxsize=1)
def find_ansible_config_file():... | true | true |
f7f5c4be51e1f45e1c8a496f9680be2b6dda8007 | 14,909 | py | Python | scripts/site_generator.py | jina-ai/benchmark | d9ade6464c1508c057299d9c6391872a7a70ba4b | [
"Apache-2.0"
] | 11 | 2021-08-06T07:33:44.000Z | 2022-03-15T02:24:37.000Z | scripts/site_generator.py | jina-ai/benchmarking | d9ade6464c1508c057299d9c6391872a7a70ba4b | [
"Apache-2.0"
] | 23 | 2021-08-01T20:43:40.000Z | 2021-11-22T20:46:54.000Z | scripts/site_generator.py | jina-ai/benchmarking | d9ade6464c1508c057299d9c6391872a7a70ba4b | [
"Apache-2.0"
] | 3 | 2021-09-12T07:14:41.000Z | 2022-03-21T19:47:23.000Z | #!/usr/bin/python3
import json
import os
import copy
from collections import defaultdict
from distutils.version import LooseVersion
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union, Optional
COLOR_VALUES = [
'#10a100',
'#7ead14',
'#bab73c',
'#e8c268',
'#e59838',
'#e36... | 30.995842 | 93 | 0.574821 |
import json
import os
import copy
from collections import defaultdict
from distutils.version import LooseVersion
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union, Optional
COLOR_VALUES = [
'#10a100',
'#7ead14',
'#bab73c',
'#e8c268',
'#e59838',
'#e36717',
'#de1414... | true | true |
f7f5c4e017dceec8833a671cf102daf3b759b3da | 2,700 | py | Python | spiders/pitchfork.py | sabbirahm3d/ds5k-capstone-dataset | d6d5ed5a1043de87b90e3e4b1737e6ffc563eeaf | [
"MIT"
] | null | null | null | spiders/pitchfork.py | sabbirahm3d/ds5k-capstone-dataset | d6d5ed5a1043de87b90e3e4b1737e6ffc563eeaf | [
"MIT"
] | 1 | 2021-06-01T22:50:17.000Z | 2021-06-01T22:50:17.000Z | spiders/pitchfork.py | ribbas/ds5k-capstone-dataset | d6d5ed5a1043de87b90e3e4b1737e6ffc563eeaf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from dateutil import parser as date_parser
from util import logs
class PitchFork(object):
def __init__(self):
self.base_url = "https://pitchfork.com/"
self.index_endp = "reviews/albums/?page={}"
self.range_log = logs.PITCHFORK_RANGE
... | 27.55102 | 115 | 0.487037 |
from dateutil import parser as date_parser
from util import logs
class PitchFork(object):
def __init__(self):
self.base_url = "https://pitchfork.com/"
self.index_endp = "reviews/albums/?page={}"
self.range_log = logs.PITCHFORK_RANGE
self.urls_log = logs.PITCHFORK_URLS
... | true | true |
f7f5c5b2cd5e39f335163ef59760d9ce0b1611b0 | 266 | py | Python | problems/unique-paths.py | sailikhithk/tech-interview-prep | e833764cf98915d56118bddfa0e01871c58de75e | [
"Apache-2.0"
] | null | null | null | problems/unique-paths.py | sailikhithk/tech-interview-prep | e833764cf98915d56118bddfa0e01871c58de75e | [
"Apache-2.0"
] | null | null | null | problems/unique-paths.py | sailikhithk/tech-interview-prep | e833764cf98915d56118bddfa0e01871c58de75e | [
"Apache-2.0"
] | null | null | null | class Solution(object):
def uniquePaths(self, m, n):
def factorial(n):
ans = 1
for i in xrange(1, n+1):
ans *= i
return ans
return factorial((m-1)+(n-1))/(factorial(n-1)*factorial(m-1)) | 29.555556 | 69 | 0.469925 | class Solution(object):
def uniquePaths(self, m, n):
def factorial(n):
ans = 1
for i in xrange(1, n+1):
ans *= i
return ans
return factorial((m-1)+(n-1))/(factorial(n-1)*factorial(m-1)) | true | true |
f7f5c5d940bd41d998996ecf200d16201e70d9fd | 2,679 | py | Python | m2cgen/assemblers/__init__.py | bcampbell-prosper/m2cgen | cc049fe5cd7060c2f0cd5a0331e3aa85fac2a336 | [
"MIT"
] | 3 | 2021-06-29T02:43:40.000Z | 2022-03-28T07:41:59.000Z | m2cgen/assemblers/__init__.py | bcampbell-prosper/m2cgen | cc049fe5cd7060c2f0cd5a0331e3aa85fac2a336 | [
"MIT"
] | null | null | null | m2cgen/assemblers/__init__.py | bcampbell-prosper/m2cgen | cc049fe5cd7060c2f0cd5a0331e3aa85fac2a336 | [
"MIT"
] | 3 | 2021-08-06T07:51:37.000Z | 2022-03-28T07:41:42.000Z | from .linear import LinearModelAssembler
from .tree import TreeModelAssembler
from .ensemble import RandomForestModelAssembler
from .boosting import XGBoostModelAssembler, LightGBMModelAssembler
from .svm import SVMModelAssembler
__all__ = [
LinearModelAssembler,
TreeModelAssembler,
RandomForestModelAssemb... | 31.892857 | 67 | 0.762225 | from .linear import LinearModelAssembler
from .tree import TreeModelAssembler
from .ensemble import RandomForestModelAssembler
from .boosting import XGBoostModelAssembler, LightGBMModelAssembler
from .svm import SVMModelAssembler
__all__ = [
LinearModelAssembler,
TreeModelAssembler,
RandomForestModelAssemb... | true | true |
f7f5c609cb611dd737f3e5740e40e83377fe583c | 534 | py | Python | py2.7/Agent.py | kamrulhasan1203/four-in-a-row | f02b6c26c22689d7637295e64a631ab80f75bc7e | [
"MIT"
] | null | null | null | py2.7/Agent.py | kamrulhasan1203/four-in-a-row | f02b6c26c22689d7637295e64a631ab80f75bc7e | [
"MIT"
] | null | null | null | py2.7/Agent.py | kamrulhasan1203/four-in-a-row | f02b6c26c22689d7637295e64a631ab80f75bc7e | [
"MIT"
] | null | null | null |
class Agent(object):
def __init__(self,name):
self.name = name # Name of the agent
"""
* Sets the role of this agent. Typlically will be called by your extended Game class (The class which extends the Game Class).
@param role
"""
def setRole(self,role):
self.role = role;
"""
* I... | 25.428571 | 130 | 0.662921 |
class Agent(object):
def __init__(self,name):
self.name = name
def setRole(self,role):
self.role = role;
def makeMove(game):
raise NotImplementedError('subclasses must override makeMove()!')
| true | true |
f7f5c65b3da19cbde999d5ab56fbed2f741b9489 | 13,939 | py | Python | ml/pipelinecomponents.py | deepakkumar1984/ml-api | 8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e | [
"MIT"
] | 60 | 2017-08-17T11:24:16.000Z | 2019-02-13T02:09:24.000Z | ml/pipelinecomponents.py | deepakkumar1984/ml-api | 8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e | [
"MIT"
] | null | null | null | ml/pipelinecomponents.py | deepakkumar1984/ml-api | 8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e | [
"MIT"
] | 35 | 2017-09-27T03:02:23.000Z | 2019-04-25T20:50:43.000Z | import simplejson as json
import os
import pickle
import jsonpickle
import numpy
import pandas
from keras import datasets
from keras.models import model_from_json
from pandas import read_csv
from sklearn.model_selection import cross_validate, train_test_split, cross_val_predict
from sklearn.preprocessing import Imputer... | 37.170667 | 149 | 0.560944 | import simplejson as json
import os
import pickle
import jsonpickle
import numpy
import pandas
from keras import datasets
from keras.models import model_from_json
from pandas import read_csv
from sklearn.model_selection import cross_validate, train_test_split, cross_val_predict
from sklearn.preprocessing import Imputer... | true | true |
f7f5c6b1cf962ad2edd0d920253400e4a153fe61 | 1,154 | py | Python | src/utils/torchvision_utils.py | likojack/bnv_fusion | 76b7354c6f3bf8c7f7e1ff4d958de0e73ec3e614 | [
"MIT"
] | null | null | null | src/utils/torchvision_utils.py | likojack/bnv_fusion | 76b7354c6f3bf8c7f7e1ff4d958de0e73ec3e614 | [
"MIT"
] | null | null | null | src/utils/torchvision_utils.py | likojack/bnv_fusion | 76b7354c6f3bf8c7f7e1ff4d958de0e73ec3e614 | [
"MIT"
] | null | null | null | import torch
import torchvision.transforms as T
import numpy as np
import cv2
from PIL import Image
import matplotlib as mpl
import matplotlib.cm as cm
def visualize_depth(depth, cmap=cv2.COLORMAP_JET):
"""
depth: (H, W)
"""
x = depth.astype(np.uint8)
x_ = Image.fromarray(cv2.applyColorMap(x, cmap... | 26.227273 | 75 | 0.637782 | import torch
import torchvision.transforms as T
import numpy as np
import cv2
from PIL import Image
import matplotlib as mpl
import matplotlib.cm as cm
def visualize_depth(depth, cmap=cv2.COLORMAP_JET):
x = depth.astype(np.uint8)
x_ = Image.fromarray(cv2.applyColorMap(x, cmap))
x_ = T.ToTensor()(x_)
... | true | true |
f7f5c6c9c7dfcf5547abd7f417e1f6fb0f620375 | 668 | py | Python | lib/queries.py | dcsan/mviz-oss | 8577cd45457add8a0b4c1d3e2f307fd66278ba39 | [
"MIT"
] | 1 | 2015-10-14T09:20:27.000Z | 2015-10-14T09:20:27.000Z | lib/queries.py | dcsan/mviz-oss | 8577cd45457add8a0b4c1d3e2f307fd66278ba39 | [
"MIT"
] | null | null | null | lib/queries.py | dcsan/mviz-oss | 8577cd45457add8a0b4c1d3e2f307fd66278ba39 | [
"MIT"
] | null | null | null | # example queries
# you will need to edit these to relate to your own DB and tables
from datetime import datetime, timedelta
tstoday = {"$gte": datetime.utcnow()-timedelta(days=1) }
tsweek = {"$gte": datetime.utcnow()-timedelta(days=7) }
query_list = {
'test': {
'desc': "test query",
'q': {'ts... | 24.740741 | 97 | 0.508982 |
from datetime import datetime, timedelta
tstoday = {"$gte": datetime.utcnow()-timedelta(days=1) }
tsweek = {"$gte": datetime.utcnow()-timedelta(days=7) }
query_list = {
'test': {
'desc': "test query",
'q': {'ts': tstoday },
'proj': {"player:uid":1, "ts":1 }
},
'test-ag':... | true | true |
f7f5c78ed708300fde6c7f3762ea17e5585d4a7f | 504 | py | Python | flod_booking/alembic/versions/20140322-1550-449c8b35b869_removed_request_uri_for_slots_and_.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2017-10-17T12:15:28.000Z | 2017-10-17T12:15:28.000Z | flod_booking/alembic/versions/20140322-1550-449c8b35b869_removed_request_uri_for_slots_and_.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2021-03-22T17:15:52.000Z | 2022-01-13T00:39:58.000Z | flod_booking/alembic/versions/20140322-1550-449c8b35b869_removed_request_uri_for_slots_and_.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-09-09T13:35:03.000Z | 2019-09-09T13:35:03.000Z | """Removed request_uri for slots and repeating slots
Revision ID: 449c8b35b869
Revises: 1b81c4cf5a5a
Create Date: 2014-03-22 15:50:29.543673
"""
# revision identifiers, used by Alembic.
revision = '449c8b35b869'
down_revision = '1b81c4cf5a5a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.dr... | 21.913043 | 78 | 0.759921 |
revision = '449c8b35b869'
down_revision = '1b81c4cf5a5a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.drop_column("slots", "request_uri")
op.drop_column("repeating_slots", "request_uri")
def downgrade():
raise NotImplementedError('This application does not support downgrades.')
| true | true |
f7f5c7f565ff0d3a1ff7872f491a25ed1e9e2f7d | 9,775 | py | Python | src/pretix/base/services/cancelevent.py | gvarela1981/pretix | 5cc0bd5d367a8cf46c9635d2e2e474c81210cb80 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/base/services/cancelevent.py | gvarela1981/pretix | 5cc0bd5d367a8cf46c9635d2e2e474c81210cb80 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/base/services/cancelevent.py | gvarela1981/pretix | 5cc0bd5d367a8cf46c9635d2e2e474c81210cb80 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import logging
from decimal import Decimal
from django.db import transaction
from django.db.models import Count, Exists, IntegerField, OuterRef, Subquery
from i18nfield.strings import LazyI18nString
from pretix.base.decimal import round_decimal
from pretix.base.email import get_email_context
from pretix.base.i18n imp... | 42.68559 | 116 | 0.606343 | import logging
from decimal import Decimal
from django.db import transaction
from django.db.models import Count, Exists, IntegerField, OuterRef, Subquery
from i18nfield.strings import LazyI18nString
from pretix.base.decimal import round_decimal
from pretix.base.email import get_email_context
from pretix.base.i18n imp... | true | true |
f7f5c8ac06118d9f67dc1d935d4f8a7d066d278d | 5,185 | py | Python | test/functional/test_framework/netutil.py | chx381/platopia | 563c616db768f813aa4482d39d8ed1d8aacaad4f | [
"MIT"
] | 5 | 2018-07-21T15:58:30.000Z | 2019-04-25T01:45:36.000Z | test/functional/test_framework/netutil.py | chx381/platopia | 563c616db768f813aa4482d39d8ed1d8aacaad4f | [
"MIT"
] | null | null | null | test/functional/test_framework/netutil.py | chx381/platopia | 563c616db768f813aa4482d39d8ed1d8aacaad4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
i... | 33.237179 | 114 | 0.584957 |
import sys
import socket
import fcntl
import struct
import array
import os
from binascii import unhexlify, hexlify
STATE_ESTABLISHED = '01'
STATE_SYN_SENT = '02'
STATE_SYN_RECV = '03'
STATE_FIN_WAIT1 = '04'
STATE_FIN_WAIT2 = '05'
STATE_TIME_WAIT = '06'
STATE_CLOSE = '07'
STATE_CLOSE_WAIT = '0... | true | true |
f7f5c95be93321c513cc50e7770d445c3df08d6e | 13,292 | py | Python | VirtualBox-5.0.0/src/VBox/ValidationKit/testboxscript/testboxcommand.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | 1 | 2015-04-30T14:18:45.000Z | 2015-04-30T14:18:45.000Z | VirtualBox-5.0.0/src/VBox/ValidationKit/testboxscript/testboxcommand.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | VirtualBox-5.0.0/src/VBox/ValidationKit/testboxscript/testboxcommand.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# $Id: testboxcommand.py $
"""
TestBox Script - Command Processor.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it a... | 37.232493 | 123 | 0.623834 |
"""
TestBox Script - Command Processor.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
Genera... | false | true |
f7f5ca0a0eb98019868528185866f28259e0d733 | 6,116 | py | Python | src/transformers/models/splinter/configuration_splinter.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 3 | 2021-12-27T20:13:38.000Z | 2021-12-28T14:11:20.000Z | src/transformers/models/splinter/configuration_splinter.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 2 | 2022-01-06T05:40:05.000Z | 2022-01-06T15:12:29.000Z | src/transformers/models/splinter/configuration_splinter.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 3 | 2022-01-06T04:44:13.000Z | 2022-02-18T23:35:21.000Z | # coding=utf-8
# Copyright 2021 Tel AViv University, AllenAI and The HuggingFace Inc. team. 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/... | 48.15748 | 172 | 0.699477 |
from ...configuration_utils import PretrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/config.json",
"tau/splinter-base-qass": "https://hugging... | true | true |
f7f5cd52b886a2eb7892ff45872ad88984c8d603 | 42,384 | py | Python | mbcd/models/bnn.py | Valerio-Colombo/mbcd | 8bb8adce78d303e991d8afdb3fbc045970297f83 | [
"MIT"
] | null | null | null | mbcd/models/bnn.py | Valerio-Colombo/mbcd | 8bb8adce78d303e991d8afdb3fbc045970297f83 | [
"MIT"
] | null | null | null | mbcd/models/bnn.py | Valerio-Colombo/mbcd | 8bb8adce78d303e991d8afdb3fbc045970297f83 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import time
import pdb
import itertools
from collections import OrderedDict
import tensorflow as tf
import numpy as np
from tqdm import trange
from scipy.io import savemat, loadmat
from mbcd.models.... | 45.379015 | 156 | 0.574014 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import time
import pdb
import itertools
from collections import OrderedDict
import tensorflow as tf
import numpy as np
from tqdm import trange
from scipy.io import savemat, loadmat
from mbcd.models.... | true | true |
f7f5cd78a8cb2d9936f4fdce573d1f7f372206f9 | 108 | py | Python | health-insurance-lead-prediction/src/utils/__init__.py | sudhirln92/analytics-vidhya-competitions | 2e284f1ae7e3ddd4d810714db0b8eca5770756ee | [
"MIT"
] | null | null | null | health-insurance-lead-prediction/src/utils/__init__.py | sudhirln92/analytics-vidhya-competitions | 2e284f1ae7e3ddd4d810714db0b8eca5770756ee | [
"MIT"
] | null | null | null | health-insurance-lead-prediction/src/utils/__init__.py | sudhirln92/analytics-vidhya-competitions | 2e284f1ae7e3ddd4d810714db0b8eca5770756ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 28 09:13:14 2021
@author: sudhir
""" | 13.5 | 35 | 0.601852 | true | true | |
f7f5ce55521d23880ed708056861d4c9b06247ba | 1,990 | py | Python | indicators/support_resistance.py | LucienZuber/AlgoTrader | cc6088a525ed6311c9a6969880c739b91bdebf5c | [
"MIT"
] | null | null | null | indicators/support_resistance.py | LucienZuber/AlgoTrader | cc6088a525ed6311c9a6969880c739b91bdebf5c | [
"MIT"
] | null | null | null | indicators/support_resistance.py | LucienZuber/AlgoTrader | cc6088a525ed6311c9a6969880c739b91bdebf5c | [
"MIT"
] | null | null | null | import pandas as pd
import datetime
def detect_support_resistances(df: pd.DataFrame, initial_state: int = 20, precision: int = 3, expiration_time: datetime.timedelta = datetime.timedelta(days=7)):
initial_min = df['Close'].iloc[:initial_state].idxmin()
initial_max = df['Close'].iloc[:initial_state].idxmax()
... | 48.536585 | 160 | 0.711055 | import pandas as pd
import datetime
def detect_support_resistances(df: pd.DataFrame, initial_state: int = 20, precision: int = 3, expiration_time: datetime.timedelta = datetime.timedelta(days=7)):
initial_min = df['Close'].iloc[:initial_state].idxmin()
initial_max = df['Close'].iloc[:initial_state].idxmax()
... | true | true |
f7f5ce7b86e61819247ebe7b6e7895b847a6dc64 | 7,329 | py | Python | doc/conf.py | akornatskyy/wheezy.web | 417834db697cf1f78f3a60cc880b9fd25d40c6de | [
"MIT"
] | 17 | 2020-08-29T18:45:51.000Z | 2022-03-02T19:37:13.000Z | doc/conf.py | akornatskyy/wheezy.web | 417834db697cf1f78f3a60cc880b9fd25d40c6de | [
"MIT"
] | 29 | 2020-07-18T04:34:03.000Z | 2021-07-06T09:42:36.000Z | doc/conf.py | akornatskyy/wheezy.web | 417834db697cf1f78f3a60cc880b9fd25d40c6de | [
"MIT"
] | 1 | 2022-03-14T08:41:42.000Z | 2022-03-14T08:41:42.000Z | # -*- coding: utf-8 -*-
#
# wheezy.web documentation build configuration file, created by
# sphinx-quickstart on Fri Sep 9 20:36:50 2011.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | 31.454936 | 79 | 0.713331 |
import os
import sys
sys.path.extend([
os.path.abspath(os.path.join('..', 'src'))
])
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.doctest',
'sphinx.ext.coverage', 'sphinx.ext.viewcode',
'sphinx_rtd_theme'
]
templates_path = ['_templates']
source_suffix = '.rst'
ma... | true | true |
f7f5d07ba2509e0dc988d96fc69ac203ba9eecd9 | 5,394 | py | Python | tests/operator/test_augmented_arithmetic_assignment.py | maggyero/desugar | fd283d4e93d4dbae385577627051094460b74fc8 | [
"MIT"
] | 109 | 2020-07-19T20:18:51.000Z | 2022-03-14T19:03:48.000Z | tests/operator/test_augmented_arithmetic_assignment.py | maggyero/desugar | fd283d4e93d4dbae385577627051094460b74fc8 | [
"MIT"
] | 7 | 2020-08-18T14:20:36.000Z | 2022-02-08T18:16:42.000Z | tests/operator/test_augmented_arithmetic_assignment.py | maggyero/desugar | fd283d4e93d4dbae385577627051094460b74fc8 | [
"MIT"
] | 4 | 2020-10-05T20:27:21.000Z | 2021-09-02T19:27:16.000Z | import operator
import sys
import pytest
import desugar.operator
from . import common
class AugmentedAssignmentTests:
"""Tests for augmented arithmetic assignment.
Subclasses are expected to provide the actual assignment to test.
"""
def test_inplace(self, op):
"""Providing __i*__ should... | 30.303371 | 80 | 0.702818 | import operator
import sys
import pytest
import desugar.operator
from . import common
class AugmentedAssignmentTests:
def test_inplace(self, op):
assert op(common.Lvalue(), object()) == self.lvalue_method
def test_lhs_fallback(self, op):
assert op(common.LHS(), object()) == self.lhs_metho... | true | true |
f7f5d0e61d891440989de0ef4bbda8ae9a7aa950 | 9,467 | py | Python | hyperlinker/app/Historical Backup Scripts/TRCExternalPrep.py | JAckleyLSNYC/GitPython | 93fa78346e85ec6b8d00c5b362d6b498598a0444 | [
"bzip2-1.0.6"
] | null | null | null | hyperlinker/app/Historical Backup Scripts/TRCExternalPrep.py | JAckleyLSNYC/GitPython | 93fa78346e85ec6b8d00c5b362d6b498598a0444 | [
"bzip2-1.0.6"
] | null | null | null | hyperlinker/app/Historical Backup Scripts/TRCExternalPrep.py | JAckleyLSNYC/GitPython | 93fa78346e85ec6b8d00c5b362d6b498598a0444 | [
"bzip2-1.0.6"
] | null | null | null | from flask import request, send_from_directory
from app import app, DataWizardTools, HousingToolBox
import pandas as pd
@app.route("/TRCExternalPrep", methods=['GET', 'POST'])
def TRCExternalPrep():
#upload file from computer via browser
if request.method == 'POST':
print(request.files['file'])... | 43.228311 | 199 | 0.572304 | from flask import request, send_from_directory
from app import app, DataWizardTools, HousingToolBox
import pandas as pd
@app.route("/TRCExternalPrep", methods=['GET', 'POST'])
def TRCExternalPrep():
if request.method == 'POST':
print(request.files['file'])
f = request.files['file']
... | true | true |
f7f5d17b33b79cb5cd0246b3b9b74d231c1ca656 | 83,231 | py | Python | include/ClientFiles.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | include/ClientFiles.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | include/ClientFiles.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | from . import ClientConstants as CC
from . import ClientImageHandling
from . import ClientPaths
from . import ClientThreading
import collections
import gc
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusFileHandling
from . import HydrusGlobals as HG
from .... | 38.196879 | 708 | 0.524768 | from . import ClientConstants as CC
from . import ClientImageHandling
from . import ClientPaths
from . import ClientThreading
import collections
import gc
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusFileHandling
from . import HydrusGlobals as HG
from .... | true | true |
f7f5d24400cc77a154e73aae8bfd54bf527c7723 | 2,608 | py | Python | experimenting/buttons.py | aidanchandra/PiPod | 615c0c4476ac1b00518b722b7235ed3348337956 | [
"MIT"
] | null | null | null | experimenting/buttons.py | aidanchandra/PiPod | 615c0c4476ac1b00518b722b7235ed3348337956 | [
"MIT"
] | null | null | null | experimenting/buttons.py | aidanchandra/PiPod | 615c0c4476ac1b00518b722b7235ed3348337956 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Adafruit Industries
# Author: James DeVito
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | 30.325581 | 79 | 0.729294 |
import time
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
L_pin = 27
R_pin = 23
C_pin = 4
U_pin = 17
D_pin = 22
A_pin = 5
B_pin = 6
RST = 24
DC = 23
SPI_PORT = 0
SPI_DEVICE = 0
width = 128
height = 64
image = Image.new('1', (width, heig... | true | true |
f7f5d31879898e8d9e0f37333d1db472f160987f | 150 | py | Python | actions/get_servers.py | StackStorm-Exchange/powerdns | 13879e0e66b29a466d82c1077a1d4abde69c0d3e | [
"Apache-2.0"
] | null | null | null | actions/get_servers.py | StackStorm-Exchange/powerdns | 13879e0e66b29a466d82c1077a1d4abde69c0d3e | [
"Apache-2.0"
] | null | null | null | actions/get_servers.py | StackStorm-Exchange/powerdns | 13879e0e66b29a466d82c1077a1d4abde69c0d3e | [
"Apache-2.0"
] | null | null | null | from lib.base import PowerDNSClient
class Servers(PowerDNSClient):
def _run(self):
return [str(server) for server in self._api.servers]
| 21.428571 | 60 | 0.726667 | from lib.base import PowerDNSClient
class Servers(PowerDNSClient):
def _run(self):
return [str(server) for server in self._api.servers]
| true | true |
f7f5d3be2504f1ae43721558b750ac5ecdd8b85d | 5,412 | py | Python | cynetworkx/algorithms/approximation/clique.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 12 | 2019-07-23T08:07:53.000Z | 2022-03-09T06:13:16.000Z | cynetworkx/algorithms/approximation/clique.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 7 | 2019-08-30T07:00:00.000Z | 2021-12-30T08:02:56.000Z | cynetworkx/algorithms/approximation/clique.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 5 | 2020-10-10T03:40:32.000Z | 2021-11-23T12:28:53.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2011-2018 by
# Nicholas Mancuso <nick.mancuso@gmail.com>
# All rights reserved.
# BSD license.
# Copyright 2016-2018 NetworkX developers.
# NetworkX is distributed under a BSD license
#
# Authors: Nicholas Mancuso (nick.mancuso@gmail.com)
# Jeffery Fink... | 31.283237 | 79 | 0.653732 |
from operator import itemgetter
import cynetworkx as nx
from cynetworkx.utils import not_implemented_for
from cynetworkx.algorithms.approximation import ramsey
__all__ = ["clique_removal", "max_clique", "large_clique_size"]
def max_clique(G):
if G is None:
raise ValueError("Expected NetworkX ... | true | true |
f7f5d43fdde621d1c66eb65dcf08d7c8ba56ca85 | 1,516 | py | Python | hard-gists/2da57d5b039aab4da7ce/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/2da57d5b039aab4da7ce/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/2da57d5b039aab4da7ce/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
"""
Sniff a specific port for Bit Torrent DHT traffic and print
requests/responses in human readable form.
Reference: http://www.bittorrent.org/beps/bep_0005.html
"""
from pcapy import open_live
from bencode import bdecode
from socket import inet_aton, inet_ntoa
import dpkt
import sys
# Default... | 24.451613 | 86 | 0.637863 |
"""
Sniff a specific port for Bit Torrent DHT traffic and print
requests/responses in human readable form.
Reference: http://www.bittorrent.org/beps/bep_0005.html
"""
from pcapy import open_live
from bencode import bdecode
from socket import inet_aton, inet_ntoa
import dpkt
import sys
filter_port = 51413
# Callba... | false | true |
f7f5d5f2abba71c323e7799f5033fd8c94e9215a | 177 | py | Python | Codefights/arcade/intro/level-6/28.alphabeticShift/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codefights/arcade/intro/level-6/28.alphabeticShift/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codefights/arcade/intro/level-6/28.alphabeticShift/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python3
def alphabeticShift(inputString):
la = ''.join(chr(i) for i in range(ord('a'), ord('z') + 1))
return inputString.translate(str.maketrans(la, la[1:] + la[0]))
| 29.5 | 67 | 0.632768 |
def alphabeticShift(inputString):
la = ''.join(chr(i) for i in range(ord('a'), ord('z') + 1))
return inputString.translate(str.maketrans(la, la[1:] + la[0]))
| true | true |
f7f5d62860d7e3f120c2e90cab80011842d58dd6 | 2,707 | py | Python | juanzeng.py | zh981008/zh-farm | e8cdb977579eb29417be000331c342427c4daf54 | [
"MIT"
] | null | null | null | juanzeng.py | zh981008/zh-farm | e8cdb977579eb29417be000331c342427c4daf54 | [
"MIT"
] | null | null | null | juanzeng.py | zh981008/zh-farm | e8cdb977579eb29417be000331c342427c4daf54 | [
"MIT"
] | null | null | null | import uiautomator2 as u2
import time
from utils import *
from cv import *
from Automator import *
import matplotlib.pylab as plt
plt.ion()
fig, ax = plt.subplots(1)
plt.show()
a = Automator()
a.start()
def login_auth(ac,pwd):
need_auth = a.login(ac=ac,pwd=pwd)
if need_auth:
auth_name,auth_id = rand... | 26.539216 | 79 | 0.583303 | import uiautomator2 as u2
import time
from utils import *
from cv import *
from Automator import *
import matplotlib.pylab as plt
plt.ion()
fig, ax = plt.subplots(1)
plt.show()
a = Automator()
a.start()
def login_auth(ac,pwd):
need_auth = a.login(ac=ac,pwd=pwd)
if need_auth:
auth_name,auth_id = rand... | true | true |
f7f5d63b33bee31b805f7f20fb39eeec887ad8d8 | 22,072 | py | Python | numba/core/compiler.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | numba/core/compiler.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2019-08-29T21:03:09.000Z | 2019-08-29T21:04:26.000Z | numba/core/compiler.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from collections import namedtuple
import copy
import warnings
from numba.core.tracing import event
from numba.core import (utils, errors, typing, interpreter, bytecode, postproc,
config, callconv, cpu)
from numba.parfors.parfor import ParforDiagnostics
from numba.core.inline_closurecall import... | 35.428571 | 80 | 0.612269 | from collections import namedtuple
import copy
import warnings
from numba.core.tracing import event
from numba.core import (utils, errors, typing, interpreter, bytecode, postproc,
config, callconv, cpu)
from numba.parfors.parfor import ParforDiagnostics
from numba.core.inline_closurecall import... | true | true |
f7f5d68fade0667b27df7cc25182e2c33488b2f0 | 76,864 | py | Python | tests/test_operator.py | tbenthompson/devito | 7ced4ba4ceca1680c68412172870b7a3c6e6d09a | [
"MIT"
] | 1 | 2022-01-02T17:34:39.000Z | 2022-01-02T17:34:39.000Z | tests/test_operator.py | tbenthompson/devito | 7ced4ba4ceca1680c68412172870b7a3c6e6d09a | [
"MIT"
] | null | null | null | tests/test_operator.py | tbenthompson/devito | 7ced4ba4ceca1680c68412172870b7a3c6e6d09a | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from itertools import permutations
from conftest import skipif
from devito import (Grid, Eq, Operator, Constant, Function, TimeFunction,
SparseFunction, SparseTimeFunction, Dimension, error, SpaceDimension,
NODE, CELL, dimensions, configuration, ... | 40.095983 | 90 | 0.538093 | import numpy as np
import pytest
from itertools import permutations
from conftest import skipif
from devito import (Grid, Eq, Operator, Constant, Function, TimeFunction,
SparseFunction, SparseTimeFunction, Dimension, error, SpaceDimension,
NODE, CELL, dimensions, configuration, ... | true | true |
f7f5d74d896bc94ab74cf5854acf8c14ae8d3e9d | 870 | py | Python | aspen/testing/pytest_fixtures.py | Acidburn0zzz/aspen-python | 3b25a3ca041bd0bf4d313f7fc3a15cf092903de7 | [
"MIT"
] | null | null | null | aspen/testing/pytest_fixtures.py | Acidburn0zzz/aspen-python | 3b25a3ca041bd0bf4d313f7fc3a15cf092903de7 | [
"MIT"
] | null | null | null | aspen/testing/pytest_fixtures.py | Acidburn0zzz/aspen-python | 3b25a3ca041bd0bf4d313f7fc3a15cf092903de7 | [
"MIT"
] | null | null | null | """
aspen.testing.pytest_fixtures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import pytest
from aspen.testing.harness import Harness
from filesystem_tree import Filesy... | 17.755102 | 42 | 0.714943 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import pytest
from aspen.testing.harness import Harness
from filesystem_tree import FilesystemTree
@pytest.yield_fixture
def fs():
fs = FilesystemTree()... | true | true |
f7f5d767ffa516d1f4d559a6abe08690f6030622 | 2,951 | py | Python | test/transform/test_token.py | marrow/schema | e2b16ec45329a646156388936c2e779ddcd8fa77 | [
"MIT"
] | 3 | 2016-09-03T07:00:50.000Z | 2021-06-19T18:52:56.000Z | test/transform/test_token.py | marrow/schema | e2b16ec45329a646156388936c2e779ddcd8fa77 | [
"MIT"
] | 6 | 2015-01-23T19:32:04.000Z | 2019-10-23T15:36:48.000Z | test/transform/test_token.py | marrow/schema | e2b16ec45329a646156388936c2e779ddcd8fa77 | [
"MIT"
] | 2 | 2015-11-13T20:02:17.000Z | 2018-01-30T12:01:47.000Z | from marrow.schema.testing import TransformTest
from marrow.schema.transform.complex import TokenPatternAttribute, Token, tags, terms
class TestTokenGeneral(object):
def test_token_pattern_cache(self):
assert 'pattern' not in tags.__data__
pattern, regex = tags.pattern
assert 'pattern' in tags.__data__
... | 28.375 | 124 | 0.635717 | from marrow.schema.testing import TransformTest
from marrow.schema.transform.complex import TokenPatternAttribute, Token, tags, terms
class TestTokenGeneral(object):
def test_token_pattern_cache(self):
assert 'pattern' not in tags.__data__
pattern, regex = tags.pattern
assert 'pattern' in tags.__data__
... | true | true |
f7f5d77d97cfa7bbc797a3fe5d68c07b300729e5 | 8,090 | py | Python | preprocess/normalization.py | Maggedelle/Project-6-Pose-Estimation | 473019c236bf4b44918ee65959722705a95644e7 | [
"Apache-2.0"
] | null | null | null | preprocess/normalization.py | Maggedelle/Project-6-Pose-Estimation | 473019c236bf4b44918ee65959722705a95644e7 | [
"Apache-2.0"
] | null | null | null | preprocess/normalization.py | Maggedelle/Project-6-Pose-Estimation | 473019c236bf4b44918ee65959722705a95644e7 | [
"Apache-2.0"
] | null | null | null |
import json
def normalizer():
armcurls_f1 = []
armcurls_f2 = []
armcurls_f3 = []
armcurls_f4 = []
armcurls_f5 = []
armraises_f1 = []
armraises_f2 = []
armraises_f3 = []
armraises_f4 = []
armraises_f5 = []
pushups_f1 = []
pushups_f2 = []
pushups_f3 = []
pushups_... | 45.965909 | 108 | 0.554512 |
import json
def normalizer():
armcurls_f1 = []
armcurls_f2 = []
armcurls_f3 = []
armcurls_f4 = []
armcurls_f5 = []
armraises_f1 = []
armraises_f2 = []
armraises_f3 = []
armraises_f4 = []
armraises_f5 = []
pushups_f1 = []
pushups_f2 = []
pushups_f3 = []
pushups_... | true | true |
f7f5d7c01e9a3caafb03e155388140156ba58d82 | 51,366 | py | Python | Lib/test/test_fstring.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | 1 | 2020-10-25T16:33:22.000Z | 2020-10-25T16:33:22.000Z | Lib/test/test_fstring.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | Lib/test/test_fstring.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
# There are tests here with unicode string literals and
# identifiers. There's a code in ast.c that was added because of a
# failure with a non-ascii-only expression. So, I have tests for
# that. There are workarounds that would let me run tests for that
# code without unicode identifiers... | 40.863962 | 151 | 0.496729 |
# failure with a non-ascii-only expression. So, I have tests for
# that. There are workarounds that would let me run tests for that
# code without unicode identifiers and strings, but just using them
# directly seems like the easiest and therefore safest thing to do.
# Unicode identifiers in tests is allowed b... | false | true |
f7f5d90f582a08243e52ff2ab98c3b6b941e7eaf | 1,387 | py | Python | Embeddings-preparation/word2vec/word2vec.py | danovia/Hebrew-punctuator2 | a3a4410eb951a7aa08da779487c928fcba6ee589 | [
"MIT"
] | 2 | 2018-09-11T18:26:48.000Z | 2018-09-16T06:15:15.000Z | Embeddings-preparation/word2vec/word2vec.py | danovia/Hebrew-punctuator2 | a3a4410eb951a7aa08da779487c928fcba6ee589 | [
"MIT"
] | null | null | null | Embeddings-preparation/word2vec/word2vec.py | danovia/Hebrew-punctuator2 | a3a4410eb951a7aa08da779487c928fcba6ee589 | [
"MIT"
] | null | null | null | import multiprocessing
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
import time
def train():
# Model 1 - create morpheme-embeddings
start = time.time()
print(start)
inp1 = "../wiki-he-morph-FULL.txt"
out_model1 = "./wiki.he-morph.window10.word2vec.skipgram-mo... | 33.02381 | 91 | 0.679164 | import multiprocessing
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
import time
def train():
start = time.time()
print(start)
inp1 = "../wiki-he-morph-FULL.txt"
out_model1 = "./wiki.he-morph.window10.word2vec.skipgram-model"
model1 = Word2Vec(LineSentenc... | true | true |
f7f5d93d19378a819de943e05dc70bc0bc8aa570 | 19,164 | py | Python | src/twisted/conch/recvline.py | KentShikama/twisted | 65c933d19ab52175c1d7823bf5e054a266bfdc55 | [
"MIT",
"Unlicense"
] | 1 | 2022-01-14T05:50:29.000Z | 2022-01-14T05:50:29.000Z | src/twisted/conch/recvline.py | KentShikama/twisted | 65c933d19ab52175c1d7823bf5e054a266bfdc55 | [
"MIT",
"Unlicense"
] | 3 | 2015-08-20T09:05:57.000Z | 2015-11-10T08:30:51.000Z | src/twisted/conch/recvline.py | KentShikama/twisted | 65c933d19ab52175c1d7823bf5e054a266bfdc55 | [
"MIT",
"Unlicense"
] | 3 | 2021-08-21T04:09:17.000Z | 2021-08-25T01:00:41.000Z | # -*- test-case-name: twisted.conch.test.test_recvline -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Basic line editing support.
@author: Jp Calderone
"""
import string
from typing import Dict
from zope.interface import implementer
from twisted.conch.insults import insults, helper... | 33.562172 | 90 | 0.670685 |
import string
from typing import Dict
from zope.interface import implementer
from twisted.conch.insults import insults, helper
from twisted.python import reflect
from twisted.python.compat import iterbytes
from twisted.logger import Logger
_counters: Dict[str, int] = {}
class Logging:
def __init__(self,... | true | true |
f7f5da2c16432c397b9ad0722a3dfd84365369fa | 405 | py | Python | efficient-eagles/early_internet/early_internet/wsgi.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 40 | 2020-08-02T07:38:22.000Z | 2021-07-26T01:46:50.000Z | efficient-eagles/early_internet/early_internet/wsgi.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 134 | 2020-07-31T12:15:45.000Z | 2020-12-13T04:42:19.000Z | efficient-eagles/early_internet/early_internet/wsgi.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 101 | 2020-07-31T12:00:47.000Z | 2021-11-01T09:06:58.000Z | """
WSGI config for early_internet 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/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "early_internet.settings")
application = get_wsgi_application()
| true | true |
f7f5da4dd988b88fa3806b8d114866fa74d20550 | 52,530 | py | Python | calendarserver/tap/util.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | calendarserver/tap/util.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | calendarserver/tap/util.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | # -*- test-case-name: calendarserver.tap.test.test_caldav -*-
##
# Copyright (c) 2005-2015 Apple 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.apach... | 34.973369 | 137 | 0.636113 |
"""
Utilities for assembling the service and resource hierarchy.
"""
__all__ = [
"FakeRequest",
"getDBPool",
"getRootResource",
"getSSLPassphrase",
"MemoryLimitService",
"postAlert",
"preFlightChecks",
]
from calendarserver.accesslog import DirectoryLogWrapperResource
from c... | false | true |
f7f5db70dae472604b535c2a10bb9f6d17e68374 | 22,902 | py | Python | ibllib/io/spikeglx.py | Yiman00/ibllib | 7fe5dcba1edd40ea05c974fe8b8584001c6c0c15 | [
"MIT"
] | 1 | 2020-11-21T07:02:21.000Z | 2020-11-21T07:02:21.000Z | ibllib/io/spikeglx.py | Yiman00/ibllib | 7fe5dcba1edd40ea05c974fe8b8584001c6c0c15 | [
"MIT"
] | null | null | null | ibllib/io/spikeglx.py | Yiman00/ibllib | 7fe5dcba1edd40ea05c974fe8b8584001c6c0c15 | [
"MIT"
] | null | null | null | import json
import logging
from pathlib import Path
import re
import numpy as np
import mtscomp
from brainbox.core import Bunch
from ibllib.ephys import neuropixel as neuropixel
from ibllib.io import hashfile
SAMPLE_SIZE = 2 # int16
DEFAULT_BATCH_SIZE = 1e6
_logger = logging.getLogger('ibllib')
class Reader:
... | 39.015332 | 99 | 0.617937 | import json
import logging
from pathlib import Path
import re
import numpy as np
import mtscomp
from brainbox.core import Bunch
from ibllib.ephys import neuropixel as neuropixel
from ibllib.io import hashfile
SAMPLE_SIZE = 2
DEFAULT_BATCH_SIZE = 1e6
_logger = logging.getLogger('ibllib')
class Reader:
def __i... | true | true |
f7f5dc1e65c4a16ce808b0adc7271fc0f364439f | 1,291 | py | Python | custom_components/steam_wishlist/util.py | hudsonbrendon/steam-wishlist | 01e77b60be4f938d6b60e91e4eecf4abf608565b | [
"MIT"
] | null | null | null | custom_components/steam_wishlist/util.py | hudsonbrendon/steam-wishlist | 01e77b60be4f938d6b60e91e4eecf4abf608565b | [
"MIT"
] | null | null | null | custom_components/steam_wishlist/util.py | hudsonbrendon/steam-wishlist | 01e77b60be4f938d6b60e91e4eecf4abf608565b | [
"MIT"
] | null | null | null | import logging
from typing import Any, Dict, Optional
from .types import SteamGame
_LOGGER = logging.getLogger(__name__)
def get_steam_game(game_id: int, game: Dict[str, Any]) -> SteamGame:
"""Get a SteamGame from a game dict."""
pricing: Optional[Dict[str, Any]] = None
try:
pricing: Dict[str, A... | 31.487805 | 85 | 0.627421 | import logging
from typing import Any, Dict, Optional
from .types import SteamGame
_LOGGER = logging.getLogger(__name__)
def get_steam_game(game_id: int, game: Dict[str, Any]) -> SteamGame:
pricing: Optional[Dict[str, Any]] = None
try:
pricing: Dict[str, Any] = game["subs"][0]
discount_pct =... | true | true |
f7f5de097c8fde0b3907e40b97e7b90b59e09795 | 424 | py | Python | packages/python/plotly/plotly/validators/scatterternary/textfont/_sizesrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/scatterternary/textfont/_sizesrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/scatterternary/textfont/_sizesrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="scatterternary.textfont", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 30.285714 | 84 | 0.658019 | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="scatterternary.textfont", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
f7f5de50264e89fe2d527f1eec0a5bc7d9751835 | 446 | py | Python | tomriddle/cli.py | MatrixManAtYrService/tomriddle | d7d48850883edeb1238a166b3bb3cfd6679f934e | [
"MIT"
] | null | null | null | tomriddle/cli.py | MatrixManAtYrService/tomriddle | d7d48850883edeb1238a166b3bb3cfd6679f934e | [
"MIT"
] | null | null | null | tomriddle/cli.py | MatrixManAtYrService/tomriddle | d7d48850883edeb1238a166b3bb3cfd6679f934e | [
"MIT"
] | null | null | null | import argparse
import sys
from .tomriddle import main
def tomriddle(args=None, dry=False):
parser = argparse.ArgumentParser()
parser.add_argument("answer")
parser.add_argument("-s", "--substr", nargs="+", default=[])
if args:
args = parser.parse_args(args)
else:
args = parser.par... | 18.583333 | 64 | 0.618834 | import argparse
import sys
from .tomriddle import main
def tomriddle(args=None, dry=False):
parser = argparse.ArgumentParser()
parser.add_argument("answer")
parser.add_argument("-s", "--substr", nargs="+", default=[])
if args:
args = parser.parse_args(args)
else:
args = parser.par... | true | true |
f7f5e09452efb81b838ba55ac166be2fd2a7229f | 4,262 | py | Python | lib/urlwatch/cli.py | k-nut/urlwatch | 60b5c88e976e3f45f8fa206e58b52357007e8ef2 | [
"BSD-3-Clause"
] | null | null | null | lib/urlwatch/cli.py | k-nut/urlwatch | 60b5c88e976e3f45f8fa206e58b52357007e8ef2 | [
"BSD-3-Clause"
] | null | null | null | lib/urlwatch/cli.py | k-nut/urlwatch | 60b5c88e976e3f45f8fa206e58b52357007e8ef2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of urlwatch (https://thp.io/2008/urlwatch/).
# Copyright (c) 2008-2020 Thomas Perl <m@thp.io>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | 36.741379 | 100 | 0.748944 |
import logging
import os.path
import signal
import socket
import sys
from appdirs import AppDirs
pkgname = 'urlwatch'
urlwatch_dir = os.path.expanduser(os.path.join('~', '.' + pkgname))
urlwatch_cache_dir = AppDirs(pkgname).user_cache_dir
if not os.path.exists(urlwatch_dir):
urlwa... | true | true |
f7f5e1e3e8ab9a2942883d0d9335983047369038 | 953 | py | Python | src/deprecated/evaluate.py | whong92/3D_DL | 3c15bca3cc87c3197d38a785f6d1146911a82921 | [
"MIT"
] | 35 | 2019-03-04T00:06:20.000Z | 2022-02-04T22:34:17.000Z | src/deprecated/evaluate.py | 921kiyo/C530 | e64402575661a1e534cb8effe122d8fe8aed156e | [
"MIT"
] | 3 | 2021-03-12T13:12:26.000Z | 2022-01-17T08:47:49.000Z | src/deprecated/evaluate.py | 921kiyo/C530 | e64402575661a1e534cb8effe122d8fe8aed156e | [
"MIT"
] | 12 | 2019-09-26T08:35:18.000Z | 2021-12-09T05:39:59.000Z | from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing import image
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D
from keras import backend as K
from time import *
# load model
from keras.models import load_model
# For Function to feed images to model ... | 25.756757 | 74 | 0.776495 | from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing import image
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D
from keras import backend as K
from time import *
from keras.models import load_model
from keras.preprocessing.image import ImageDataGen... | true | true |
f7f5e222eb40a661b2bb5c47f5adf2163618c601 | 639 | py | Python | setup.py | nesen2019/everyday | 8439d99b12a938cb8325cdaceef8861af062abc5 | [
"MIT"
] | null | null | null | setup.py | nesen2019/everyday | 8439d99b12a938cb8325cdaceef8861af062abc5 | [
"MIT"
] | null | null | null | setup.py | nesen2019/everyday | 8439d99b12a938cb8325cdaceef8861af062abc5 | [
"MIT"
] | null | null | null | import os
import re
from setuptools import setup, find_packages, find_namespace_packages
with open("clecode/__init__.py", "r") as f:
data = f.read()
_version = re.findall(r'__version__="([0-9.]+)"', data)[0]
packages = find_packages(
where="clecode*",
exclude=(),
include=("*",)
)
setup(
name=... | 20.612903 | 68 | 0.593114 | import os
import re
from setuptools import setup, find_packages, find_namespace_packages
with open("clecode/__init__.py", "r") as f:
data = f.read()
_version = re.findall(r'__version__="([0-9.]+)"', data)[0]
packages = find_packages(
where="clecode*",
exclude=(),
include=("*",)
)
setup(
name=... | true | true |
f7f5e2722ff3291efbc1fdc8cd3ac1b3aa8c046f | 25,189 | py | Python | homeassistant/components/sonos/media_player.py | vanstinator/core | 7b2947bad7d41bc6ffc695929650dfcfd19998e1 | [
"Apache-2.0"
] | 1 | 2022-02-23T11:08:51.000Z | 2022-02-23T11:08:51.000Z | homeassistant/components/sonos/media_player.py | vanstinator/core | 7b2947bad7d41bc6ffc695929650dfcfd19998e1 | [
"Apache-2.0"
] | 18 | 2021-11-03T06:21:27.000Z | 2022-03-31T06:20:57.000Z | homeassistant/components/sonos/media_player.py | vanstinator/core | 7b2947bad7d41bc6ffc695929650dfcfd19998e1 | [
"Apache-2.0"
] | null | null | null | """Support to interface with Sonos players."""
from __future__ import annotations
from asyncio import run_coroutine_threadsafe
import datetime
import logging
from typing import Any
from soco import alarms
from soco.core import (
MUSIC_SRC_LINE_IN,
MUSIC_SRC_RADIO,
PLAY_MODE_BY_MEANING,
PLAY_MODES,
)
f... | 34.411202 | 121 | 0.640875 | from __future__ import annotations
from asyncio import run_coroutine_threadsafe
import datetime
import logging
from typing import Any
from soco import alarms
from soco.core import (
MUSIC_SRC_LINE_IN,
MUSIC_SRC_RADIO,
PLAY_MODE_BY_MEANING,
PLAY_MODES,
)
from soco.data_structures import DidlFavorite
im... | true | true |
f7f5e2abbf768435c740118d454a124fb26492fe | 72,925 | py | Python | torch/distributed/distributed_c10d.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 206 | 2020-11-28T22:56:38.000Z | 2022-03-27T02:33:04.000Z | torch/distributed/distributed_c10d.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 19 | 2020-12-09T23:13:14.000Z | 2022-01-24T23:24:08.000Z | torch/distributed/distributed_c10d.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 28 | 2020-11-29T15:25:12.000Z | 2022-01-20T02:16:27.000Z | import pickle
import torch
import warnings
from torch._six import string_classes
from datetime import timedelta
# This module is wildcard imported from torch.distributed.
# TODO: specify __all__
from .constants import default_pg_timeout
from .rendezvous import rendezvous, register_rendezvous_handler # noqa: F401
fro... | 35.555826 | 100 | 0.613205 | import pickle
import torch
import warnings
from torch._six import string_classes
from datetime import timedelta
from .constants import default_pg_timeout
from .rendezvous import rendezvous, register_rendezvous_handler
from . import (
AllreduceOptions,
AllreduceCoalescedOptions,
AllToAllOptions,
Br... | true | true |
f7f5e320d4652bbee83401635f5dc4e47758d938 | 1,035 | py | Python | src/app_defs.py | muteio/ghostnode-tool | c42868ed6c009c47482d23ebac0d101adbd8c103 | [
"MIT"
] | 1 | 2019-11-02T01:39:52.000Z | 2019-11-02T01:39:52.000Z | src/app_defs.py | muteio/ghostnode-tool | c42868ed6c009c47482d23ebac0d101adbd8c103 | [
"MIT"
] | null | null | null | src/app_defs.py | muteio/ghostnode-tool | c42868ed6c009c47482d23ebac0d101adbd8c103 | [
"MIT"
] | 1 | 2021-03-05T13:34:53.000Z | 2021-03-05T13:34:53.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-03
APP_NAME_SHORT = 'GhostnodeTool'
APP_NAME_LONG = 'Ghostnode Tool'
APP_DATA_DIR_NAME = '.ghostnode-tool'
PROJECT_URL = 'https://github.com/nixplatform/ghostnode-tool'
FEE_DUFF_PER_BYTE = 1
MIN_TX_FEE = 10000
SCREENSHOT_MODE = Fa... | 25.243902 | 100 | 0.658937 |
APP_NAME_SHORT = 'GhostnodeTool'
APP_NAME_LONG = 'Ghostnode Tool'
APP_DATA_DIR_NAME = '.ghostnode-tool'
PROJECT_URL = 'https://github.com/nixplatform/ghostnode-tool'
FEE_DUFF_PER_BYTE = 1
MIN_TX_FEE = 10000
SCREENSHOT_MODE = False
class HWType:
trezor = 'TREZOR'
keepkey = 'KEEPKEY'
ledger_nano_s = '... | true | true |
f7f5e35656b2f14a25339f96dfd20edb5759f9e6 | 1,882 | py | Python | aalh_iit_buildings_007/merge-description-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_buildings_007/merge-description-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_buildings_007/merge-description-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | from openpyxl import load_workbook
filename = 'aalh_iit_buildings_007.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 8
maximumcol = 8
minimumrow = 7
maximumrow = 519
iterationrow = 7
targetcol = 46
linkstring = 'Terms associated with the photograph are: '
for row in ws.i... | 41.822222 | 105 | 0.656217 | from openpyxl import load_workbook
filename = 'aalh_iit_buildings_007.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 8
maximumcol = 8
minimumrow = 7
maximumrow = 519
iterationrow = 7
targetcol = 46
linkstring = 'Terms associated with the photograph are: '
for row in ws.i... | true | true |
f7f5e37006435c4215de3866be56824b2f8d5101 | 23,397 | py | Python | tests/unit/test_speechManager/speechManagerTestHarness.py | marlon-sousa/nvda | 83738d7d9150fb379083eb3918e9c78c78610489 | [
"bzip2-1.0.6"
] | 19 | 2016-05-11T05:15:31.000Z | 2022-03-17T12:40:10.000Z | tests/unit/test_speechManager/speechManagerTestHarness.py | marlon-sousa/nvda | 83738d7d9150fb379083eb3918e9c78c78610489 | [
"bzip2-1.0.6"
] | 307 | 2015-08-27T11:22:33.000Z | 2022-03-29T10:43:34.000Z | tests/unit/test_speechManager/speechManagerTestHarness.py | marlon-sousa/nvda | 83738d7d9150fb379083eb3918e9c78c78610489 | [
"bzip2-1.0.6"
] | 14 | 2016-03-28T07:31:49.000Z | 2022-03-30T04:56:35.000Z | # A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2020 NV Access Limited
"""A test harness for interacting with the SpeechManager class."""
import typing
import unittest
from contextlib import context... | 40.201031 | 111 | 0.76061 |
import typing
import unittest
from contextlib import contextmanager
from typing import (
Callable,
Tuple,
Union,
Optional,
List,
)
from unittest import mock
from unittest.mock import (
MagicMock,
)
from dataclasses import dataclass
import queueHandler
import speech.manager
from speech... | true | true |
f7f5e41be16ac5586b75c17018d99a852bcb4239 | 3,204 | py | Python | flowvision/datasets/semeion.py | ZiqiuChi/vision | b5ecf5431f7767d8920a69005e7822185ad31f81 | [
"BSD-3-Clause"
] | null | null | null | flowvision/datasets/semeion.py | ZiqiuChi/vision | b5ecf5431f7767d8920a69005e7822185ad31f81 | [
"BSD-3-Clause"
] | null | null | null | flowvision/datasets/semeion.py | ZiqiuChi/vision | b5ecf5431f7767d8920a69005e7822185ad31f81 | [
"BSD-3-Clause"
] | null | null | null | """
"""
import os
import os.path
from typing import Any, Callable, Optional, Tuple
import numpy as np
from PIL import Image
from .utils import download_url, check_integrity
from .vision import VisionDataset
class SEMEION(VisionDataset):
r"""`SEMEION <http://archive.ics.uci.edu/ml/datasets/semeion+handwritten+di... | 32.363636 | 94 | 0.611735 | import os
import os.path
from typing import Any, Callable, Optional, Tuple
import numpy as np
from PIL import Image
from .utils import download_url, check_integrity
from .vision import VisionDataset
class SEMEION(VisionDataset):
url = (
"http://archive.ics.uci.edu/ml/machine-learning-databases/semeion/s... | true | true |
f7f5e5203e7d356dd965ea1b26c523bcfb81a50d | 2,341 | py | Python | backend/server/processor/lime_bike_socket_feed_processor.py | shiv12095/realtimeviz | ee2bf10b5f9467212f9a9ce8957d80456ebd0259 | [
"MIT"
] | 1 | 2021-03-03T13:54:15.000Z | 2021-03-03T13:54:15.000Z | backend/server/processor/lime_bike_socket_feed_processor.py | shiv12095/realtimeviz | ee2bf10b5f9467212f9a9ce8957d80456ebd0259 | [
"MIT"
] | null | null | null | backend/server/processor/lime_bike_socket_feed_processor.py | shiv12095/realtimeviz | ee2bf10b5f9467212f9a9ce8957d80456ebd0259 | [
"MIT"
] | 1 | 2021-03-03T13:59:48.000Z | 2021-03-03T13:59:48.000Z | from utils import Constants, TimeUtils
from adapter import KafkaAdapter, DBAdapter
from datetime import datetime
import pytz
class LimeBikeSocketFeedProcessor:
def __init__(self):
self.kafka_adapter = KafkaAdapter()
self.kafka_consumer_group_id = "lime_bike_socket_feed"
self.kafka_consumer... | 36.578125 | 92 | 0.648868 | from utils import Constants, TimeUtils
from adapter import KafkaAdapter, DBAdapter
from datetime import datetime
import pytz
class LimeBikeSocketFeedProcessor:
def __init__(self):
self.kafka_adapter = KafkaAdapter()
self.kafka_consumer_group_id = "lime_bike_socket_feed"
self.kafka_consumer... | true | true |
f7f5e6266694fe969ab87c4e1b4118116cf5b28b | 14,139 | py | Python | turbo_transformers/python/turbo_transformers/layers/modeling_distillbert.py | akirallL/TurboTransformers | 7ca851947b1ae3b08122c45cea0ceac48ee04c3b | [
"BSD-3-Clause"
] | 1,147 | 2020-04-24T06:45:50.000Z | 2022-03-30T15:33:16.000Z | turbo_transformers/python/turbo_transformers/layers/modeling_distillbert.py | akirallL/TurboTransformers | 7ca851947b1ae3b08122c45cea0ceac48ee04c3b | [
"BSD-3-Clause"
] | 140 | 2020-04-25T10:54:15.000Z | 2022-03-11T08:13:11.000Z | turbo_transformers/python/turbo_transformers/layers/modeling_distillbert.py | akirallL/TurboTransformers | 7ca851947b1ae3b08122c45cea0ceac48ee04c3b | [
"BSD-3-Clause"
] | 151 | 2020-04-24T06:49:01.000Z | 2022-03-21T13:48:54.000Z | # Copyright (C) 2020 THL A29 Limited, a Tencent company.
# All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may
# not use this file except in compliance with the License. You may
# obtain a copy of the License at
# https://opensource.org/licenses/BSD-3-Clause
# Unless required by appl... | 44.885714 | 123 | 0.614117 |
try:
import turbo_transformers.turbo_transformers_cxxd as cxx
except ImportError:
import turbo_transformers.turbo_transformers_cxx as cxx
from typing import Union, Optional, Sequence
import torch
from .return_type import convert_returns_as_type, ReturnType
from .utils import try_convert, conve... | true | true |
f7f5e694b4c51be159b3dae1821689d04ef5e36d | 6,013 | py | Python | compositional-rl-benchmark/composition/spinningup_training/train_compositional_ppo_smallscale.py | collassubmission91/CompoSuite-Code | ac544efb68a11ed8a483b0932975c4949f0cec90 | [
"MIT"
] | null | null | null | compositional-rl-benchmark/composition/spinningup_training/train_compositional_ppo_smallscale.py | collassubmission91/CompoSuite-Code | ac544efb68a11ed8a483b0932975c4949f0cec90 | [
"MIT"
] | null | null | null | compositional-rl-benchmark/composition/spinningup_training/train_compositional_ppo_smallscale.py | collassubmission91/CompoSuite-Code | ac544efb68a11ed8a483b0932975c4949f0cec90 | [
"MIT"
] | null | null | null | from email.policy import default
import numpy as np
import argparse
import composition
import os
import json
import torch
from spinup.algos.pytorch.ppo.compositional_core import CompositionalMLPActorCritic
from spinup.algos.pytorch.ppo.ppo import ppo
from spinup.utils.run_utils import setup_logger_kwargs
from spinup.... | 39.300654 | 154 | 0.610677 | from email.policy import default
import numpy as np
import argparse
import composition
import os
import json
import torch
from spinup.algos.pytorch.ppo.compositional_core import CompositionalMLPActorCritic
from spinup.algos.pytorch.ppo.ppo import ppo
from spinup.utils.run_utils import setup_logger_kwargs
from spinup.... | true | true |
f7f5e6e12b4a7192382988cb23f1d0178eabb73a | 289 | py | Python | transformerz/serialization/rison.py | KOLANICH/transformerz.py | cdffce185d22d3d06564755e8106ee02bc00652d | [
"Unlicense"
] | 1 | 2021-03-14T19:44:30.000Z | 2021-03-14T19:44:30.000Z | transformerz/serialization/rison.py | KOLANICH/transformerz.py | cdffce185d22d3d06564755e8106ee02bc00652d | [
"Unlicense"
] | 3 | 2021-03-14T19:52:50.000Z | 2021-03-14T21:47:31.000Z | transformerz/serialization/rison.py | KOLANICH/transformerz.py | cdffce185d22d3d06564755e8106ee02bc00652d | [
"Unlicense"
] | null | null | null | __all__ = ("risonSerializer",)
import typing
try:
import prison as rison
except ImportError:
import rison
from ..core import FileTransformer
from . import jsonSerializableTypes
risonSerializer = FileTransformer("rison", rison.dumps, rison.loads, str, jsonSerializableTypes, "rison")
| 20.642857 | 105 | 0.788927 | __all__ = ("risonSerializer",)
import typing
try:
import prison as rison
except ImportError:
import rison
from ..core import FileTransformer
from . import jsonSerializableTypes
risonSerializer = FileTransformer("rison", rison.dumps, rison.loads, str, jsonSerializableTypes, "rison")
| true | true |
f7f5e728fe6eedc4619f8e94079261935d62e2ab | 4,735 | py | Python | trollo/actions.py | fuzzball81/trollo | 819f305e34c90239be287637e588127607f9e552 | [
"BSD-2-Clause"
] | null | null | null | trollo/actions.py | fuzzball81/trollo | 819f305e34c90239be287637e588127607f9e552 | [
"BSD-2-Clause"
] | null | null | null | trollo/actions.py | fuzzball81/trollo | 819f305e34c90239be287637e588127607f9e552 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012, Fog Creek Software, Inc.
# Copyright (c) 2016-2018, Red Hat, Inc.
# License: 2-clause BSD; see LICENSE.txt for details
import json
import requests
class Actions(object):
__module__ = 'trollo'
def __init__(self, apikey, token=None):
self._apikey = apikey
... | 52.611111 | 268 | 0.69018 |
import json
import requests
class Actions(object):
__module__ = 'trollo'
def __init__(self, apikey, token=None):
self._apikey = apikey
self._token = token
def get(self, action_id, fields=None, member=None, member_fields=None, memberCreator=None, memberCreator_fields=None):
re... | true | true |
f7f5e78a0d6f13711cc3689ea73d52df776eabd9 | 598 | py | Python | setup.py | techlift-tech/erpnext_support | 7209f06d818497f091b3313fa0b766814cbe7613 | [
"MIT"
] | null | null | null | setup.py | techlift-tech/erpnext_support | 7209f06d818497f091b3313fa0b766814cbe7613 | [
"MIT"
] | null | null | null | setup.py | techlift-tech/erpnext_support | 7209f06d818497f091b3313fa0b766814cbe7613 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in erpnext_support/__init__.py
from erpnext_support import __version__ as version
setup(
name='erpnext_support',
version=v... | 28.47619 | 104 | 0.779264 |
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
from erpnext_support import __version__ as version
setup(
name='erpnext_support',
version=version,
description='Custom App to ehnance current ERPNext Support to make it a full fledged... | true | true |
f7f5e7b10578739d02077f5a802c1d6791c0686b | 2,328 | py | Python | azure-batch/azure/batch/models/exit_options.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | null | null | null | azure-batch/azure/batch/models/exit_options.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-batch/azure/batch/models/exit_options.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.5 | 85 | 0.678694 |
from msrest.serialization import Model
class ExitOptions(Model):
_attribute_map = {
'job_action': {'key': 'jobAction', 'type': 'JobAction'},
'dependency_action': {'key': 'dependencyAction', 'type': 'DependencyAction'},
}
def __init__(self, **kwargs):
super(ExitOptions,... | true | true |
f7f5e8783a8bebe67eedd23df055226fe25affe2 | 538 | py | Python | src/feeds/migrations/0002_feed_parent.py | lzomedia/socialtwizy.com | c18a76490dc188347917732156fb0f714668d43c | [
"MIT"
] | null | null | null | src/feeds/migrations/0002_feed_parent.py | lzomedia/socialtwizy.com | c18a76490dc188347917732156fb0f714668d43c | [
"MIT"
] | null | null | null | src/feeds/migrations/0002_feed_parent.py | lzomedia/socialtwizy.com | c18a76490dc188347917732156fb0f714668d43c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-27 12:08
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('feeds', '0001_initial'),
]
operations = [
... | 24.454545 | 121 | 0.639405 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('feeds', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='feed',
name='p... | true | true |
f7f5e94fb41767cf28d8ba37d547158674de13ab | 20,761 | py | Python | warehouse/packaging/models.py | pradyunsg/warehouse | 82815b06d9f98deed5f205c66e054de59d22a10d | [
"Apache-2.0"
] | 1 | 2022-03-29T11:56:45.000Z | 2022-03-29T11:56:45.000Z | warehouse/packaging/models.py | pradyunsg/warehouse | 82815b06d9f98deed5f205c66e054de59d22a10d | [
"Apache-2.0"
] | 49 | 2022-03-14T14:43:26.000Z | 2022-03-31T14:45:07.000Z | warehouse/packaging/models.py | pradyunsg/warehouse | 82815b06d9f98deed5f205c66e054de59d22a10d | [
"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 the Li... | 31.219549 | 103 | 0.635952 |
import enum
from collections import OrderedDict
from urllib.parse import urlparse
import packaging.utils
from citext import CIText
from pyramid.authorization import Allow
from pyramid.threadlocal import get_current_request
from sqlalchemy import (
BigInteger,
Boolean,
CheckConstraint,
Col... | true | true |
f7f5ea1fc216eaad5d077a381072d29a4185a1b4 | 9,461 | py | Python | tests/platform_tests/daemon/test_thermalctld.py | amulyan7/sonic-mgmt | b673fe4d830f064ae6f937c514215a7a7d0c7f33 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/daemon/test_thermalctld.py | amulyan7/sonic-mgmt | b673fe4d830f064ae6f937c514215a7a7d0c7f33 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/daemon/test_thermalctld.py | amulyan7/sonic-mgmt | b673fe4d830f064ae6f937c514215a7a7d0c7f33 | [
"Apache-2.0"
] | null | null | null | """
Check daemon status inside PMON container. Each daemon status is checked under the conditions below in this script:
* Daemon Running Status
* Daemon Stop status
* Daemon Restart status
This script is to cover the test case in the SONiC platform daemon and service test plan:
https://github.com/Azure/sonic-mgmt/blo... | 45.267943 | 138 | 0.739668 | import logging
import re
import time
from datetime import datetime
import pytest
from tests.common.helpers.assertions import pytest_assert
from tests.common.platform.daemon_utils import check_pmon_daemon_enable_status
from tests.common.platform.processes_utils import wait_critical_processes, check_critical_processes... | true | true |
f7f5eabe413f7e08e0c022e2ba87bc6892feabd3 | 4,130 | py | Python | AlphaGoZero/code/Framework/Mcts.py | OoSnowfxm/AlphaZero_Othello | 3e94ac29dbac413502eb85628a0f8eb6d402d5e9 | [
"MIT"
] | null | null | null | AlphaGoZero/code/Framework/Mcts.py | OoSnowfxm/AlphaZero_Othello | 3e94ac29dbac413502eb85628a0f8eb6d402d5e9 | [
"MIT"
] | null | null | null | AlphaGoZero/code/Framework/Mcts.py | OoSnowfxm/AlphaZero_Othello | 3e94ac29dbac413502eb85628a0f8eb6d402d5e9 | [
"MIT"
] | null | null | null | '''
@Author: fxm
@Date: Dec 27, 2020.
@Title: Mcts class.
'''
import logging
import math
import numpy as np
Eps = 1e-8
log = logging.getLogger(__name__)
# 蒙特卡洛树搜索对象
class MCTS():
'''
初始化过程
参数设置:
game:游戏对象
net:网络对象
args:参数
N(s,a):记录边的访问次数
S(s): 记录该... | 29.29078 | 93 | 0.489104 |
import logging
import math
import numpy as np
Eps = 1e-8
log = logging.getLogger(__name__)
class MCTS():
def __init__(self, game, net, args):
self.game = game
self.net = net
self.args = args
self.Q = {}
self.N = {}
self.S = {}
self.... | true | true |
f7f5eae37407bb2661cb2eeff7ef4ae4939be1fd | 410 | py | Python | autogluon/task/__init__.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | 2 | 2021-09-14T21:28:54.000Z | 2021-11-17T09:52:41.000Z | autogluon/task/__init__.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | null | null | null | autogluon/task/__init__.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | 1 | 2021-03-11T10:45:00.000Z | 2021-03-11T10:45:00.000Z | import logging
logging.basicConfig(format='%(message)s') # just print message in logs
from .base import BaseTask
from .image_classification import ImageClassification
from .object_detection import ObjectDetection
from .text_classification import TextClassification
from .tabular_prediction import TabularPrediction
from... | 41 | 93 | 0.863415 | import logging
logging.basicConfig(format='%(message)s')
from .base import BaseTask
from .image_classification import ImageClassification
from .object_detection import ObjectDetection
from .text_classification import TextClassification
from .tabular_prediction import TabularPrediction
from . import image_classificati... | true | true |
f7f5ec6cd6dd1793f3914cca57ef47e8cf737618 | 48 | py | Python | maintenance_mode/version.py | synapticarbors/django-maintenance-mode | bc7739457d6394bcf6664d2f03d36015601572d2 | [
"MIT"
] | null | null | null | maintenance_mode/version.py | synapticarbors/django-maintenance-mode | bc7739457d6394bcf6664d2f03d36015601572d2 | [
"MIT"
] | null | null | null | maintenance_mode/version.py | synapticarbors/django-maintenance-mode | bc7739457d6394bcf6664d2f03d36015601572d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = '0.15.0'
| 12 | 23 | 0.520833 |
__version__ = '0.15.0'
| true | true |
f7f5ed1e8b4f1158aaff891dafd048a8c9c718d7 | 5,877 | py | Python | ekorpkit/io/fetch/fomc/meeting.py | entelecheia/ekorpkit | 400cb15005fdbcaa2ab0c311e338799283f28fe0 | [
"CC-BY-4.0"
] | 4 | 2022-02-26T10:54:16.000Z | 2022-02-26T11:01:56.000Z | ekorpkit/io/fetch/fomc/meeting.py | entelecheia/ekorpkit | 400cb15005fdbcaa2ab0c311e338799283f28fe0 | [
"CC-BY-4.0"
] | 1 | 2022-03-25T06:37:12.000Z | 2022-03-25T06:45:53.000Z | ekorpkit/io/fetch/fomc/meeting.py | entelecheia/ekorpkit | 400cb15005fdbcaa2ab0c311e338799283f28fe0 | [
"CC-BY-4.0"
] | null | null | null | import os
import sys
import re
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import pdfplumber
# Import parent class
from .base import FomcBase
class MeetingScript(FomcBase):
"""
A convenient class for extracting meeting scripts from the FOMC website.
FOMC publishes the meet... | 41.097902 | 160 | 0.540412 | import os
import sys
import re
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import pdfplumber
from .base import FomcBase
class MeetingScript(FomcBase):
def __init__(self, content_type, **args):
super().__init__(content_type, **args)
left_pct = 0.05
top_p... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.