hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c40ff512eea886e54065c41272ed6fd79c68e2b | 734 | py | Python | setup.py | Abdur-rahmaanJ/POSMS-PythonOpenSubscriberMailSystem | dbd1038e7e8fb99d3e1cd60633c3969c47d007ad | [
"MIT"
] | 1 | 2018-02-16T13:06:10.000Z | 2018-02-16T13:06:10.000Z | setup.py | Abdur-rahmaanJ/POSMS-PythonOpenSubscriberMailSystem | dbd1038e7e8fb99d3e1cd60633c3969c47d007ad | [
"MIT"
] | 6 | 2018-02-16T11:46:28.000Z | 2018-02-27T10:43:08.000Z | setup.py | Abdur-rahmaanJ/POSMS-PythonOpenSubscriberMailSystem | dbd1038e7e8fb99d3e1cd60633c3969c47d007ad | [
"MIT"
] | 1 | 2018-02-21T22:15:31.000Z | 2018-02-21T22:15:31.000Z | # -*- coding: utf-8 -*-
"""
POSMS is a software relieving you from
subscriber system mailing costs
"""
from setuptools import setup, find_packages
NAME = 'posms'
AUTHOR = 'Abdur-Rahmaan Janhangeer'
VERSION = '1.0'
CONTACT = 'arj.python@gmail.com'
URL = 'https://github.com/Abdur-rahmaanJ/pyOSMS-PythonOpenSubscriberMa... | 26.214286 | 79 | 0.673025 | from setuptools import setup, find_packages
NAME = 'posms'
AUTHOR = 'Abdur-Rahmaan Janhangeer'
VERSION = '1.0'
CONTACT = 'arj.python@gmail.com'
URL = 'https://github.com/Abdur-rahmaanJ/pyOSMS-PythonOpenSubscriberMailSystem'
LICENSE = 'MIT'
setup(
name=NAME,
version=VERSION,
long_description=__doc__,
a... | true | true |
1c41037033048f5070fd5e5798ab4220545688a9 | 8,324 | py | Python | report_compliance.py | agroome/report_compliance | 9fc0050f6ebc3498528d46b9e0973855d1b8072f | [
"MIT"
] | null | null | null | report_compliance.py | agroome/report_compliance | 9fc0050f6ebc3498528d46b9e0973855d1b8072f | [
"MIT"
] | null | null | null | report_compliance.py | agroome/report_compliance | 9fc0050f6ebc3498528d46b9e0973855d1b8072f | [
"MIT"
] | null | null | null | import csv
from dotenv import load_dotenv
import logging
import os
import datetime
import pandas as pd
import argparse
import time
from collections import defaultdict, Counter
from functools import partial
from pathlib import Path
from typing import List, Iterable
from tenable.io import TenableIO
def... | 39.450237 | 181 | 0.641038 | import csv
from dotenv import load_dotenv
import logging
import os
import datetime
import pandas as pd
import argparse
import time
from collections import defaultdict, Counter
from functools import partial
from pathlib import Path
from typing import List, Iterable
from tenable.io import TenableIO
def... | true | true |
1c41042eeb566322046a54926e78715bc4aad0ba | 2,999 | py | Python | tests/unit/drivers/test_load_groundtruth_driver.py | yk/jina | ab66e233e74b956390f266881ff5dc4e0110d3ff | [
"Apache-2.0"
] | 1 | 2020-12-23T08:58:49.000Z | 2020-12-23T08:58:49.000Z | tests/unit/drivers/test_load_groundtruth_driver.py | yk/jina | ab66e233e74b956390f266881ff5dc4e0110d3ff | [
"Apache-2.0"
] | null | null | null | tests/unit/drivers/test_load_groundtruth_driver.py | yk/jina | ab66e233e74b956390f266881ff5dc4e0110d3ff | [
"Apache-2.0"
] | null | null | null | from typing import Optional
import numpy as np
import pytest
from jina import Request
from jina.drivers.evaluate import LoadGroundTruthDriver
from jina.executors.indexers import BaseKVIndexer
from jina.proto import jina_pb2
from jina.types.document import Document
class MockGroundTruthIndexer(BaseKVIndexer):
d... | 27.018018 | 105 | 0.652551 | from typing import Optional
import numpy as np
import pytest
from jina import Request
from jina.drivers.evaluate import LoadGroundTruthDriver
from jina.executors.indexers import BaseKVIndexer
from jina.proto import jina_pb2
from jina.types.document import Document
class MockGroundTruthIndexer(BaseKVIndexer):
d... | true | true |
1c41047d22bafc1f54d978be33949e6b0f7664c0 | 30,866 | py | Python | sdk/python/pulumi_azure_native/security/v20190101preview/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/security/v20190101preview/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/security/v20190101preview/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 37.595615 | 523 | 0.644398 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
__all__ = [
'AssessmentLinksResponse',
'AssessmentStatusResponse',
'AutomationActionEventHubResponse',
'Automa... | true | true |
1c4104b0907e043f5b8e0a19a12d85e1623a408c | 167 | py | Python | project_name/urls.py | dashgin/DjangoTemplate | 40d7f7789d378ee632e096a82a1ac96ebeb1a331 | [
"MIT"
] | null | null | null | project_name/urls.py | dashgin/DjangoTemplate | 40d7f7789d378ee632e096a82a1ac96ebeb1a331 | [
"MIT"
] | null | null | null | project_name/urls.py | dashgin/DjangoTemplate | 40d7f7789d378ee632e096a82a1ac96ebeb1a331 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib import admin
from django.urls import path
urlpatterns = [
path(f'{settings.ADMIN_URL}/', admin.site.urls),
]
| 20.875 | 52 | 0.754491 | from django.conf import settings
from django.contrib import admin
from django.urls import path
urlpatterns = [
path(f'{settings.ADMIN_URL}/', admin.site.urls),
]
| true | true |
1c4105fcafcd6b93844f8cc95b8ee788e5001a2f | 974 | py | Python | prickly-pufferfish/arena/arena/urls.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 40 | 2020-08-02T07:38:22.000Z | 2021-07-26T01:46:50.000Z | prickly-pufferfish/arena/arena/urls.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 134 | 2020-07-31T12:15:45.000Z | 2020-12-13T04:42:19.000Z | prickly-pufferfish/arena/arena/urls.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 101 | 2020-07-31T12:00:47.000Z | 2021-11-01T09:06:58.000Z | """arena URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | 36.074074 | 77 | 0.695072 | from django.conf.urls import include
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('accounts.urls')),
path('accounts/', include('django.contrib.auth.urls')),
path('battle/', include('battle.urls')),
path('', ... | true | true |
1c4106918d68cf17ddcefb063a056798360de561 | 3,407 | py | Python | src/icemac/addressbook/browser/search/result/handler/test_delete.py | icemac/icemac.addressbook | 6197e6e01da922feb100dd0943576523050cd703 | [
"BSD-2-Clause"
] | 1 | 2020-03-26T20:16:44.000Z | 2020-03-26T20:16:44.000Z | src/icemac/addressbook/browser/search/result/handler/test_delete.py | icemac/icemac.addressbook | 6197e6e01da922feb100dd0943576523050cd703 | [
"BSD-2-Clause"
] | 2 | 2020-02-21T13:04:23.000Z | 2020-02-21T13:06:10.000Z | src/icemac/addressbook/browser/search/result/handler/test_delete.py | icemac/icemac.addressbook | 6197e6e01da922feb100dd0943576523050cd703 | [
"BSD-2-Clause"
] | null | null | null | import pytest
def test_delete__DeleteForm__1(search_data, UserFactory, browser):
"""`DeleteForm` allows an administrator to delete found persons."""
address_book = search_data
# Create a user -- the person of a user cannot be deleted using this search
# result handler.
UserFactory(address_book, u'... | 44.246753 | 79 | 0.694453 | import pytest
def test_delete__DeleteForm__1(search_data, UserFactory, browser):
address_book = search_data
UserFactory(address_book, u'Ben', u'Utzer', u'ben@example.com',
u'12345678', [], keywords=[u'church'])
browser.login('mgr')
browser.keyword_search('church')
brows... | true | true |
1c41071be3bfc9f00212c0cf8b634c2280b7da2d | 12,056 | py | Python | build-tools/apb_packaging/sb_cfn_package/sb_cfn_package.py | knqyf263/aws-servicebroker | b9b6a3ec4738596d07d6d8e6c79548f16acc25c8 | [
"Apache-2.0"
] | null | null | null | build-tools/apb_packaging/sb_cfn_package/sb_cfn_package.py | knqyf263/aws-servicebroker | b9b6a3ec4738596d07d6d8e6c79548f16acc25c8 | [
"Apache-2.0"
] | null | null | null | build-tools/apb_packaging/sb_cfn_package/sb_cfn_package.py | knqyf263/aws-servicebroker | b9b6a3ec4738596d07d6d8e6c79548f16acc25c8 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import yaml
from taskcat.utils import CFNYAMLHandler
import os
from random import random
from base64 import b64encode
import shutil
import subprocess
import re
import jinja2
try:
from aws_servicebroker_spec import AwsServiceBrokerSpec
except:
from sb_cfn_package.aws_servicebroker_... | 50.869198 | 268 | 0.618779 | import argparse
import logging
import yaml
from taskcat.utils import CFNYAMLHandler
import os
from random import random
from base64 import b64encode
import shutil
import subprocess
import re
import jinja2
try:
from aws_servicebroker_spec import AwsServiceBrokerSpec
except:
from sb_cfn_package.aws_servicebroker_... | true | true |
1c4107b8fb38d070468fe983b3c3690558f12e55 | 188 | py | Python | chap09/list0914.py | ytianjin/GitTest | a657f46098728ad90f7140fadad356e8561c9a7a | [
"MIT"
] | null | null | null | chap09/list0914.py | ytianjin/GitTest | a657f46098728ad90f7140fadad356e8561c9a7a | [
"MIT"
] | null | null | null | chap09/list0914.py | ytianjin/GitTest | a657f46098728ad90f7140fadad356e8561c9a7a | [
"MIT"
] | null | null | null | # 使用敬称打招呼的函数(带默认值的形参)
def hello(name, honorific = '老师'):
"""使用敬称打招呼"""
print('你好,{}{}。'.format(name, honorific))
hello('田中')
hello('关根', '先生')
hello('西田', '女士') | 20.888889 | 47 | 0.521277 |
def hello(name, honorific = '老师'):
print('你好,{}{}。'.format(name, honorific))
hello('田中')
hello('关根', '先生')
hello('西田', '女士') | true | true |
1c4107e872f9b36434a6a6860ea3fbdbb1fe48d1 | 904 | py | Python | example-tests/example_BorisPusher.py | AleksandrPanov/pyHiChi | f9b0c4ec17ad1c9b5897770b86be9152b0ab29ca | [
"MIT"
] | null | null | null | example-tests/example_BorisPusher.py | AleksandrPanov/pyHiChi | f9b0c4ec17ad1c9b5897770b86be9152b0ab29ca | [
"MIT"
] | null | null | null | example-tests/example_BorisPusher.py | AleksandrPanov/pyHiChi | f9b0c4ec17ad1c9b5897770b86be9152b0ab29ca | [
"MIT"
] | null | null | null | import sys
sys.path.append("../bin/")
import pyHiChi as hichi
import numpy as np
def value_E_analytical(pos, t):
E = hichi.Vector3d(1, 0, 0) #sin(pos.x)
return E
def value_B_analytical(pos, t):
B = hichi.Vector3d(0, 0, 0)
return B
t = 0
p_array = hichi.ParticleArray()
fields_array = []
for i ... | 25.828571 | 92 | 0.650442 | import sys
sys.path.append("../bin/")
import pyHiChi as hichi
import numpy as np
def value_E_analytical(pos, t):
E = hichi.Vector3d(1, 0, 0) return E
def value_B_analytical(pos, t):
B = hichi.Vector3d(0, 0, 0)
return B
t = 0
p_array = hichi.ParticleArray()
fields_array = []
for i in range(11)... | true | true |
1c41088e2af6caa9541933c82a64667acdb51778 | 1,296 | py | Python | tests/unit_tests/cx_core/integration/z2m_test.py | Crocmagnon/controllerx | d928d5fc8d7ab50a86417227d5b732aea43cb653 | [
"MIT"
] | null | null | null | tests/unit_tests/cx_core/integration/z2m_test.py | Crocmagnon/controllerx | d928d5fc8d7ab50a86417227d5b732aea43cb653 | [
"MIT"
] | null | null | null | tests/unit_tests/cx_core/integration/z2m_test.py | Crocmagnon/controllerx | d928d5fc8d7ab50a86417227d5b732aea43cb653 | [
"MIT"
] | null | null | null | from typing import Any, Dict
import pytest
from cx_core.controller import Controller
from cx_core.integration.z2m import Z2MIntegration
from pytest_mock import MockerFixture
@pytest.mark.parametrize(
"data, action_key, handle_action_called, expected_called_with",
[
({"payload": '{"event_1": "action_1... | 33.230769 | 79 | 0.682099 | from typing import Any, Dict
import pytest
from cx_core.controller import Controller
from cx_core.integration.z2m import Z2MIntegration
from pytest_mock import MockerFixture
@pytest.mark.parametrize(
"data, action_key, handle_action_called, expected_called_with",
[
({"payload": '{"event_1": "action_1... | true | true |
1c4108c472a7ea0e153ff1950c5c6e5ccb5da43a | 15,206 | py | Python | lambda.py | amnona/boxbox | 3641351e34776d504cc660e740df8528120b004e | [
"MIT"
] | null | null | null | lambda.py | amnona/boxbox | 3641351e34776d504cc660e740df8528120b004e | [
"MIT"
] | null | null | null | lambda.py | amnona/boxbox | 3641351e34776d504cc660e740df8528120b004e | [
"MIT"
] | null | null | null | """
BOX BOX aws skill for alexa
written by amnonim@gmail.com
Requires the following triggers:
Alexa skill kit trigger
Requires the following triggers:
AWS Systerms manager
Amazon cloudwatch logs
uses the boxit role
For additional samples, visit the Alexa Skills Kit Getting Started guide at
http://amzn.to/1LGWsLG
"""... | 38.890026 | 154 | 0.650007 |
from __future__ import print_function
import boto3
def build_speechlet_response(title, output, reprompt_text, should_end_session):
return {
'outputSpeech': {
'type': 'PlainText',
'text': output
},
'card': {
'type': 'Simple',
'title': "Sessi... | true | true |
1c410901806e8c5014b3fbe2f6ab0bd1239a957a | 1,631 | py | Python | ImprovementFactor.py | varlamnet/group_testing | a119c4967af22ceeffb89dcf6267fd262d327552 | [
"MIT"
] | null | null | null | ImprovementFactor.py | varlamnet/group_testing | a119c4967af22ceeffb89dcf6267fd262d327552 | [
"MIT"
] | null | null | null | ImprovementFactor.py | varlamnet/group_testing | a119c4967af22ceeffb89dcf6267fd262d327552 | [
"MIT"
] | 1 | 2021-03-28T09:44:32.000Z | 2021-03-28T09:44:32.000Z | # This script generates improvement factors for each algorithm. E.g. an
# improvement factor of 5 indicates that 1 test is on average sufficient to
# test 5 people.
import os
os.chdir(os.path.dirname(__file__))
import numpy as np
from warnings import filterwarnings
filterwarnings('ignore')
n=100 # Number of individ... | 37.068182 | 76 | 0.688535 |
import os
os.chdir(os.path.dirname(__file__))
import numpy as np
from warnings import filterwarnings
filterwarnings('ignore')
n=100 k=2
sensdic = {}
specdic = {}
spec95 = {}
sens95 = {}
for name in ['COMP','DD','SCOMP','CBP', 'SR']:
sensdic[name] = np.genfromtxt(f'data_output/sensitivity_{name}.csv',
delimi... | true | true |
1c4109c3b29ae9649491bede2ffe53f7710b824e | 4,931 | py | Python | tests/test_mpi.py | jayvdb/python-mbedtls | cd042e8b9d6869e39c11e3117199f1ce8ed782d4 | [
"MIT"
] | null | null | null | tests/test_mpi.py | jayvdb/python-mbedtls | cd042e8b9d6869e39c11e3117199f1ce8ed782d4 | [
"MIT"
] | null | null | null | tests/test_mpi.py | jayvdb/python-mbedtls | cd042e8b9d6869e39c11e3117199f1ce8ed782d4 | [
"MIT"
] | null | null | null | import numbers
from binascii import hexlify, unhexlify
import pytest
from mbedtls.mpi import MPI
@pytest.mark.parametrize("value", (12, 2 ** 32 - 1, 10 ** 100))
def test_from_int(value):
mpi = MPI.from_int(value)
assert mpi == value
assert value == mpi
assert mpi == mpi
def test_is_integral():
... | 23.369668 | 72 | 0.600892 | import numbers
from binascii import hexlify, unhexlify
import pytest
from mbedtls.mpi import MPI
@pytest.mark.parametrize("value", (12, 2 ** 32 - 1, 10 ** 100))
def test_from_int(value):
mpi = MPI.from_int(value)
assert mpi == value
assert value == mpi
assert mpi == mpi
def test_is_integral():
... | true | true |
1c410a83e1a2b1847a2778180688b5c83598bbe2 | 837 | py | Python | services/nris-api/backend/app/nris/models/inspection_reason.py | bcgov/mds | 6c427a66a5edb4196222607291adef8fd6677038 | [
"Apache-2.0"
] | 25 | 2018-07-09T19:04:37.000Z | 2022-03-15T17:27:10.000Z | services/nris-api/backend/app/nris/models/inspection_reason.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 983 | 2018-04-25T20:08:07.000Z | 2022-03-31T21:45:20.000Z | services/nris-api/backend/app/nris/models/inspection_reason.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 58 | 2018-05-15T22:35:50.000Z | 2021-11-29T19:40:52.000Z | from app.extensions import db
from sqlalchemy.orm import validates
from app.nris.utils.base_model import Base
class InspectionReason(Base):
__tablename__ = "inspection_reason"
__table_args__ = {
'comment':
'Lookup table that contains a list of inspection reasons. E.g. Planned, Unplanned, Compl... | 38.045455 | 156 | 0.757467 | from app.extensions import db
from sqlalchemy.orm import validates
from app.nris.utils.base_model import Base
class InspectionReason(Base):
__tablename__ = "inspection_reason"
__table_args__ = {
'comment':
'Lookup table that contains a list of inspection reasons. E.g. Planned, Unplanned, Compl... | true | true |
1c410aa85f8e9da26dca518cc43803e0a9d37290 | 6,653 | py | Python | detectron2/export/caffe2_inference.py | MIXIAOXIN/detectron2-0.3-mxx | 3b4eb6da27b6360139228052690bce7a74b1268e | [
"Apache-2.0"
] | 1,158 | 2020-11-24T04:44:06.000Z | 2022-03-31T07:24:11.000Z | detectron2/export/caffe2_inference.py | MIXIAOXIN/detectron2-0.3-mxx | 3b4eb6da27b6360139228052690bce7a74b1268e | [
"Apache-2.0"
] | 94 | 2020-11-25T08:29:07.000Z | 2022-03-30T09:18:09.000Z | detectron2/export/caffe2_inference.py | MIXIAOXIN/detectron2-0.3-mxx | 3b4eb6da27b6360139228052690bce7a74b1268e | [
"Apache-2.0"
] | 189 | 2020-11-24T07:32:03.000Z | 2022-03-28T06:16:30.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
import logging
import numpy as np
from itertools import count
import torch
from caffe2.proto import caffe2_pb2
from caffe2.python import core
from .caffe2_modeling import META_ARCH_CAFFE2_EXPORT_TYPE_MAP, convert_batched_inputs_to_c2_format
from .shared import Scoped... | 41.067901 | 98 | 0.638208 |
import logging
import numpy as np
from itertools import count
import torch
from caffe2.proto import caffe2_pb2
from caffe2.python import core
from .caffe2_modeling import META_ARCH_CAFFE2_EXPORT_TYPE_MAP, convert_batched_inputs_to_c2_format
from .shared import ScopedWS, get_pb_arg_vali, get_pb_arg_vals, infer_device_... | true | true |
1c410ab33284aa4eeceacdbce6394607fcb2d075 | 9,354 | py | Python | brozzler/__init__.py | vbanos/brozzler | 261e7977ad198cfed160b89498d289267af8dd97 | [
"Apache-2.0"
] | 1 | 2017-07-04T20:50:26.000Z | 2017-07-04T20:50:26.000Z | brozzler/__init__.py | vbanos/brozzler | 261e7977ad198cfed160b89498d289267af8dd97 | [
"Apache-2.0"
] | null | null | null | brozzler/__init__.py | vbanos/brozzler | 261e7977ad198cfed160b89498d289267af8dd97 | [
"Apache-2.0"
] | null | null | null | """
brozzler/__init__.py - __init__.py for brozzler package, contains some common
code
Copyright (C) 2014-2017 Internet Archive
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... | 35.165414 | 81 | 0.665063 |
from pkg_resources import get_distribution as _get_distribution
__version__ = _get_distribution('brozzler').version
class ShutdownRequested(Exception):
pass
class NothingToClaim(Exception):
pass
class CrawlStopped(Exception):
pass
class ProxyError(Exception):
pass
class ReachedLimit(Exception):
... | true | true |
1c410abd240935e34593300877903802761cbc3e | 2,902 | py | Python | examples/views/persistent.py | Ryomen-Sukuna/discord.py | 0bcb0d0e3ce395d42a5b1dae61b0090791ee018d | [
"MIT"
] | 1 | 2021-09-11T09:24:38.000Z | 2021-09-11T09:24:38.000Z | examples/views/persistent.py | Ryomen-Sukuna/discord.py | 0bcb0d0e3ce395d42a5b1dae61b0090791ee018d | [
"MIT"
] | 1 | 2022-02-19T18:25:19.000Z | 2022-02-19T18:25:19.000Z | examples/views/persistent.py | Ryomen-Sukuna/discord.py | 0bcb0d0e3ce395d42a5b1dae61b0090791ee018d | [
"MIT"
] | null | null | null | # This example requires the 'message_content' privileged intent to function.
from discord.ext import commands
import discord
# Define a simple View that persists between bot restarts
# In order a view to persist between restarts it needs to meet the following conditions:
# 1) The timeout of the View has to be set to... | 43.313433 | 105 | 0.723639 |
from discord.ext import commands
import discord
class PersistentView(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
@discord.ui.button(label='Green', style=discord.ButtonStyle.green, custom_id='persistent_view:green')
async def green(self, interaction: discord.Interaction, ... | true | true |
1c410b65d56b03b162f07a7975e0be44700aa9d5 | 2,131 | py | Python | blue/tests/test_daedalus.py | cglewis/Daedalus | 1ccd1a35ea4f343cf45ff629785ced284ec98b81 | [
"Apache-2.0"
] | 8 | 2021-07-15T23:26:57.000Z | 2022-02-28T22:26:19.000Z | blue/tests/test_daedalus.py | cglewis/Daedalus | 1ccd1a35ea4f343cf45ff629785ced284ec98b81 | [
"Apache-2.0"
] | 102 | 2021-05-07T15:06:52.000Z | 2022-03-31T10:49:08.000Z | blue/tests/test_daedalus.py | cglewis/Daedalus | 1ccd1a35ea4f343cf45ff629785ced284ec98b81 | [
"Apache-2.0"
] | 7 | 2021-03-09T19:17:59.000Z | 2022-01-27T17:37:47.000Z | # -*- coding: utf-8 -*-
"""
Test module for daedalus.
@author: Charlie Lewis
"""
from daedalus.daedalus import Daedalus
def test_start_remove_dovesnap():
instance = Daedalus()
# hack conf_dir since it's not installed as a library
instance.set_config_dir(conf_dir='/..')
instance.start_dovesnap()
in... | 23.94382 | 72 | 0.691225 | from daedalus.daedalus import Daedalus
def test_start_remove_dovesnap():
instance = Daedalus()
instance.set_config_dir(conf_dir='/..')
instance.start_dovesnap()
instance.remove_dovesnap()
instance.reset_cwd()
def test_build_images():
instance = Daedalus()
# hack conf_dir since it's n... | true | true |
1c410cf9fec954b97729a2db7677deaef04366e0 | 746 | py | Python | blender/arm/logicnode/postprocess_colorgrading_get_shadow_node.py | ValtoGameEngines/Armory | ad3d3c63e64e9225e62b414b7ec4dd9fb93fab32 | [
"Zlib"
] | 1 | 2021-03-17T05:51:45.000Z | 2021-03-17T05:51:45.000Z | blender/arm/logicnode/postprocess_colorgrading_get_shadow_node.py | ValtoGameEngines/Armory | ad3d3c63e64e9225e62b414b7ec4dd9fb93fab32 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/postprocess_colorgrading_get_shadow_node.py | ValtoGameEngines/Armory | ad3d3c63e64e9225e62b414b7ec4dd9fb93fab32 | [
"Zlib"
] | 1 | 2020-06-29T07:54:21.000Z | 2020-06-29T07:54:21.000Z | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class ColorgradingGetShadowNode(Node, ArmLogicTreeNode):
'''Colorgrading Get Shadow node'''
bl_idname = 'LNColorgradingGetShadowNode'
bl_label = 'Colorgrading Get Shadow'
bl_icon = 'QUESTION'... | 37.3 | 59 | 0.718499 | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class ColorgradingGetShadowNode(Node, ArmLogicTreeNode):
bl_idname = 'LNColorgradingGetShadowNode'
bl_label = 'Colorgrading Get Shadow'
bl_icon = 'QUESTION'
def init(self, context):
... | true | true |
1c410e2cc351e81603190ff16d74ece20704ff16 | 256 | py | Python | Problem1/Collections/Collections.deque().py | Joanna-O-Ben/ADM-HW1 | 0a914d4ab5462fa563980644d3f5d777af61aef9 | [
"MIT"
] | null | null | null | Problem1/Collections/Collections.deque().py | Joanna-O-Ben/ADM-HW1 | 0a914d4ab5462fa563980644d3f5d777af61aef9 | [
"MIT"
] | null | null | null | Problem1/Collections/Collections.deque().py | Joanna-O-Ben/ADM-HW1 | 0a914d4ab5462fa563980644d3f5d777af61aef9 | [
"MIT"
] | null | null | null | # Enter your code here. Read input from STDIN. Print output to STDOUT
from collections import deque
d = deque()
for _ in range(int(input())):
inp = input().split()
getattr(d, inp[0])(*[inp[1]] if len(inp) > 1 else [])
print(*[item for item in d])
| 28.444444 | 69 | 0.648438 |
from collections import deque
d = deque()
for _ in range(int(input())):
inp = input().split()
getattr(d, inp[0])(*[inp[1]] if len(inp) > 1 else [])
print(*[item for item in d])
| true | true |
1c410e5c21526e59865d845fbef59dfe155a5f3e | 1,612 | py | Python | MNIST/src/utils.py | AnesBenmerzoug/Machine-Learning-Projects | c52b3f55968c042a20299473fb124b75cc410ce0 | [
"MIT"
] | 1 | 2020-05-02T18:50:11.000Z | 2020-05-02T18:50:11.000Z | MNIST/src/utils.py | AnesBenmerzoug/Machine-Learning-Projects | c52b3f55968c042a20299473fb124b75cc410ce0 | [
"MIT"
] | null | null | null | MNIST/src/utils.py | AnesBenmerzoug/Machine-Learning-Projects | c52b3f55968c042a20299473fb124b75cc410ce0 | [
"MIT"
] | null | null | null | from torchvision.utils import make_grid
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
def imgshow(img):
plt.imshow(np.transpose(make_grid(img).numpy(), (1, 2, 0)))
plt.show()
def plotlosses(losses, title="", xlabel="", ylabel=""):
epochs = np.arange(losses.size) +... | 27.793103 | 77 | 0.635856 | from torchvision.utils import make_grid
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
def imgshow(img):
plt.imshow(np.transpose(make_grid(img).numpy(), (1, 2, 0)))
plt.show()
def plotlosses(losses, title="", xlabel="", ylabel=""):
epochs = np.arange(losses.size) +... | true | true |
1c410eea0f136cd9dccd0299a60356e341fd9e0b | 912 | py | Python | indico/modules/categories/legacy.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | 1 | 2021-02-24T10:20:14.000Z | 2021-02-24T10:20:14.000Z | indico/modules/categories/legacy.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | 2 | 2015-01-20T22:25:18.000Z | 2020-07-20T15:27:20.000Z | indico/modules/categories/legacy.py | CrownedSilverFox/conference-platform | 1858a2908763dc7e4c29d3157369e9aab6064933 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from lxml import etree
class XMLCategorySerializer:
def __init__(self, category):
self.categ... | 31.448276 | 70 | 0.70614 |
from lxml import etree
class XMLCategorySerializer:
def __init__(self, category):
self.category = category
def serialize_category(self):
xml = self._serialize_category()
return etree.tostring(xml, pretty_print=True)
def _serialize_category(self):
response = etree.Element... | true | true |
1c410f0ad645bdcc2c4e1a3e1cfaf1433fdbc3b6 | 5,624 | py | Python | tests/repository/test_convert.py | giganticode/langmodels | 53462a755eb07cbbccdd179605185059634d6ac4 | [
"MIT"
] | 9 | 2020-01-21T13:34:49.000Z | 2022-03-18T02:34:30.000Z | tests/repository/test_convert.py | giganticode/langmodels | 53462a755eb07cbbccdd179605185059634d6ac4 | [
"MIT"
] | 6 | 2020-05-02T07:03:26.000Z | 2022-03-11T23:48:38.000Z | tests/repository/test_convert.py | giganticode/langmodels | 53462a755eb07cbbccdd179605185059634d6ac4 | [
"MIT"
] | 3 | 2019-08-03T00:06:19.000Z | 2020-05-07T00:37:19.000Z | import os
from sys import platform
from typing import Dict
import jsons
import pytest
from langmodels import project_dir
from langmodels.repository.convert import convert_dict
config_v002_gru_cosine = {"arch": {
"bidir": False, "clip": 0.3,
"adam_betas": [0.7, 0.99],
"reg_fn": {"alpha": 2.1, "beta": 1.1}... | 52.560748 | 206 | 0.635846 | import os
from sys import platform
from typing import Dict
import jsons
import pytest
from langmodels import project_dir
from langmodels.repository.convert import convert_dict
config_v002_gru_cosine = {"arch": {
"bidir": False, "clip": 0.3,
"adam_betas": [0.7, 0.99],
"reg_fn": {"alpha": 2.1, "beta": 1.1}... | true | true |
1c4110621ec10a0735d880f891bbb673f8ab720e | 2,438 | py | Python | pandapipes/test/run_tests.py | SteffenMeinecke/pandapipes | 2d0631c053735e4116a145bae9975379135b9c36 | [
"BSD-3-Clause"
] | null | null | null | pandapipes/test/run_tests.py | SteffenMeinecke/pandapipes | 2d0631c053735e4116a145bae9975379135b9c36 | [
"BSD-3-Clause"
] | null | null | null | pandapipes/test/run_tests.py | SteffenMeinecke/pandapipes | 2d0631c053735e4116a145bae9975379135b9c36 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020-2022 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
import os
import pytest
from pandapipes.test import t... | 30.098765 | 99 | 0.671452 |
import os
import pytest
from pandapipes.test import test_path
try:
import coverage as cov
except ImportError:
pass
from pandapower.test.run_tests import _get_cpus
try:
import pplog as logging
except ImportError:
import logging
logger = logging.getLogger()
for handler in logger.handlers... | true | true |
1c4111b17f5ddd93684d22bf76d2ddbef349695f | 19,278 | py | Python | melange/openstack/common/extensions.py | CiscoSystems/melange | d8ff17ecb9466b64dbd064710489ea62843e6636 | [
"Apache-2.0"
] | 1 | 2016-05-25T13:48:06.000Z | 2016-05-25T13:48:06.000Z | melange/openstack/common/extensions.py | openstack-attic/melange | 6ec8d7068e09505614dfc5f3edccfbe26aa50fe4 | [
"Apache-2.0"
] | null | null | null | melange/openstack/common/extensions.py | openstack-attic/melange | 6ec8d7068e09505614dfc5f3edccfbe26aa50fe4 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2011 Justin Santa Barbara
# 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... | 35.766234 | 79 | 0.605042 |
import imp
import os
import routes
import webob.dec
import webob.exc
import logging
from lxml import etree
from melange.openstack.common import exception
from melange.openstack.common import wsgi
LOG = logging.getLogger('extensions')
DEFAULT_XMLNS = "http://docs.openstack.org/"
XMLNS_ATOM = "http://www.w3.org/2005/... | true | true |
1c4112b6bb5005fd8c84c3af4197a60b1f213f99 | 960 | py | Python | setup.py | hey-booster/heybooster-toolkit | e423a7d6e96df8440ea0599ef8dd5a0816ef0fa8 | [
"MIT"
] | 10 | 2021-09-13T17:19:58.000Z | 2021-12-12T21:03:59.000Z | setup.py | hey-booster/heybooster-toolkit | e423a7d6e96df8440ea0599ef8dd5a0816ef0fa8 | [
"MIT"
] | 1 | 2021-09-17T12:38:42.000Z | 2021-09-17T12:38:42.000Z | setup.py | hey-booster/heybooster-toolkit | e423a7d6e96df8440ea0599ef8dd5a0816ef0fa8 | [
"MIT"
] | 2 | 2021-09-14T07:23:06.000Z | 2021-09-15T22:15:06.000Z | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("version.txt", "r") as version_file:
version = version_file.read()
setuptools.setup(
name="heybooster-toolkit",
version=version,
author="Heybooster",
author_email="hey@heybooster.ai",... | 28.235294 | 82 | 0.644792 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("version.txt", "r") as version_file:
version = version_file.read()
setuptools.setup(
name="heybooster-toolkit",
version=version,
author="Heybooster",
author_email="hey@heybooster.ai",... | true | true |
1c4112fc94d01467ba5ebf1d3aeb0556086b69cf | 2,261 | py | Python | fonduer/snorkel/models/meta.py | leewaymay/839_fonduer | 1692f018ef113d88dca4ede69cc2ead55b7b1003 | [
"Apache-2.0"
] | 1 | 2018-05-31T02:44:00.000Z | 2018-05-31T02:44:00.000Z | fonduer/snorkel/models/meta.py | leewaymay/839_fonduer | 1692f018ef113d88dca4ede69cc2ead55b7b1003 | [
"Apache-2.0"
] | null | null | null | fonduer/snorkel/models/meta.py | leewaymay/839_fonduer | 1692f018ef113d88dca4ede69cc2ead55b7b1003 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import *
import getpass
import os
from sqlalchemy import create_engine, event
from sqlalchemy.engine import Engine
from sqlal... | 35.328125 | 110 | 0.773109 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import *
import getpass
import os
from sqlalchemy import create_engine, event
from sqlalchemy.engine import Engine
from sqlal... | true | true |
1c4113e495f403e84f0a5a10135d8ddb907c297a | 2,911 | py | Python | manage.py | zuozh11/epub2cbz | 2b24533d43924fb3503bbbdbf8bdc35c86d5e066 | [
"MIT"
] | null | null | null | manage.py | zuozh11/epub2cbz | 2b24533d43924fb3503bbbdbf8bdc35c86d5e066 | [
"MIT"
] | null | null | null | manage.py | zuozh11/epub2cbz | 2b24533d43924fb3503bbbdbf8bdc35c86d5e066 | [
"MIT"
] | null | null | null | import os
import shutil
import zipfile
from PIL import Image
from parent import console, progress
class FileManager(object):
"""
This class is used for file interactions.
It has the following methods:
set_directory() --- Which set up the working directory
img_handler() --- Wh... | 33.45977 | 118 | 0.59945 | import os
import shutil
import zipfile
from PIL import Image
from parent import console, progress
class FileManager(object):
def __init__(self, epub_file, path):
self.epub_file = epub_file
self.path = path
self.zfile = None
self.title = ''
... | true | true |
1c4114bff0fe7e0c88d7679111a14cc2daab0ad8 | 5,122 | py | Python | adlib/tests/adversaries/k_insertion_test.py | xyvivian/adlib | 79a93baa8aa542080bbf55734168eb89317df83c | [
"MIT"
] | null | null | null | adlib/tests/adversaries/k_insertion_test.py | xyvivian/adlib | 79a93baa8aa542080bbf55734168eb89317df83c | [
"MIT"
] | null | null | null | adlib/tests/adversaries/k_insertion_test.py | xyvivian/adlib | 79a93baa8aa542080bbf55734168eb89317df83c | [
"MIT"
] | null | null | null | # k_insertion_test.py
# Tests the k-insertion implementation
# Matthew Sedam
from adlib.adversaries.k_insertion import KInsertion
from adlib.learners import SimpleLearner
from adlib.utils.common import calculate_correct_percentages
from copy import deepcopy
from data_reader.dataset import EmailDataset
from data_reade... | 37.661765 | 80 | 0.572237 |
from adlib.adversaries.k_insertion import KInsertion
from adlib.learners import SimpleLearner
from adlib.utils.common import calculate_correct_percentages
from copy import deepcopy
from data_reader.dataset import EmailDataset
from data_reader.operations import load_dataset
from sklearn import svm
import sys
import ti... | true | true |
1c411506fb72d22c7e7a358de91454523fcc8674 | 3,271 | py | Python | bot/utils/i18n.py | Clutter-Development/Clutter | 6b725c016a439958caaa7d88bacae8e2b11ca272 | [
"CC0-1.0"
] | 6 | 2022-02-04T17:11:19.000Z | 2022-03-05T09:14:39.000Z | bot/utils/i18n.py | Clutter-Development/Clutter | 6b725c016a439958caaa7d88bacae8e2b11ca272 | [
"CC0-1.0"
] | 2 | 2022-02-08T16:53:42.000Z | 2022-02-19T07:44:19.000Z | bot/utils/i18n.py | Clutter-Development/Clutter | 6b725c016a439958caaa7d88bacae8e2b11ca272 | [
"CC0-1.0"
] | 2 | 2022-02-18T21:28:57.000Z | 2022-02-23T17:08:18.000Z | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import json5
from .database import find_in_dict
from .errors import UnknownTranslationString
if TYPE_CHECKING:
import discord
from core.bot import Clutter
from discord.ext import commands
class I18N:
def __init__(self, b... | 36.344444 | 173 | 0.626414 | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import json5
from .database import find_in_dict
from .errors import UnknownTranslationString
if TYPE_CHECKING:
import discord
from core.bot import Clutter
from discord.ext import commands
class I18N:
def __init__(self, b... | true | true |
1c411535f505744d40d152a4e11b8664eae771a6 | 1,576 | py | Python | src/compas_pgs/ui/Rhino/3GS/dev/PGS__session_save_cmd.py | BlockResearchGroup/compas-3GS | a1f7be3a364f93bb7560688c0e7acee8f86c535f | [
"MIT"
] | 2 | 2021-11-03T23:22:33.000Z | 2021-11-03T23:22:41.000Z | src/compas_pgs/ui/Rhino/3GS/dev/PGS__session_save_cmd.py | BlockResearchGroup/compas-3GS | a1f7be3a364f93bb7560688c0e7acee8f86c535f | [
"MIT"
] | null | null | null | src/compas_pgs/ui/Rhino/3GS/dev/PGS__session_save_cmd.py | BlockResearchGroup/compas-3GS | a1f7be3a364f93bb7560688c0e7acee8f86c535f | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os
import json
import compas_rhino
from compas.utilities import DataEncoder
from compas_pgs.rhino import get_system
from compas_pgs.rhino import get_scene
from compas_pgs.rhino import select_filepath_... | 22.84058 | 80 | 0.610406 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os
import json
import compas_rhino
from compas.utilities import DataEncoder
from compas_pgs.rhino import get_system
from compas_pgs.rhino import get_scene
from compas_pgs.rhino import select_filepath_... | true | true |
1c411633507834ebf441912e41c4aa9c0df844f1 | 311 | py | Python | ocpmodels/datasets/embeddings/__init__.py | Irlirion/ocp | 6fb3e794eef31559db990300198eca20f41d8f37 | [
"MIT",
"BSD-3-Clause"
] | 242 | 2020-10-14T11:10:43.000Z | 2022-03-29T07:50:18.000Z | ocpmodels/datasets/embeddings/__init__.py | Irlirion/ocp | 6fb3e794eef31559db990300198eca20f41d8f37 | [
"MIT",
"BSD-3-Clause"
] | 100 | 2020-10-13T23:27:04.000Z | 2022-03-23T16:50:26.000Z | ocpmodels/datasets/embeddings/__init__.py | Irlirion/ocp | 6fb3e794eef31559db990300198eca20f41d8f37 | [
"MIT",
"BSD-3-Clause"
] | 86 | 2020-10-15T05:56:28.000Z | 2022-03-16T16:11:45.000Z | __all__ = [
"ATOMIC_RADII",
"KHOT_EMBEDDINGS",
"CONTINUOUS_EMBEDDINGS",
"QMOF_KHOT_EMBEDDINGS",
]
from .atomic_radii import ATOMIC_RADII
from .continuous_embeddings import CONTINUOUS_EMBEDDINGS
from .khot_embeddings import KHOT_EMBEDDINGS
from .qmof_khot_embeddings import QMOF_KHOT_EMBEDDINGS
| 25.916667 | 56 | 0.807074 | __all__ = [
"ATOMIC_RADII",
"KHOT_EMBEDDINGS",
"CONTINUOUS_EMBEDDINGS",
"QMOF_KHOT_EMBEDDINGS",
]
from .atomic_radii import ATOMIC_RADII
from .continuous_embeddings import CONTINUOUS_EMBEDDINGS
from .khot_embeddings import KHOT_EMBEDDINGS
from .qmof_khot_embeddings import QMOF_KHOT_EMBEDDINGS
| true | true |
1c41168c3a3d2953b6fe2d3e077ac4ba4cac7f89 | 1,075 | py | Python | src/deep_learning/train.py | Nirvana23333sun/fingerprint-verfication | b2a89c0cea50ca57f602fbca41e935486b301c71 | [
"Apache-2.0"
] | 2 | 2021-07-15T08:49:26.000Z | 2021-09-10T22:23:04.000Z | src/deep_learning/train.py | Nirvana23333sun/fingerprint-verfication | b2a89c0cea50ca57f602fbca41e935486b301c71 | [
"Apache-2.0"
] | null | null | null | src/deep_learning/train.py | Nirvana23333sun/fingerprint-verfication | b2a89c0cea50ca57f602fbca41e935486b301c71 | [
"Apache-2.0"
] | 1 | 2021-07-15T08:49:37.000Z | 2021-07-15T08:49:37.000Z | import torch.optim as optim
class Train:
def __init__(self, data_sampler, model, criterion):
self.data_sampler = data_sampler
self.criterion = criterion
self.model = model
def train(self, iterations, lr):
optimizer = optim.Adam(self.model.parameters(), lr)
avg_loss = 0... | 31.617647 | 90 | 0.56 | import torch.optim as optim
class Train:
def __init__(self, data_sampler, model, criterion):
self.data_sampler = data_sampler
self.criterion = criterion
self.model = model
def train(self, iterations, lr):
optimizer = optim.Adam(self.model.parameters(), lr)
avg_loss = 0... | true | true |
1c4117059d47c41f5773d5f9d6f4ab916bf1a0b9 | 21,462 | py | Python | main_unified_inverter.py | joycenerd/GenRep | 9cc21dd4b81d6649659308c42c192b0be73a040d | [
"MIT"
] | null | null | null | main_unified_inverter.py | joycenerd/GenRep | 9cc21dd4b81d6649659308c42c192b0be73a040d | [
"MIT"
] | null | null | null | main_unified_inverter.py | joycenerd/GenRep | 9cc21dd4b81d6649659308c42c192b0be73a040d | [
"MIT"
] | null | null | null | from __future__ import print_function
import numpy as np
import os
import sys
import argparse
import time
import math
import torchvision.utils as vutils
import tensorboard_logger as tb_logger
import torch
import torch.backends.cudnn as cudnn
from torchvision import transforms, datasets
from util import TwoCropTransf... | 42.165029 | 200 | 0.590951 | from __future__ import print_function
import numpy as np
import os
import sys
import argparse
import time
import math
import torchvision.utils as vutils
import tensorboard_logger as tb_logger
import torch
import torch.backends.cudnn as cudnn
from torchvision import transforms, datasets
from util import TwoCropTransf... | true | true |
1c41170638461112b76310613551c74f5b962a30 | 2,150 | py | Python | tensorpack/tfutils/symbolic_functions.py | Neovairis/tensorpack | ca0969089847c37a893a8e99317214c5899278db | [
"Apache-2.0"
] | 1 | 2020-07-06T20:27:02.000Z | 2020-07-06T20:27:02.000Z | tensorpack/tfutils/symbolic_functions.py | jrdeco560/tensorpack | 242dc71cafb9642e68a2bfb58bcf6ad45ccbb35c | [
"Apache-2.0"
] | 7 | 2019-12-16T21:58:30.000Z | 2022-02-10T00:17:01.000Z | tensorpack/tfutils/symbolic_functions.py | jrdeco560/tensorpack | 242dc71cafb9642e68a2bfb58bcf6ad45ccbb35c | [
"Apache-2.0"
] | 2 | 2019-09-04T00:02:29.000Z | 2020-07-06T20:27:04.000Z | # -*- coding: utf-8 -*-
# File: symbolic_functions.py
import tensorflow as tf
from ..compat import tfv1
from ..utils.develop import deprecated
__all__ = ['print_stat', 'rms']
def print_stat(x, message=None):
""" A simple print Op that might be easier to use than :meth:`tf.Print`.
Use it like: ``x = pr... | 29.452055 | 96 | 0.61814 |
import tensorflow as tf
from ..compat import tfv1
from ..utils.develop import deprecated
__all__ = ['print_stat', 'rms']
def print_stat(x, message=None):
if message is None:
message = x.op.name
lst = [tf.shape(x), tf.reduce_mean(x)]
if x.dtype.is_floating:
lst.append(rms(x))
return... | true | true |
1c41174e348735a3adcfa40669ba4be4956df176 | 1,656 | py | Python | thresh_global.py | Edward-HE/SDUWH_DIP_2020 | b0435590e0fb86d37964ad800806e31b9b4757f4 | [
"MIT"
] | 1 | 2021-07-17T01:12:12.000Z | 2021-07-17T01:12:12.000Z | thresh_global.py | Edward-HE/SDUWH_DIP_2020 | b0435590e0fb86d37964ad800806e31b9b4757f4 | [
"MIT"
] | null | null | null | thresh_global.py | Edward-HE/SDUWH_DIP_2020 | b0435590e0fb86d37964ad800806e31b9b4757f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'thresh_global.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore... | 42.461538 | 106 | 0.726449 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_thresh_global(object):
def setupUi(self, thresh_global):
thresh_global.setObjectName("thresh_global")
thresh_global.resize(400, 300)
self.buttonBox = QtWidgets.QDialogButtonBox(thresh_global)
self.buttonBox.setGeometry(QtCore.Q... | true | true |
1c4117f965afeacf608b6fb6210ad877a225ed13 | 2,499 | py | Python | static/brythonlib/cs1graphics/text.py | pythonpad/vue-pythonpad-runner | 52decba9607b3b7b050ee0bf6dd4ef07ae644587 | [
"MIT"
] | 3 | 2021-01-26T16:18:45.000Z | 2021-09-15T00:57:12.000Z | static/brythonlib/cs1graphics/text.py | pythonpad/vue-pythonpad-runner | 52decba9607b3b7b050ee0bf6dd4ef07ae644587 | [
"MIT"
] | null | null | null | static/brythonlib/cs1graphics/text.py | pythonpad/vue-pythonpad-runner | 52decba9607b3b7b050ee0bf6dd4ef07ae644587 | [
"MIT"
] | 2 | 2021-01-26T16:18:47.000Z | 2021-10-21T20:45:20.000Z | from .drawable import Drawable
from .point import Point
PT_PIXEL_RATIO = 1.32
class Text(Drawable):
def __init__(self, message='', fontsize=12, centerPt=None):
if not isinstance(message, str):
raise TypeError('message must be a string')
if not isinstance(fontsize, (int, float)):
... | 29.75 | 64 | 0.595038 | from .drawable import Drawable
from .point import Point
PT_PIXEL_RATIO = 1.32
class Text(Drawable):
def __init__(self, message='', fontsize=12, centerPt=None):
if not isinstance(message, str):
raise TypeError('message must be a string')
if not isinstance(fontsize, (int, float)):
... | true | true |
1c41183278974b02e6fb9500ddd99eac4fc9c1ad | 486 | py | Python | main.py | doc22940/Visualize-Realtime-Data-Stream-Chart-in-Flask | e629ca011b8d54ab1a0c74271ea238b7fe1e459e | [
"MIT"
] | 1 | 2020-03-06T18:30:15.000Z | 2020-03-06T18:30:15.000Z | main.py | doc22940/Visualize-Realtime-Data-Stream-Chart-in-Flask | e629ca011b8d54ab1a0c74271ea238b7fe1e459e | [
"MIT"
] | null | null | null | main.py | doc22940/Visualize-Realtime-Data-Stream-Chart-in-Flask | e629ca011b8d54ab1a0c74271ea238b7fe1e459e | [
"MIT"
] | null | null | null | from flask_handler import start_flask_application, app
import webbrowser
import threading
import functools
from config_handler import ConfigHandler
"""
Start Program with this file by running "python3 start.py"
"""
[HOST, PORT] = ConfigHandler().get_all("Website") # pylint: disable=unbalanced-tuple-unpacking
url = "... | 27 | 94 | 0.755144 | from flask_handler import start_flask_application, app
import webbrowser
import threading
import functools
from config_handler import ConfigHandler
[HOST, PORT] = ConfigHandler().get_all("Website")
url = "http://"+HOST+":{0}".format(PORT)
if __name__ == '__main__':
threading.Timer(1, functools.partial( webbrows... | true | true |
1c41185a4314796bf23baa1446d282fa789f7ad5 | 1,016 | py | Python | src/insertDelete/set.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | null | null | null | src/insertDelete/set.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | null | null | null | src/insertDelete/set.py | rajitbanerjee/leetcode | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | [
"CC0-1.0"
] | 1 | 2021-04-28T18:17:55.000Z | 2021-04-28T18:17:55.000Z | import random
class RandomizedSet:
def __init__(self):
self.dc = {}
def insert(self, val: int) -> bool:
"""
Inserts a value to the set. Returns true if the set did not already contain the specified element.
"""
if val in self.dc:
return False
... | 24.780488 | 107 | 0.538386 | import random
class RandomizedSet:
def __init__(self):
self.dc = {}
def insert(self, val: int) -> bool:
if val in self.dc:
return False
else:
self.dc[val] = 1
return True
def remove(self, val: int) -> bool:
if val in se... | true | true |
1c411886ac7d3a4d304e2c9264da253cd882e4e2 | 18,675 | py | Python | mypy/server/astmerge.py | amikrop/mypy | c701d3a8c9696440f005a23ab620a8b6f12ce416 | [
"PSF-2.0"
] | 35 | 2016-03-30T09:25:14.000Z | 2022-03-12T10:53:11.000Z | mypy/server/astmerge.py | amikrop/mypy | c701d3a8c9696440f005a23ab620a8b6f12ce416 | [
"PSF-2.0"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | env/lib/python3.9/site-packages/mypy/server/astmerge.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | 6 | 2016-01-29T04:33:27.000Z | 2019-11-03T19:19:43.000Z | """Merge a new version of a module AST and symbol table to older versions of those.
When the source code of a module has a change in fine-grained incremental mode,
we build a new AST from the updated source. However, other parts of the program
may have direct references to parts of the old AST (namely, those nodes exp... | 39.734043 | 99 | 0.673039 |
from typing import Dict, List, cast, TypeVar, Optional
from mypy.nodes import (
MypyFile, SymbolTable, Block, AssignmentStmt, NameExpr, MemberExpr, RefExpr, TypeInfo,
FuncDef, ClassDef, NamedTupleExpr, SymbolNode, Var, Statement, SuperExpr, NewTypeExpr,
OverloadedFuncDef, LambdaExpr, TypedDictExpr, EnumCa... | true | true |
1c411891a0597cb0401fdb6c761e6a64c989874a | 12,476 | py | Python | anchorecli/cli/account.py | bollwyvl/anchore-cli | 83cf52e54a19e06b31b6aeffcf06e08c5c81a497 | [
"Apache-2.0"
] | null | null | null | anchorecli/cli/account.py | bollwyvl/anchore-cli | 83cf52e54a19e06b31b6aeffcf06e08c5c81a497 | [
"Apache-2.0"
] | null | null | null | anchorecli/cli/account.py | bollwyvl/anchore-cli | 83cf52e54a19e06b31b6aeffcf06e08c5c81a497 | [
"Apache-2.0"
] | null | null | null | import sys
import os
import re
import json
import click
import anchorecli.clients.apiexternal
config = {}
whoami = {}
@click.group(name='account', short_help='Account operations')
@click.pass_obj
def account(ctx_config):
global config, whoami
config = ctx_config
try:
anchorecli.cli.utils.check_a... | 32.071979 | 180 | 0.644117 | import sys
import os
import re
import json
import click
import anchorecli.clients.apiexternal
config = {}
whoami = {}
@click.group(name='account', short_help='Account operations')
@click.pass_obj
def account(ctx_config):
global config, whoami
config = ctx_config
try:
anchorecli.cli.utils.check_a... | true | true |
1c4118f2bcb0d51cc3a6797155944b89df7fa2d2 | 1,080 | py | Python | setup.py | MoritzR/fints2ledger | ad02fae91c0c56507a85091553c1b9de8c2225e0 | [
"MIT"
] | 17 | 2018-12-28T22:40:27.000Z | 2021-11-18T11:08:46.000Z | setup.py | MoritzR/fints2ledger | ad02fae91c0c56507a85091553c1b9de8c2225e0 | [
"MIT"
] | 16 | 2019-06-16T13:37:12.000Z | 2021-12-29T14:22:19.000Z | setup.py | MoritzR/fints2ledger | ad02fae91c0c56507a85091553c1b9de8c2225e0 | [
"MIT"
] | 6 | 2019-03-10T13:29:12.000Z | 2021-08-02T14:55:24.000Z | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='fints2ledger',
version='0.8.0',
description='A tool for downloading transactions from FinTS banking APIs and sorting them into a ledger journal.',
long_description=readme(),
long_des... | 28.421053 | 120 | 0.586111 | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='fints2ledger',
version='0.8.0',
description='A tool for downloading transactions from FinTS banking APIs and sorting them into a ledger journal.',
long_description=readme(),
long_des... | true | true |
1c4119840ee4f1afbd26028b257183464501fdf3 | 492 | py | Python | chat/registration/forms.py | welmends/stocks-chat | 535f56882edd90f85392a0daeabbae372aa62d78 | [
"Apache-2.0"
] | null | null | null | chat/registration/forms.py | welmends/stocks-chat | 535f56882edd90f85392a0daeabbae372aa62d78 | [
"Apache-2.0"
] | null | null | null | chat/registration/forms.py | welmends/stocks-chat | 535f56882edd90f85392a0daeabbae372aa62d78 | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class UserSignUpForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'password1']
def __init__(self, *args, **kwargs):
super(UserCreationForm, ... | 32.8 | 63 | 0.680894 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class UserSignUpForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'password1']
def __init__(self, *args, **kwargs):
super(UserCreationForm, ... | true | true |
1c4119ed3e3307861e89aa13ec64e00deb301064 | 879 | py | Python | tests/test_preloaded.py | JayjeetAtGithub/coffea | a5583401173859878b52dea44b14ed6c613aea81 | [
"BSD-3-Clause"
] | null | null | null | tests/test_preloaded.py | JayjeetAtGithub/coffea | a5583401173859878b52dea44b14ed6c613aea81 | [
"BSD-3-Clause"
] | null | null | null | tests/test_preloaded.py | JayjeetAtGithub/coffea | a5583401173859878b52dea44b14ed6c613aea81 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import os
import uproot
from coffea import processor
from coffea.processor.test_items import NanoEvents0Processor
from coffea.nanoaod import NanoEvents
def test_preloaded_nanoevents():
columns = ['nMuon','Muon_pt','Muon_eta','Muon_phi','Muon_mass','Muon_charge', 'nJet', 'Jet_eta']
p = NanoEvents... | 32.555556 | 100 | 0.718999 | import pytest
import os
import uproot
from coffea import processor
from coffea.processor.test_items import NanoEvents0Processor
from coffea.nanoaod import NanoEvents
def test_preloaded_nanoevents():
columns = ['nMuon','Muon_pt','Muon_eta','Muon_phi','Muon_mass','Muon_charge', 'nJet', 'Jet_eta']
p = NanoEvents... | true | true |
1c4119f61cd68996395d4e7fd48f6dad8413857e | 339 | py | Python | order/admin.py | divyesh1099/badboystyle | f4fec0858b43e14f0e1f173261f363d4262c28ea | [
"MIT"
] | null | null | null | order/admin.py | divyesh1099/badboystyle | f4fec0858b43e14f0e1f173261f363d4262c28ea | [
"MIT"
] | null | null | null | order/admin.py | divyesh1099/badboystyle | f4fec0858b43e14f0e1f173261f363d4262c28ea | [
"MIT"
] | null | null | null | from django.contrib import admin
from order.models import Order
# Register your models here.
class OrderAdmin(admin.ModelAdmin):
list_display = ['user', 'date', 'time', 'amount', 'dispatched', 'delivered', 'paid', 'active', 'cancelled']
search_fields = ['user']
admin.site.register(Order, OrderAdmin)
# admin.s... | 33.9 | 111 | 0.722714 | from django.contrib import admin
from order.models import Order
class OrderAdmin(admin.ModelAdmin):
list_display = ['user', 'date', 'time', 'amount', 'dispatched', 'delivered', 'paid', 'active', 'cancelled']
search_fields = ['user']
admin.site.register(Order, OrderAdmin)
| true | true |
1c411a1bf0ee7de1a590bca1985d65eaa7c54a69 | 3,223 | py | Python | softwareprocess/utility/aries.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | softwareprocess/utility/aries.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | softwareprocess/utility/aries.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import math
from angle import Angle
class Aries:
REFERENCE_YEAR = 2001
def __init__(self):
pass
@staticmethod
def get_greenwich_hour_angle(year, month, day, hour, minute, second):
"""
= relative_prime_meridian + earth rota... | 39.304878 | 95 | 0.645982 | from datetime import datetime, timedelta
import math
from angle import Angle
class Aries:
REFERENCE_YEAR = 2001
def __init__(self):
pass
@staticmethod
def get_greenwich_hour_angle(year, month, day, hour, minute, second):
reference_datetime_str = str(year) + ",01,01,00,00... | true | true |
1c411a3e97e8903efae71b19846f3d31fca7a9f9 | 1,211 | py | Python | discordbot.py | yukina018/discordpy-startup | 6e25221dcd7e24a468690c7e8d55991fec9a5b17 | [
"MIT"
] | 2 | 2021-07-17T04:05:10.000Z | 2021-07-17T04:05:29.000Z | discordbot.py | yukina018/discordpy-startup | 6e25221dcd7e24a468690c7e8d55991fec9a5b17 | [
"MIT"
] | null | null | null | discordbot.py | yukina018/discordpy-startup | 6e25221dcd7e24a468690c7e8d55991fec9a5b17 | [
"MIT"
] | null | null | null | from discord.ext import commands
import os
import traceback
bot = commands.Bot(command_prefix='/')
token = os.environ['DISCORD_BOT_TOKEN']
@bot.event
async def on_command_error(ctx, error):
orig_error = getattr(error, "original", error)
error_msg = ''.join(traceback.TracebackException.from_exception(orig_err... | 24.22 | 105 | 0.698596 | from discord.ext import commands
import os
import traceback
bot = commands.Bot(command_prefix='/')
token = os.environ['DISCORD_BOT_TOKEN']
@bot.event
async def on_command_error(ctx, error):
orig_error = getattr(error, "original", error)
error_msg = ''.join(traceback.TracebackException.from_exception(orig_err... | true | true |
1c411a5840d5920258e89c30d35db45bb4be35ae | 414 | py | Python | pants-plugins/experimental/fooify/target_types.py | sureshjoshi/pants-example-plugin | a266a01cb99e632ec21ec9c985a04054adec1185 | [
"MIT"
] | null | null | null | pants-plugins/experimental/fooify/target_types.py | sureshjoshi/pants-example-plugin | a266a01cb99e632ec21ec9c985a04054adec1185 | [
"MIT"
] | null | null | null | pants-plugins/experimental/fooify/target_types.py | sureshjoshi/pants-example-plugin | a266a01cb99e632ec21ec9c985a04054adec1185 | [
"MIT"
] | null | null | null | from pants.engine.target import COMMON_TARGET_FIELDS, Dependencies, Target
class FooifyDependenciesField(Dependencies):
pass
class FooifyTarget(Target):
alias = "fooify_distribution"
core_fields = (
*COMMON_TARGET_FIELDS,
FooifyDependenciesField,
)
help = (
"The `fooify` ... | 23 | 74 | 0.681159 | from pants.engine.target import COMMON_TARGET_FIELDS, Dependencies, Target
class FooifyDependenciesField(Dependencies):
pass
class FooifyTarget(Target):
alias = "fooify_distribution"
core_fields = (
*COMMON_TARGET_FIELDS,
FooifyDependenciesField,
)
help = (
"The `fooify` ... | true | true |
1c411b89c3ec5b518508ecb478d6c4326ce7884e | 24,995 | py | Python | EWS/EWS_weekly.py | KoenvanLoon/EWS | 3447921ec2140f29fd69d5b140b5eba2f244bccd | [
"MIT"
] | null | null | null | EWS/EWS_weekly.py | KoenvanLoon/EWS | 3447921ec2140f29fd69d5b140b5eba2f244bccd | [
"MIT"
] | null | null | null | EWS/EWS_weekly.py | KoenvanLoon/EWS | 3447921ec2140f29fd69d5b140b5eba2f244bccd | [
"MIT"
] | null | null | null | """
EWS - Early Warning Signals
EWS_weekly
@authors: KoenvanLoon & TijmenJanssen
"""
from pcraster import *
import numpy as np
import os
import time
import EWSPy as ews
import EWS_configuration as cfg
import NULL_models_timeseries_weekly as temp_NULL
import NULL_models_spatial_weekly as spat_NULL
imp... | 40.444984 | 126 | 0.680936 |
from pcraster import *
import numpy as np
import os
import time
import EWSPy as ews
import EWS_configuration as cfg
import NULL_models_timeseries_weekly as temp_NULL
import NULL_models_spatial_weekly as spat_NULL
import EWS_StateVariables as ews_sv
variables = ews_sv.variables_weekly
if not cf... | true | true |
1c411b9db3f142e3d0cae1ec92eac77c0a059fdb | 6,036 | py | Python | thought_lounge/models.py | simplykhanh/thoughtloungev2 | e26f3fd7cf1a179622a4b20ae77dd2aa1bd5daa6 | [
"MIT"
] | null | null | null | thought_lounge/models.py | simplykhanh/thoughtloungev2 | e26f3fd7cf1a179622a4b20ae77dd2aa1bd5daa6 | [
"MIT"
] | 1 | 2015-10-27T00:22:51.000Z | 2018-11-20T19:02:47.000Z | thought_lounge/models.py | simplykhanh/thoughtloungev2 | e26f3fd7cf1a179622a4b20ae77dd2aa1bd5daa6 | [
"MIT"
] | 1 | 2015-10-27T00:11:22.000Z | 2015-10-27T00:11:22.000Z | from thought_lounge import db
import uuid, datetime
from datetime import timezone
from passlib.apps import custom_app_context as pwd_context
class Key(db.Model):
id = db.Column(db.Integer, primary_key = True)
key = db.Column(db.String, unique = True, nullable = False)
def __init__(self):
self.key... | 32.627027 | 126 | 0.661199 | from thought_lounge import db
import uuid, datetime
from datetime import timezone
from passlib.apps import custom_app_context as pwd_context
class Key(db.Model):
id = db.Column(db.Integer, primary_key = True)
key = db.Column(db.String, unique = True, nullable = False)
def __init__(self):
self.key... | true | true |
1c411be21f8294258120d22a8cf551730fa1c2c7 | 61,611 | py | Python | pyhamtools/lookuplib.py | threeio/pyhamtools | 0fa24e97416153f669987cc90e7c29ad16eec7b4 | [
"MIT"
] | null | null | null | pyhamtools/lookuplib.py | threeio/pyhamtools | 0fa24e97416153f669987cc90e7c29ad16eec7b4 | [
"MIT"
] | null | null | null | pyhamtools/lookuplib.py | threeio/pyhamtools | 0fa24e97416153f669987cc90e7c29ad16eec7b4 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import os
import logging
import logging.config
import re
import random, string
from datetime import datetime
import xml.etree.ElementTree as ET
import urllib
import json
import copy
import sys
import unicodedata
import requests
from requests.exceptions import ConnectionError, HT... | 39.646718 | 177 | 0.57467 | from __future__ import unicode_literals
import os
import logging
import logging.config
import re
import random, string
from datetime import datetime
import xml.etree.ElementTree as ET
import urllib
import json
import copy
import sys
import unicodedata
import requests
from requests.exceptions import ConnectionError, HT... | true | true |
1c411bfc91d017fdf73488a0d02e0e2a2a808b40 | 11,782 | py | Python | letterboxd/api.py | stevenrayesky/letterboxd | d231eda473ff81ce2f5f94f1e4f71835c413c81a | [
"MIT"
] | 25 | 2018-07-24T22:30:45.000Z | 2021-06-03T21:03:25.000Z | letterboxd/api.py | stevenrayesky/letterboxd | d231eda473ff81ce2f5f94f1e4f71835c413c81a | [
"MIT"
] | 313 | 2018-06-22T04:52:59.000Z | 2021-07-16T15:25:43.000Z | letterboxd/api.py | stevenrayesky/letterboxd | d231eda473ff81ce2f5f94f1e4f71835c413c81a | [
"MIT"
] | 6 | 2018-06-22T02:45:49.000Z | 2021-04-27T04:46:52.000Z | import hashlib
import hmac
import json
import logging
import os
import time
import uuid
import requests
logging.getLogger(__name__)
CHARLES_PROXY = "http://localhost:8888/"
CHARLES_CERTIFICATE = os.environ.get("CHARLES_CERTIFICATE", None)
CHARLES = os.environ.get("CHARLES", None)
class API:
"""
Communicati... | 38.503268 | 88 | 0.583687 | import hashlib
import hmac
import json
import logging
import os
import time
import uuid
import requests
logging.getLogger(__name__)
CHARLES_PROXY = "http://localhost:8888/"
CHARLES_CERTIFICATE = os.environ.get("CHARLES_CERTIFICATE", None)
CHARLES = os.environ.get("CHARLES", None)
class API:
def __init__(self,... | true | true |
1c411dfc20d51e3bd775b4fd00e174a837526fc1 | 4,716 | py | Python | pa300_meas.py | wataash/SUSS | bfdf96ff01fb33a2adc8104f30a27dea435ea9f3 | [
"MIT"
] | 3 | 2016-01-08T02:38:59.000Z | 2017-06-11T05:43:09.000Z | pa300_meas.py | wataash/instr | bfdf96ff01fb33a2adc8104f30a27dea435ea9f3 | [
"MIT"
] | null | null | null | pa300_meas.py | wataash/instr | bfdf96ff01fb33a2adc8104f30a27dea435ea9f3 | [
"MIT"
] | null | null | null | from itertools import product
import time
import lib.algorithms as al
import lib.constants as c
from lib.database import Database, update_fit_R3
from instr.agilent4156c import Agilent4156C
from instr.suss_pa300 import SussPA300
from vi_meas import meas_vi_double
# Configurations --------------------------------------... | 37.728 | 80 | 0.57782 | from itertools import product
import time
import lib.algorithms as al
import lib.constants as c
from lib.database import Database, update_fit_R3
from instr.agilent4156c import Agilent4156C
from instr.suss_pa300 import SussPA300
from vi_meas import meas_vi_double
sample = 'dummy_sample'
inst = 'suss_test'
debug_mode =... | true | true |
1c411e2187967a1829ea87f4d2e5bf6c61ad28a4 | 1,675 | py | Python | youtube_search.py | smartao/lazyvert | e536908febf48885987df40fe497b899ed486927 | [
"MIT"
] | null | null | null | youtube_search.py | smartao/lazyvert | e536908febf48885987df40fe497b899ed486927 | [
"MIT"
] | null | null | null | youtube_search.py | smartao/lazyvert | e536908febf48885987df40fe497b899ed486927 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import urllib.request
import urllib.parse
import re
import os.path
arq_gmail = "gmail_mensagens.txt"
def youtube_search():
print('\n### Iniciando youtube_search.py ###\n')
urls = [] # Lista para armazenar os URLs dos videos
if os.path.exists(arq_gmail):
with open(arq_gmail) a... | 33.5 | 79 | 0.573731 | import urllib.request
import urllib.parse
import re
import os.path
arq_gmail = "gmail_mensagens.txt"
def youtube_search():
print('\n### Iniciando youtube_search.py ###\n')
urls = []
if os.path.exists(arq_gmail):
with open(arq_gmail) as arquivo:
for registro in arquivo:
... | true | true |
1c411e7e8c97e4d8472dd0905b19a56a6fd5cc5b | 1,868 | py | Python | tests/executors/test_celery_executor.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-05-20T05:42:19.000Z | 2020-05-20T05:42:19.000Z | tests/executors/test_celery_executor.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 13 | 2018-11-30T18:18:32.000Z | 2021-02-19T17:04:12.000Z | tests/executors/test_celery_executor.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2018-01-23T15:42:58.000Z | 2020-05-19T13:51:07.000Z | # -*- coding: utf-8 -*-
#
# 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, softw... | 33.357143 | 74 | 0.697002 | import unittest
import sys
from airflow.executors.celery_executor import app
from airflow.executors.celery_executor import CeleryExecutor
from airflow.utils.state import State
from celery.contrib.testing.worker import start_worker
import celery.contrib.testing.tasks
class CeleryExecutorTest(unittest.TestCase):
... | true | true |
1c411e985e32ab7b41daea34f3f11bc48964f38d | 1,193 | py | Python | weedcoco/tests/test_utils.py | Sydney-Informatics-Hub/Weed-ID-Interchange | d27891c2148de54d03727f688f8b6c6c414ec09b | [
"MIT"
] | 14 | 2021-11-29T12:16:59.000Z | 2022-03-20T00:26:10.000Z | weedcoco/tests/test_utils.py | Sydney-Informatics-Hub/Weed-ID-Interchange | d27891c2148de54d03727f688f8b6c6c414ec09b | [
"MIT"
] | 282 | 2020-07-10T00:52:21.000Z | 2021-03-01T06:58:05.000Z | weedcoco/tests/test_utils.py | Sydney-Informatics-Hub/Weed-ID-Interchange | d27891c2148de54d03727f688f8b6c6c414ec09b | [
"MIT"
] | 2 | 2020-10-07T06:12:39.000Z | 2021-02-02T05:21:32.000Z | import pytest
from weedcoco.utils import lookup_growth_stage_name
@pytest.mark.parametrize(
"idx,scheme,expected",
[
[10, "fine", "First leaf through coleoptile"],
[13, "fine", "3 leaves unfolded"],
[19, "fine", "9 or more leaves unfolded"],
[20, "fine", "No tillers"],
... | 30.589744 | 71 | 0.604359 | import pytest
from weedcoco.utils import lookup_growth_stage_name
@pytest.mark.parametrize(
"idx,scheme,expected",
[
[10, "fine", "First leaf through coleoptile"],
[13, "fine", "3 leaves unfolded"],
[19, "fine", "9 or more leaves unfolded"],
[20, "fine", "No tillers"],
... | true | true |
1c41201f781afab2487923eaedfe69628b7c4df2 | 1,770 | py | Python | test/util/rpcauth-test.py | c-sports/CSPN | 44522f7ed5f9844adae2cdbd3d3b9688395f9f10 | [
"MIT"
] | 3 | 2020-06-23T17:15:04.000Z | 2021-05-03T03:37:42.000Z | test/util/rpcauth-test.py | c-sports/CSPN | 44522f7ed5f9844adae2cdbd3d3b9688395f9f10 | [
"MIT"
] | 2 | 2020-06-17T13:02:11.000Z | 2021-01-13T13:14:15.000Z | test/util/rpcauth-test.py | c-sports/CSPN | 44522f7ed5f9844adae2cdbd3d3b9688395f9f10 | [
"MIT"
] | 3 | 2020-06-18T17:01:10.000Z | 2022-02-02T00:07:56.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Copyright (c) 2018-2021 The CSPN Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test share/rpcauth/rpcauth.py
"""
import base64
impo... | 35.4 | 77 | 0.688701 | import base64
import configparser
import hmac
import importlib
import os
import sys
import unittest
class TestRPCAuth(unittest.TestCase):
def setUp(self):
config = configparser.ConfigParser()
config_path = os.path.abspath(
os.path.join(os.sep, os.path.abspath(os.path.dirname(__file__)),... | true | true |
1c41201f86413e0c3d77e5d1e88b2aad459f51ae | 1,212 | py | Python | corecode/models.py | abid-anjum/PythonDjangoSchoolSystem | 279f5d7b167883fda4d575d6d5621b63b991c232 | [
"MIT"
] | 1 | 2021-04-04T15:25:26.000Z | 2021-04-04T15:25:26.000Z | corecode/models.py | abid-anjum/PythonDjangoSchoolSystem | 279f5d7b167883fda4d575d6d5621b63b991c232 | [
"MIT"
] | null | null | null | corecode/models.py | abid-anjum/PythonDjangoSchoolSystem | 279f5d7b167883fda4d575d6d5621b63b991c232 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.urls import reverse
# Create your models here.
class SiteConfig(models.Model):
""" Site Configurations """
key = models.SlugField()
value = models.CharField(max_length=200)
def __str__(self):
return self.key
class AcademicSessio... | 19.868852 | 54 | 0.69637 | from django.db import models
from django.utils import timezone
from django.urls import reverse
class SiteConfig(models.Model):
key = models.SlugField()
value = models.CharField(max_length=200)
def __str__(self):
return self.key
class AcademicSession(models.Model):
name = models.CharField(max_length=200... | true | true |
1c4120b92e8b0999d4d02d84a4bedb51e994d174 | 1,572 | py | Python | rial_old/metadata/RIALModule.py | L3tum/RIAL | fba25f37434ff51e0de8e22ce834af589aba24e8 | [
"BSD-3-Clause"
] | 2 | 2020-06-02T20:00:28.000Z | 2020-06-06T02:15:49.000Z | rial_old/metadata/RIALModule.py | L3tum/RIAL | fba25f37434ff51e0de8e22ce834af589aba24e8 | [
"BSD-3-Clause"
] | 51 | 2020-04-13T13:27:10.000Z | 2020-06-12T11:38:36.000Z | rial_old/metadata/RIALModule.py | L3tum/RIAL | fba25f37434ff51e0de8e22ce834af589aba24e8 | [
"BSD-3-Clause"
] | 2 | 2020-06-24T14:44:01.000Z | 2020-11-29T04:08:54.000Z | from typing import List, Dict, Optional
from llvmlite.ir import Module, context
from rial.metadata.RIALFunction import RIALFunction
from rial.metadata.RIALIdentifiedStructType import RIALIdentifiedStructType
from rial.rial_types.RIALVariable import RIALVariable
class RIALModule(Module):
dependencies: List[str]
... | 35.727273 | 96 | 0.696565 | from typing import List, Dict, Optional
from llvmlite.ir import Module, context
from rial.metadata.RIALFunction import RIALFunction
from rial.metadata.RIALIdentifiedStructType import RIALIdentifiedStructType
from rial.rial_types.RIALVariable import RIALVariable
class RIALModule(Module):
dependencies: List[str]
... | true | true |
1c4120c7b5399be0aa1163989112029f5ed99d31 | 7,810 | py | Python | src/sage/groups/abelian_gps/dual_abelian_group_element.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | 1 | 2021-03-15T21:45:56.000Z | 2021-03-15T21:45:56.000Z | src/sage/groups/abelian_gps/dual_abelian_group_element.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | null | null | null | src/sage/groups/abelian_gps/dual_abelian_group_element.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | null | null | null | """
Elements (characters) of the dual group of a finite Abelian group
To obtain the dual group of a finite Abelian group, use the
:meth:`~sage.groups.abelian_gps.abelian_group.dual_group` method::
sage: F = AbelianGroup([2,3,5,7,8], names="abcde")
sage: F
Multiplicative Abelian group isomorphic to C2 x C3... | 32.677824 | 108 | 0.559667 |
import operator
from sage.arith.all import LCM
from sage.misc.all import prod
from sage.groups.abelian_gps.element_base import AbelianGroupElementBase
from functools import reduce
def add_strings(x, z=0):
if len(x) == 0:
return z
if not isinstance(x, list):
m = iter(x)
y = next(m)
... | true | true |
1c412155713ea11f66ed1ac5b32c4f06b6e448d8 | 3,847 | py | Python | fairseq/models/fairseq_incremental_decoder.py | qibaoyuan/fairseq | eabd07fdcfd5b007d05428e81a31b7f3fc5de959 | [
"BSD-3-Clause"
] | null | null | null | fairseq/models/fairseq_incremental_decoder.py | qibaoyuan/fairseq | eabd07fdcfd5b007d05428e81a31b7f3fc5de959 | [
"BSD-3-Clause"
] | null | null | null | fairseq/models/fairseq_incremental_decoder.py | qibaoyuan/fairseq | eabd07fdcfd5b007d05428e81a31b7f3fc5de959 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from fairseq.models import Fairseq... | 41.815217 | 103 | 0.666753 |
from fairseq.models import FairseqDecoder
class FairseqIncrementalDecoder(FairseqDecoder):
def __init__(self, dictionary):
super().__init__(dictionary)
def forward(self, prev_output_tokens, encoder_out=None, incremental_state=None, **kwargs):
raise NotImplementedError
def extract_featu... | true | true |
1c41218a618fd8499930cfb0946b992f436a8bd6 | 1,082 | py | Python | kubernetes_asyncio/test/test_apps_v1beta1_deployment_rollback.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_apps_v1beta1_deployment_rollback.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_apps_v1beta1_deployment_rollback.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 27.05 | 129 | 0.755083 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.models.apps_v1beta1_deployment_rollback import AppsV1beta1DeploymentRollback from kubernetes_asyncio.client.rest import ApiException
class TestAppsV1beta1DeploymentRollback(unittest.TestCase):
... | true | true |
1c41221b6cfc2a6ed96a7d025c02c9c4e2dc4e94 | 5,970 | py | Python | skimage/_shared/testing.py | spark1729/scikit-image | 65d525bcd5f30604c9a71c3480355580e9db7162 | [
"BSD-3-Clause"
] | null | null | null | skimage/_shared/testing.py | spark1729/scikit-image | 65d525bcd5f30604c9a71c3480355580e9db7162 | [
"BSD-3-Clause"
] | null | null | null | skimage/_shared/testing.py | spark1729/scikit-image | 65d525bcd5f30604c9a71c3480355580e9db7162 | [
"BSD-3-Clause"
] | null | null | null | """Testing utilities."""
import os
import re
from tempfile import NamedTemporaryFile
from numpy import testing
import numpy as np
from skimage._shared._warnings import expected_warnings
import warnings
from .. import data, io, img_as_uint, img_as_float, img_as_int, img_as_ubyte
SKIP_RE = re.compile("(\s*>>>.*?)(\... | 28.564593 | 81 | 0.638861 |
import os
import re
from tempfile import NamedTemporaryFile
from numpy import testing
import numpy as np
from skimage._shared._warnings import expected_warnings
import warnings
from .. import data, io, img_as_uint, img_as_float, img_as_int, img_as_ubyte
SKIP_RE = re.compile("(\s*>>>.*?)(\s*)#\s*skip\s+if\s+(.*)$"... | true | true |
1c41222a6b11d443fb65bf6d70f484ce56870561 | 2,509 | py | Python | Classifier/oxford_flower102.py | KlrShaK/Oxford_flowers102-using-Tensorflow | 7966a0ead1ce0175fbb1d9d658da3ec915e2d77a | [
"MIT"
] | null | null | null | Classifier/oxford_flower102.py | KlrShaK/Oxford_flowers102-using-Tensorflow | 7966a0ead1ce0175fbb1d9d658da3ec915e2d77a | [
"MIT"
] | null | null | null | Classifier/oxford_flower102.py | KlrShaK/Oxford_flowers102-using-Tensorflow | 7966a0ead1ce0175fbb1d9d658da3ec915e2d77a | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow_datasets as tfds
import matplotlib.pyplot as plt
from acc_plotter import plot_accuracy
from tensorflow.keras.applications.inception_v3 import InceptionV3
dataset_name = 'oxford_flowers102'
train_dataset = tfds.load(dataset_name, split=tfds.Split.TRAIN)
val_dataset = ... | 35.338028 | 115 | 0.66401 | import tensorflow as tf
import tensorflow_datasets as tfds
import matplotlib.pyplot as plt
from acc_plotter import plot_accuracy
from tensorflow.keras.applications.inception_v3 import InceptionV3
dataset_name = 'oxford_flowers102'
train_dataset = tfds.load(dataset_name, split=tfds.Split.TRAIN)
val_dataset = ... | true | true |
1c412274933c8205c6fdff7216129db9bc5bc53d | 1,212 | py | Python | python/tests/engine/test_impute.py | dreness/data-wrangling-components | cf1a6eb152bb4f2fd1d3b933b9aa32b965a29610 | [
"MIT"
] | null | null | null | python/tests/engine/test_impute.py | dreness/data-wrangling-components | cf1a6eb152bb4f2fd1d3b933b9aa32b965a29610 | [
"MIT"
] | null | null | null | python/tests/engine/test_impute.py | dreness/data-wrangling-components | cf1a6eb152bb4f2fd1d3b933b9aa32b965a29610 | [
"MIT"
] | null | null | null | #
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project.
#
from tests.engine.test_store import get_test_store
from data_wrangling_components.engine.verbs.impute import impute
from data_wrangling_components.types import Step, Verb
def test_impute_w... | 24.24 | 67 | 0.590759 |
from tests.engine.test_store import get_test_store
from data_wrangling_components.engine.verbs.impute import impute
from data_wrangling_components.types import Step, Verb
def test_impute_with_string():
step = Step(
Verb.Impute,
"table5",
"output",
args={"to": "item", "v... | true | true |
1c4122ed5af14f238a921d169b5c91a69b567593 | 7,814 | py | Python | docs/conf.py | suhyun-kim-div/cifar10 | b5b93de3a8d8c32839d6c19831eb4c46f2e708bf | [
"FTL"
] | null | null | null | docs/conf.py | suhyun-kim-div/cifar10 | b5b93de3a8d8c32839d6c19831eb4c46f2e708bf | [
"FTL"
] | null | null | null | docs/conf.py | suhyun-kim-div/cifar10 | b5b93de3a8d8c32839d6c19831eb4c46f2e708bf | [
"FTL"
] | null | null | null | # -*- coding: utf-8 -*-
#
# cifar10-practice documentation build configuration file, created by
# sphinx-quickstart.
#
# 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.
#
# All configuration valu... | 31.893878 | 80 | 0.707832 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'cifar10-practice'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, includin... | true | true |
1c412340b6d4093988ac2b28656063c117e261ae | 28,402 | py | Python | pennylane/plugins/default_gaussian.py | rickyHong/Pennylane-repl | f18e5f233f84b91bbac8e61cebdee77c66fafd79 | [
"Apache-2.0"
] | 2 | 2021-06-29T01:30:08.000Z | 2021-08-23T10:38:52.000Z | pennylane/plugins/default_gaussian.py | rickyHong/Pennylane-repl | f18e5f233f84b91bbac8e61cebdee77c66fafd79 | [
"Apache-2.0"
] | null | null | null | pennylane/plugins/default_gaussian.py | rickyHong/Pennylane-repl | f18e5f233f84b91bbac8e61cebdee77c66fafd79 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 32.020293 | 114 | 0.579642 |
import numpy as np
from scipy.special import factorial as fac
import pennylane as qml
from pennylane import Device
tolerance = 1e-10
def partitions(s, include_singles=True):
if len(s) == 2:
if include_singles:
yield (s[0],), (s[1],)
yield tuple(s),
else:
... | true | true |
1c4123d7dca17ab93ea3afbdefc8b1fe3e2114f5 | 20 | py | Python | vim/fred.py | timm/16 | 56e6c978274fb6a865cc804bee6f4b6ebb4e108f | [
"Unlicense"
] | null | null | null | vim/fred.py | timm/16 | 56e6c978274fb6a865cc804bee6f4b6ebb4e108f | [
"Unlicense"
] | 1 | 2016-04-28T01:50:44.000Z | 2016-04-28T01:50:44.000Z | vim/fred.py | timm/16 | 56e6c978274fb6a865cc804bee6f4b6ebb4e108f | [
"Unlicense"
] | null | null | null | def sasd():
fdfd
| 6.666667 | 12 | 0.55 | def sasd():
fdfd
| true | true |
1c412499a255c1d223f8d65a8a695fa0af669689 | 1,573 | py | Python | tests/tests_indiv_jobs/test_commandjob.py | tadinve/ctm_python_client | de44e5012214ec42bb99b7f9b4ebc5394cd14328 | [
"BSD-3-Clause"
] | null | null | null | tests/tests_indiv_jobs/test_commandjob.py | tadinve/ctm_python_client | de44e5012214ec42bb99b7f9b4ebc5394cd14328 | [
"BSD-3-Clause"
] | null | null | null | tests/tests_indiv_jobs/test_commandjob.py | tadinve/ctm_python_client | de44e5012214ec42bb99b7f9b4ebc5394cd14328 | [
"BSD-3-Clause"
] | null | null | null | from ctm_python_client.jobs.command import CommandJob
import os
from ctm_python_client.core.bmc_control_m import CmJobFlow
from ctm_python_client.session.session import Session
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(BASE_PATH, ".secrets"), "r") as fp:
ctm_uri = fp.readline(... | 26.661017 | 78 | 0.68595 | from ctm_python_client.jobs.command import CommandJob
import os
from ctm_python_client.core.bmc_control_m import CmJobFlow
from ctm_python_client.session.session import Session
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(BASE_PATH, ".secrets"), "r") as fp:
ctm_uri = fp.readline(... | true | true |
1c4124bd25be8fb7e58fbbf5070501ee21d0ff13 | 4,211 | py | Python | tests/test_create_container.py | movermeyer/pyspaces | 45c1dba6b8ca467d7617399c8d8b7bdb7370808b | [
"MIT"
] | 88 | 2015-04-26T18:03:43.000Z | 2021-12-17T15:00:04.000Z | tests/test_create_container.py | movermeyer/pyspaces | 45c1dba6b8ca467d7617399c8d8b7bdb7370808b | [
"MIT"
] | 6 | 2015-04-27T12:36:03.000Z | 2019-01-18T04:48:24.000Z | tests/test_create_container.py | movermeyer/pyspaces | 45c1dba6b8ca467d7617399c8d8b7bdb7370808b | [
"MIT"
] | 19 | 2015-04-26T21:16:18.000Z | 2021-10-04T17:16:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import pytest
import subprocess as s
from pyspaces import Container, Chroot, Inject, setns
def execute(argv):
"""Execute programm with arguments.
Args:
*args (list): arguments
"""
os.execvp(argv[0], argv)
def test_basic_container(capfd... | 26.31875 | 78 | 0.523391 |
import os
import pytest
import subprocess as s
from pyspaces import Container, Chroot, Inject, setns
def execute(argv):
os.execvp(argv[0], argv)
def test_basic_container(capfd):
cmd = "mount -t proc proc /proc; ps ax"
c = Container(target=execute, args=(('bash', '-c', cmd),),
uid_map=... | true | true |
1c41252554682224e52be6851d2b0268886f09a3 | 2,173 | py | Python | core/migrations/0013_auto_20160315_0215.py | rafaelbantu/timtec | 86c51b7440a044704ed33c3e752a6cf6b15ceae3 | [
"BSD-3-Clause"
] | 21 | 2015-09-23T14:07:16.000Z | 2022-02-18T01:35:18.000Z | core/migrations/0013_auto_20160315_0215.py | rafaelbantu/timtec | 86c51b7440a044704ed33c3e752a6cf6b15ceae3 | [
"BSD-3-Clause"
] | 178 | 2016-05-10T16:16:19.000Z | 2021-12-15T20:21:21.000Z | core/migrations/0013_auto_20160315_0215.py | rafaelbantu/timtec | 86c51b7440a044704ed33c3e752a6cf6b15ceae3 | [
"BSD-3-Clause"
] | 18 | 2015-10-23T13:28:17.000Z | 2021-09-22T13:08:28.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import core.utils
import autoslug.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0012_auto_20160131_1643'),
]
operations = [
migrations.RemoveField(
... | 34.492063 | 147 | 0.605614 | from __future__ import unicode_literals
from django.db import migrations, models
import core.utils
import autoslug.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0012_auto_20160131_1643'),
]
operations = [
migrations.RemoveField(
model_name='ifcerti... | true | true |
1c4126afc86b80a33e7354acb5cc01326a0ae386 | 602 | py | Python | other/application/windowApp/test/main2.py | Ethan7102/FYP | c6560a0b95ad78d5e1a341ab2d93c063e10c6631 | [
"MIT"
] | null | null | null | other/application/windowApp/test/main2.py | Ethan7102/FYP | c6560a0b95ad78d5e1a341ab2d93c063e10c6631 | [
"MIT"
] | null | null | null | other/application/windowApp/test/main2.py | Ethan7102/FYP | c6560a0b95ad78d5e1a341ab2d93c063e10c6631 | [
"MIT"
] | 1 | 2021-01-23T07:59:57.000Z | 2021-01-23T07:59:57.000Z | import sys
import ui_main
from PyQt5 import QtWidgets
Ui_MainWindow = ui_main.Ui_MainWindow
class CoperQt(QtWidgets.QMainWindow,Ui_MainWindow):#创建一个Qt对象
def __init__(self):
QtWidgets.QMainWindow.__init__(self) # 创建主界面对象
Ui_MainWindow.__init__(self) # 主界面对象初始化
self.setupUi(self) # 配置主界面对... | 25.083333 | 60 | 0.679402 | import sys
import ui_main
from PyQt5 import QtWidgets
Ui_MainWindow = ui_main.Ui_MainWindow
class CoperQt(QtWidgets.QMainWindow,Ui_MainWindow): def __init__(self):
QtWidgets.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self)
if __name__ ==... | true | true |
1c4126b407a6f7cb32b4335eef5afef876dca360 | 3,962 | py | Python | creational/singleton.py | prateeksan/python-design-patterns | f9c6fc3501a5a2c8467980aaf1ba7a9839bf07cf | [
"MIT"
] | 61 | 2017-06-07T22:48:38.000Z | 2022-02-25T01:06:37.000Z | creational/singleton.py | smohant/python-design-patterns | f9c6fc3501a5a2c8467980aaf1ba7a9839bf07cf | [
"MIT"
] | 2 | 2017-06-25T21:08:58.000Z | 2021-04-20T00:41:49.000Z | creational/singleton.py | smohant/python-design-patterns | f9c6fc3501a5a2c8467980aaf1ba7a9839bf07cf | [
"MIT"
] | 12 | 2017-06-08T15:34:52.000Z | 2022-02-24T09:01:05.000Z | """ The Singleton Pattern
Notes:
While there are multiple ways to implement the Singleton pattern, the point of
the Singleton pattern is to expose only one object without the possiblity to
create multiple _instances of the object.
It is important to note that if your need for this design pattern can be met by
a simp... | 45.022727 | 94 | 0.711762 |
class Singleton:
class _Singleton:
def __init__(self, **kwargs):
for key, value in kwargs.iteritems():
setattr(self, key, value)
_instance = None
def __init__(self, **kwargs):
if not Singleton._instance:
Singleton._instance =... | true | true |
1c41271be1b5aa6a3435445a84975d388d71bf32 | 320 | py | Python | django_town/oauth2/grant/sessiongrant.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | django_town/oauth2/grant/sessiongrant.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | django_town/oauth2/grant/sessiongrant.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from .grant import Grant
from ..endpoint import TokenEndpoint
class SessionGrant(Grant):
def get_credential(self, expires_in):
self._token_endpoint = TokenEndpoint(self._server, self._request, self._client)
return self._token_endpoint.get_credential_session(expires_in)
| 29.090909 | 87 | 0.740625 |
from .grant import Grant
from ..endpoint import TokenEndpoint
class SessionGrant(Grant):
def get_credential(self, expires_in):
self._token_endpoint = TokenEndpoint(self._server, self._request, self._client)
return self._token_endpoint.get_credential_session(expires_in)
| true | true |
1c41280faea7ed4db16a0e0b319e02226e95b412 | 2,089 | py | Python | visualize/usecases/get_user_commits.py | RevanthRyo/Alize | 60f4153c0c4b665e60c02bc90f99f833bf3173c8 | [
"Unlicense"
] | 160 | 2018-05-08T09:12:35.000Z | 2021-11-08T14:45:18.000Z | visualize/usecases/get_user_commits.py | RevanthRyo/Alize | 60f4153c0c4b665e60c02bc90f99f833bf3173c8 | [
"Unlicense"
] | 15 | 2018-05-08T09:13:53.000Z | 2022-03-11T23:20:39.000Z | visualize/usecases/get_user_commits.py | RevanthRyo/Alize | 60f4153c0c4b665e60c02bc90f99f833bf3173c8 | [
"Unlicense"
] | 12 | 2018-05-08T16:19:11.000Z | 2021-11-08T14:45:58.000Z | import json
import requests
from visualize.utils.api import Client
from visualize.usecases.generate_wordcloud import GenerateWordCloud
class GetUserCommits():
"""docstring for GetUserCommits"""
def __init__(self, repo_info):
self.repo_names = repo_info
self.result = {"total_commits": 0, "last_5_commits": [], "... | 34.245902 | 112 | 0.702729 | import json
import requests
from visualize.utils.api import Client
from visualize.usecases.generate_wordcloud import GenerateWordCloud
class GetUserCommits():
def __init__(self, repo_info):
self.repo_names = repo_info
self.result = {"total_commits": 0, "last_5_commits": [], "all_commits": []}
def count_user_c... | true | true |
1c4128b52113ded399b48959f457c867d2698b26 | 9,739 | py | Python | utils/clustering.py | autobotasia/autoface | 8283a089c824acc62640899864111cf6962cb692 | [
"MIT"
] | 1 | 2020-01-02T06:53:32.000Z | 2020-01-02T06:53:32.000Z | utils/clustering.py | autobotasia/autoface | 8283a089c824acc62640899864111cf6962cb692 | [
"MIT"
] | 7 | 2020-01-02T12:44:03.000Z | 2021-06-10T20:19:20.000Z | utils/clustering.py | autobotasia/autoface | 8283a089c824acc62640899864111cf6962cb692 | [
"MIT"
] | 3 | 2020-01-22T09:38:19.000Z | 2020-08-12T23:59:27.000Z | """ Face Cluster """
import tensorflow as tf
import numpy as np
import importlib
import argparse
import facenet
import os
import math
def face_distance(face_encodings, face_to_compare):
"""
Given a list of face encodings, compare them to a known face encoding and get a euclidean distance
for each comparison... | 36.339552 | 126 | 0.645652 | import tensorflow as tf
import numpy as np
import importlib
import argparse
import facenet
import os
import math
def face_distance(face_encodings, face_to_compare):
import numpy as np
if len(face_encodings) == 0:
return np.empty((0))
return np.sum(face_encodings*face_to_compare,axis=1)
def loa... | true | true |
1c41298b6c44587b3d02dcadff97e0acc59d5515 | 1,045 | py | Python | venv/Scripts/static-script.py | thiagofreitascarneiro/Projeto_Fusion | 4bf9d1c69ddf83fbc957e9ccdc41112d71bbffa9 | [
"MIT"
] | null | null | null | venv/Scripts/static-script.py | thiagofreitascarneiro/Projeto_Fusion | 4bf9d1c69ddf83fbc957e9ccdc41112d71bbffa9 | [
"MIT"
] | null | null | null | venv/Scripts/static-script.py | thiagofreitascarneiro/Projeto_Fusion | 4bf9d1c69ddf83fbc957e9ccdc41112d71bbffa9 | [
"MIT"
] | null | null | null | #!c:\users\thiago\pycharmprojects\pythonproject1\pythonproject\pythonproject\fusion\venv\scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'static3==0.7.0','console_scripts','static'
import re
import sys
# for compatibility with easy_install; see #2198
__requires__ = 'static3==0.7.0'
try:
from importlib.metadata im... | 30.735294 | 107 | 0.713876 | import re
import sys
__requires__ = 'static3==0.7.0'
try:
from importlib.metadata import distribution
except ImportError:
try:
from importlib_metadata import distribution
except ImportError:
from pkg_resources import load_entry_point
def importlib_load_entry_point(spec, group, name):
... | true | true |
1c412ab71ef0761b26af363087dbd1a8f623c110 | 245 | py | Python | core/colors/__init__.py | TusharAMD/astar | df3911b6f7ce765dc9964ce8feaf26d3195fe8fc | [
"Apache-2.0"
] | 14 | 2020-01-13T13:20:43.000Z | 2020-04-16T00:03:59.000Z | core/colors/__init__.py | TusharAMD/astar | df3911b6f7ce765dc9964ce8feaf26d3195fe8fc | [
"Apache-2.0"
] | 1 | 2020-08-06T03:17:30.000Z | 2020-08-06T03:17:30.000Z | core/colors/__init__.py | mHaisham/sortvis | 91d56acbdd575c129fc88e5ae54aaf5caae55eb0 | [
"Apache-2.0"
] | 1 | 2020-01-13T14:02:44.000Z | 2020-01-13T14:02:44.000Z | from .color import Color
TRANSPARENT = Color(255, 255, 255, 0)
WHITE = Color(255, 255, 255)
BLACK = Color(0, 0, 0)
RED = Color(255, 0, 0)
GREEN = Color(0, 255, 0)
BLUE = Color(0, 0, 255)
YELLOW = Color(255, 255, 0)
PURPLE = Color(255, 0, 255) | 20.416667 | 37 | 0.636735 | from .color import Color
TRANSPARENT = Color(255, 255, 255, 0)
WHITE = Color(255, 255, 255)
BLACK = Color(0, 0, 0)
RED = Color(255, 0, 0)
GREEN = Color(0, 255, 0)
BLUE = Color(0, 0, 255)
YELLOW = Color(255, 255, 0)
PURPLE = Color(255, 0, 255) | true | true |
1c412b8e6df6f6e57732bfcd32cf011a354ffa83 | 1,859 | py | Python | pylgbst/comms/cpygatt.py | karatheodory/pylgbst | 2aa82a818623fe8ecb8a6fc1c6ae083e56debd19 | [
"MIT"
] | 1 | 2021-04-04T13:31:28.000Z | 2021-04-04T13:31:28.000Z | pylgbst/comms/cpygatt.py | karatheodory/pylgbst | 2aa82a818623fe8ecb8a6fc1c6ae083e56debd19 | [
"MIT"
] | null | null | null | pylgbst/comms/cpygatt.py | karatheodory/pylgbst | 2aa82a818623fe8ecb8a6fc1c6ae083e56debd19 | [
"MIT"
] | null | null | null | import logging
import pygatt
from pylgbst.comms import Connection, LEGO_MOVE_HUB
from pylgbst.constants import MOVE_HUB_HW_UUID_CHAR
from pylgbst.utilities import str2hex
log = logging.getLogger('comms-pygatt')
class GattoolConnection(Connection):
"""
Used for connecting to
:type _conn_hnd: pygatt.bac... | 28.6 | 78 | 0.631522 | import logging
import pygatt
from pylgbst.comms import Connection, LEGO_MOVE_HUB
from pylgbst.constants import MOVE_HUB_HW_UUID_CHAR
from pylgbst.utilities import str2hex
log = logging.getLogger('comms-pygatt')
class GattoolConnection(Connection):
def __init__(self, controller='hci0'):
Connection.__in... | true | true |
1c412ca1b9324bd4078b3f7938eaa783f06f5cac | 2,879 | py | Python | qanet/data.py | convergence-lab/QANet | 5bffd105950304455245dfcfea9663d6c892aeca | [
"Apache-2.0"
] | null | null | null | qanet/data.py | convergence-lab/QANet | 5bffd105950304455245dfcfea9663d6c892aeca | [
"Apache-2.0"
] | null | null | null | qanet/data.py | convergence-lab/QANet | 5bffd105950304455245dfcfea9663d6c892aeca | [
"Apache-2.0"
] | null | null | null | import os
import json
import numpy as np
import urllib.request
import zipfile
import spacy
data_dir = "data"
class SQuAD:
def __init__(self):
self.maybedownload()
with open(os.path.join(data_dir, 'train-v1.1.json')) as f:
self.train = json.load(f)
with open(os.path.join(data_di... | 37.38961 | 115 | 0.551928 | import os
import json
import numpy as np
import urllib.request
import zipfile
import spacy
data_dir = "data"
class SQuAD:
def __init__(self):
self.maybedownload()
with open(os.path.join(data_dir, 'train-v1.1.json')) as f:
self.train = json.load(f)
with open(os.path.join(data_di... | true | true |
1c412cdbba998677e1843b149ab62ebeb5dd0324 | 554 | py | Python | people/migrations/0006_auto_20190701_2335.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 1 | 2019-05-06T19:40:43.000Z | 2019-05-06T19:40:43.000Z | people/migrations/0006_auto_20190701_2335.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 9 | 2019-12-04T22:57:46.000Z | 2022-02-10T07:15:11.000Z | people/migrations/0006_auto_20190701_2335.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 3 | 2019-05-01T20:41:33.000Z | 2019-10-03T20:57:00.000Z | # Generated by Django 2.2.1 on 2019-07-01 23:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0005_healthcenter'),
]
operations = [
migrations.AddField(
model_name='mother',
name='dueMonth',
... | 23.083333 | 62 | 0.574007 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0005_healthcenter'),
]
operations = [
migrations.AddField(
model_name='mother',
name='dueMonth',
field=models.CharField(blank=True, max_length... | true | true |
1c412d7d5d86f9b4652e5ca074ac4b3f6637bab5 | 4,216 | py | Python | tests/custom_cluster/test_delegation.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 1 | 2019-12-14T03:09:50.000Z | 2019-12-14T03:09:50.000Z | tests/custom_cluster/test_delegation.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | null | null | null | tests/custom_cluster/test_delegation.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 1 | 2020-04-02T18:25:34.000Z | 2020-04-02T18:25:34.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 49.6 | 90 | 0.775854 | import getpass
import pytest
from tests.hs2.hs2_test_suite import HS2TestSuite, needs_session
from TCLIService import TCLIService
from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
USER_NAME = getpass.getuser()
PROXY_USER = "proxy_user_name"
PROXY_USER_WITH_COMMA = "proxy_user,name_2"
PROXY_USER... | true | true |
1c412e7b4c9fb7c412161fce8a832ca334bba45a | 3,586 | py | Python | app/recipe/views.py | KmrAbhi/recipe-app-api | 9c6871c80a0479a95727a354c694179b5164629b | [
"MIT"
] | null | null | null | app/recipe/views.py | KmrAbhi/recipe-app-api | 9c6871c80a0479a95727a354c694179b5164629b | [
"MIT"
] | null | null | null | app/recipe/views.py | KmrAbhi/recipe-app-api | 9c6871c80a0479a95727a354c694179b5164629b | [
"MIT"
] | null | null | null | from rest_framework import viewsets, mixins, status
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | 35.156863 | 97 | 0.672895 | from rest_framework import viewsets, mixins, status
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | true | true |
1c412eb3a1a14c12d83589821c785a0b8b73ec5d | 207 | py | Python | django_town/social/define/__init__.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | django_town/social/define/__init__.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | django_town/social/define/__init__.py | uptown/django-town | 4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50 | [
"MIT"
] | null | null | null | __author__ = 'uptown'
from django_town.social.define.place_categories import *
from django_town.social.define.privacy_options import PRIVACY_OPTIONS
from django_town.social.define.page_role import PAGE_ROLE | 41.4 | 69 | 0.864734 | __author__ = 'uptown'
from django_town.social.define.place_categories import *
from django_town.social.define.privacy_options import PRIVACY_OPTIONS
from django_town.social.define.page_role import PAGE_ROLE | true | true |
1c412f4130ff5f913dace2ba173b9fc3ee9e201a | 24,090 | py | Python | lib/googlecloudsdk/calliope/arg_parsers.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/calliope/arg_parsers.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/calliope/arg_parsers.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:23:41.000Z | 2020-07-25T12:23:41.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.379032 | 80 | 0.653881 |
import argparse
import datetime
import re
from googlecloudsdk.core import log
__all__ = ['Duration', 'BinarySize']
class Error(Exception):
class ArgumentTypeError(Error, argparse.ArgumentTypeError):
class ArgumentParsingError(Error, argparse.ArgumentError):
def _GenerateErrorMessage(error, user_input=None,... | true | true |
1c412fe8b1e7524b8e1d7e68275835296f537de6 | 850 | py | Python | 04-trees-graphs/Queue.py | harrisonlingren/ctci-solutions | 75e162c1df695ffda645837a45d9f16e8363ff1b | [
"MIT"
] | null | null | null | 04-trees-graphs/Queue.py | harrisonlingren/ctci-solutions | 75e162c1df695ffda645837a45d9f16e8363ff1b | [
"MIT"
] | null | null | null | 04-trees-graphs/Queue.py | harrisonlingren/ctci-solutions | 75e162c1df695ffda645837a45d9f16e8363ff1b | [
"MIT"
] | null | null | null | class Queue(object):
def __init__(self):
self.first = None
self.last = None
self.size = 0
def __len__(self):
return self.size
def dequeue(self):
if self.first is None:
return None
old = self.first.data
self.first = self.first.next
... | 21.25 | 36 | 0.522353 | class Queue(object):
def __init__(self):
self.first = None
self.last = None
self.size = 0
def __len__(self):
return self.size
def dequeue(self):
if self.first is None:
return None
old = self.first.data
self.first = self.first.next
... | true | true |
1c413034a6e1650ac70498f32bb3a99fc861a9fb | 1,352 | py | Python | test.py | jfk1408/msbase.py | 767dd1cb75db3a4d2a414afbff5a72c679a8c808 | [
"MIT"
] | null | null | null | test.py | jfk1408/msbase.py | 767dd1cb75db3a4d2a414afbff5a72c679a8c808 | [
"MIT"
] | null | null | null | test.py | jfk1408/msbase.py | 767dd1cb75db3a4d2a414afbff5a72c679a8c808 | [
"MIT"
] | null | null | null | import msbase.argparse_ as argparse
p = argparse.p()
p.add_argument('integers', type=int, help='just some integers')
args = p.parse_args()
print(args.integers)
from msbase.assert_ import *
assert_eq(1, 1)
assert_le(1, 2, "1 > 2")
from msbase.subprocess_ import *
print(call_std(["ls", "unknown"]))
ret = try_call_st... | 23.719298 | 69 | 0.636095 | import msbase.argparse_ as argparse
p = argparse.p()
p.add_argument('integers', type=int, help='just some integers')
args = p.parse_args()
print(args.integers)
from msbase.assert_ import *
assert_eq(1, 1)
assert_le(1, 2, "1 > 2")
from msbase.subprocess_ import *
print(call_std(["ls", "unknown"]))
ret = try_call_st... | true | true |
1c4130a0ae7641bcd89722bccc6d8e09db11decd | 3,836 | py | Python | nvtabular/loader/torch.py | miguelusque/NVTabular | e58d318a64d8c1607e91c10b9b5d4a8b48bcab69 | [
"Apache-2.0"
] | null | null | null | nvtabular/loader/torch.py | miguelusque/NVTabular | e58d318a64d8c1607e91c10b9b5d4a8b48bcab69 | [
"Apache-2.0"
] | null | null | null | nvtabular/loader/torch.py | miguelusque/NVTabular | e58d318a64d8c1607e91c10b9b5d4a8b48bcab69 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 29.507692 | 99 | 0.63634 | import pandas as pd
import torch
from torch.utils.dlpack import from_dlpack
from .backend import DataLoader
class IterDL(torch.utils.data.IterableDataset):
def __init__(self, file_paths, batch_size=1, shuffle=False):
self.file_paths = file_paths
self.batch_size = batch_size
self.shuffle =... | true | true |
1c4130b0703a812ab59230e680f4142947d9957a | 1,827 | py | Python | tests/functional/test_skip_unless_on_aarch64.py | bdrung/pytest-skip-markers | 69b9be27b1969a7b59666afefcb63bf1fdf66b31 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_skip_unless_on_aarch64.py | bdrung/pytest-skip-markers | 69b9be27b1969a7b59666afefcb63bf1fdf66b31 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_skip_unless_on_aarch64.py | bdrung/pytest-skip-markers | 69b9be27b1969a7b59666afefcb63bf1fdf66b31 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021-2022 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""
Test the ``@pytest.mark.skip_unless_on_aarch64`` marker.
"""
import sys
from unittest import mock
import pytest
pytestmark = [
pytest.mark.skipif(
sys.platform.startswith("win")
and sys.version_info >= (3, 8)
an... | 26.867647 | 110 | 0.648057 | import sys
from unittest import mock
import pytest
pytestmark = [
pytest.mark.skipif(
sys.platform.startswith("win")
and sys.version_info >= (3, 8)
and sys.version_info < (3, 10),
reason="PyTest's capture and pytester.runpytest_inprocess looks broken on Windows and Py(>3.8,<3.10)",... | true | true |
1c4130e0617182aa9a164573ce43128ca6cc58b9 | 1,656 | py | Python | gitfs/utils/path.py | whywaita/gitfs | cf92acc1fdb0bf93d5998f223d9ef7b285bd74b1 | [
"Apache-2.0"
] | 921 | 2018-03-27T16:26:14.000Z | 2022-03-31T12:39:34.000Z | gitfs/utils/path.py | whywaita/gitfs | cf92acc1fdb0bf93d5998f223d9ef7b285bd74b1 | [
"Apache-2.0"
] | 104 | 2015-01-20T21:31:25.000Z | 2018-02-21T21:14:21.000Z | gitfs/utils/path.py | whywaita/gitfs | cf92acc1fdb0bf93d5998f223d9ef7b285bd74b1 | [
"Apache-2.0"
] | 90 | 2015-01-05T12:59:11.000Z | 2018-03-25T15:16:34.000Z | # Copyright 2014-2016 Presslabs SRL
#
# 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 wri... | 28.551724 | 77 | 0.658816 |
import os
from collections import deque
def split_path_into_components(path):
head, tail = os.path.split(path)
if not tail:
return []
components = deque()
components.appendleft(tail)
path = head
while path and path != "/":
head, tail = os.path.split(path)
componen... | true | true |
1c4131053e347277fe9bbd48b407e1d6d4d7a94a | 3,833 | py | Python | pyvisdk/mo/host_local_account_manager.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/mo/host_local_account_manager.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/mo/host_local_account_manager.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class HostLocalAccountManager(... | 38.717172 | 99 | 0.665014 |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
log = logging.getLogger(__name__)
class HostLocalAccountManager(BaseEntity):
def __init__(self, core, name=None, ref=None, type=ManagedObjectTypes.HostLocalAccountManager):
... | true | true |
1c4132b65e5ec999b893c5bd01767981dc243825 | 113 | py | Python | tests/grimlock/test_commands.py | rabstejnek/grimlock | 37cc927f2a727c019b113c48ce29dba24750c247 | [
"MIT"
] | null | null | null | tests/grimlock/test_commands.py | rabstejnek/grimlock | 37cc927f2a727c019b113c48ce29dba24750c247 | [
"MIT"
] | null | null | null | tests/grimlock/test_commands.py | rabstejnek/grimlock | 37cc927f2a727c019b113c48ce29dba24750c247 | [
"MIT"
] | null | null | null | from grimlock import commands
def test_hello_world():
assert commands.hello_world(None) == "Hello, World!"
| 18.833333 | 56 | 0.743363 | from grimlock import commands
def test_hello_world():
assert commands.hello_world(None) == "Hello, World!"
| true | true |
1c4132f1f619f17a9ea81acaaf18acfda97370ae | 2,138 | py | Python | tests/test_CLOCer.py | Niweera/CLOCer | 23a136a1190fef2f5d72b64913823504cb1d0f56 | [
"MIT"
] | 5 | 2022-01-20T18:40:34.000Z | 2022-01-26T01:37:31.000Z | tests/test_CLOCer.py | Niweera/CLOCer | 23a136a1190fef2f5d72b64913823504cb1d0f56 | [
"MIT"
] | 1 | 2022-02-19T05:12:30.000Z | 2022-02-19T05:12:30.000Z | tests/test_CLOCer.py | Niweera/CLOCer | 23a136a1190fef2f5d72b64913823504cb1d0f56 | [
"MIT"
] | null | null | null | import subprocess
from unittest import TestCase
from clocer.CLOCer import CLOCer
import json
from os.path import exists, abspath, join, dirname, realpath
from unittest.mock import patch, Mock
from clocer.Configure import Configure
from clocer.CustomExceptions import CLOCerError, ConfigureError
class TestCLOCer(TestC... | 30.542857 | 85 | 0.596819 | import subprocess
from unittest import TestCase
from clocer.CLOCer import CLOCer
import json
from os.path import exists, abspath, join, dirname, realpath
from unittest.mock import patch, Mock
from clocer.Configure import Configure
from clocer.CustomExceptions import CLOCerError, ConfigureError
class TestCLOCer(TestC... | true | true |
1c41330bf1c92a6991a25f262dc16d768a487ef6 | 610 | py | Python | tests/test_draft_combine.py | jtpavlock/nba_stats | ee63e5e0cca412c95805c99bea51e2b5685324ff | [
"BSD-3-Clause"
] | 12 | 2020-01-06T23:46:58.000Z | 2021-04-28T15:52:18.000Z | tests/test_draft_combine.py | jtpavlock/nba_stats | ee63e5e0cca412c95805c99bea51e2b5685324ff | [
"BSD-3-Clause"
] | 4 | 2019-12-22T14:09:30.000Z | 2021-07-01T00:46:32.000Z | tests/test_draft_combine.py | jtpavlock/nba_stats | ee63e5e0cca412c95805c99bea51e2b5685324ff | [
"BSD-3-Clause"
] | 2 | 2020-07-18T09:27:55.000Z | 2022-03-05T16:44:45.000Z | """Test draft_combine module and included endpoints.
We won't mock any api calls just to make sure they haven't changed on us.
"""
from nbapy import draft_combine
class TestSummary:
@staticmethod
def test_stats():
stats = draft_combine.Summary().stats()
assert stats is not None
class TestDr... | 22.592593 | 73 | 0.688525 | from nbapy import draft_combine
class TestSummary:
@staticmethod
def test_stats():
stats = draft_combine.Summary().stats()
assert stats is not None
class TestDrillResults:
@staticmethod
def test_stats():
stats = draft_combine.DrillResults().stats()
assert stats is not... | true | true |
1c41336f0439ff91a396bffaaf5e24e3dbe7f124 | 383 | py | Python | trade/migrations/0004_item_verified.py | dc74089/oneshirt | 437941bf29e41098df3eb3cde2370ea29c897969 | [
"Apache-2.0"
] | null | null | null | trade/migrations/0004_item_verified.py | dc74089/oneshirt | 437941bf29e41098df3eb3cde2370ea29c897969 | [
"Apache-2.0"
] | 6 | 2018-03-06T18:07:08.000Z | 2018-12-27T22:54:12.000Z | trade/migrations/0004_item_verified.py | dc74089/oneshirt | 437941bf29e41098df3eb3cde2370ea29c897969 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0 on 2018-02-28 16:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trade', '0003_auto_20180223_1712'),
]
operations = [
migrations.AddField(
model_name='item',
name='verified',
... | 20.157895 | 53 | 0.597911 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trade', '0003_auto_20180223_1712'),
]
operations = [
migrations.AddField(
model_name='item',
name='verified',
field=models.BooleanField(default=False),
... | true | true |
1c41364d26b6a4490d48a78f375930da474b7cd3 | 736 | py | Python | Links.py | HuzefaUsama25/IntenseResearcher | 26d25384f62d29dc8b4231a075c94b8667ea1d73 | [
"MIT"
] | 1 | 2021-08-12T11:00:19.000Z | 2021-08-12T11:00:19.000Z | Links.py | HuzefaUsama25/IntenseResearcher | 26d25384f62d29dc8b4231a075c94b8667ea1d73 | [
"MIT"
] | null | null | null | Links.py | HuzefaUsama25/IntenseResearcher | 26d25384f62d29dc8b4231a075c94b8667ea1d73 | [
"MIT"
] | null | null | null | import bs4
import requests
import sys
import os
import re
import unicodedata
url = input("Search for: ")
filename = "links"
filename=r"D:\Huzefa\Desktop\The Big Researcher\\" +filename+ ".txt"
url = "https://search.yahoo.com/search?p="+url+"&n=100"
res = requests.get(url)
soup = bs4.BeautifulSoup(res.te... | 28.307692 | 114 | 0.616848 | import bs4
import requests
import sys
import os
import re
import unicodedata
url = input("Search for: ")
filename = "links"
filename=r"D:\Huzefa\Desktop\The Big Researcher\\" +filename+ ".txt"
url = "https://search.yahoo.com/search?p="+url+"&n=100"
res = requests.get(url)
soup = bs4.BeautifulSoup(res.te... | true | true |
1c4136e5d43993b9aa877f3775580eb7b794667f | 6,569 | py | Python | mmdet/datasets/utils.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/utils.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/utils.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import warnings
from mmcv.cnn import VGG
from mmcv.runner.hooks import HOOKS, Hook
from mmdet.datasets.builder import PIPELINES
from mmdet.datasets.pipelines import LoadAnnotations, LoadImageFromFile
from mmdet.models.dense_heads import GARPNHead, RPNHead, R... | 39.812121 | 96 | 0.558228 | import copy
import warnings
from mmcv.cnn import VGG
from mmcv.runner.hooks import HOOKS, Hook
from mmdet.datasets.builder import PIPELINES
from mmdet.datasets.pipelines import LoadAnnotations, LoadImageFromFile
from mmdet.models.dense_heads import GARPNHead, RPNHead, RankBasedRPNHead
from mmdet.models.roi_heads.mask... | true | true |
1c4136fdc0121d826916494d39f576e839dcc318 | 58 | py | Python | background_task/models.py | mayudong07/django-background-tasks | 1288d6385ccfd53cee1e9d280aa489b68002277b | [
"BSD-3-Clause"
] | null | null | null | background_task/models.py | mayudong07/django-background-tasks | 1288d6385ccfd53cee1e9d280aa489b68002277b | [
"BSD-3-Clause"
] | null | null | null | background_task/models.py | mayudong07/django-background-tasks | 1288d6385ccfd53cee1e9d280aa489b68002277b | [
"BSD-3-Clause"
] | null | null | null | from .base_models import *
from .models_completed import * | 29 | 31 | 0.810345 | from .base_models import *
from .models_completed import * | true | true |
1c413753c52ffb67a379592a8901e302efcba41f | 8,169 | py | Python | aincrad/views.py | ankanb240/otis-web | 45eda65b419705c65c02b15872a137969d53d8e9 | [
"MIT"
] | null | null | null | aincrad/views.py | ankanb240/otis-web | 45eda65b419705c65c02b15872a137969d53d8e9 | [
"MIT"
] | null | null | null | aincrad/views.py | ankanb240/otis-web | 45eda65b419705c65c02b15872a137969d53d8e9 | [
"MIT"
] | null | null | null | from hashlib import sha256
from typing import Any, Dict
from allauth.socialaccount.models import SocialAccount
from arch.models import Hint, Problem
from core.models import Unit
from dashboard.models import ProblemSuggestion, PSet
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
... | 32.416667 | 91 | 0.68613 | from hashlib import sha256
from typing import Any, Dict
from allauth.socialaccount.models import SocialAccount
from arch.models import Hint, Problem
from core.models import Unit
from dashboard.models import ProblemSuggestion, PSet
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.