hexsha
stringlengths
40
40
size
int64
4
996k
ext
stringclasses
8 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
4
996k
avg_line_length
float64
1.33
58.2k
max_line_length
int64
2
323k
alphanum_fraction
float64
0
0.97
content_no_comment
stringlengths
0
946k
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
79054b38a3d510ea8635524228aef924775d9f25
3,057
py
Python
tests/logictest/http_runner.py
LiuYuHui/databend
87ad8f1233eee079175dd06a0143ebaa66d5f6d4
[ "Apache-2.0" ]
null
null
null
tests/logictest/http_runner.py
LiuYuHui/databend
87ad8f1233eee079175dd06a0143ebaa66d5f6d4
[ "Apache-2.0" ]
null
null
null
tests/logictest/http_runner.py
LiuYuHui/databend
87ad8f1233eee079175dd06a0143ebaa66d5f6d4
[ "Apache-2.0" ]
null
null
null
from abc import ABC from types import NoneType import logictest import http_connector from log import log class TestHttp(logictest.SuiteRunner, ABC): def __init__(self, kind, pattern): super().__init__(kind, pattern) self._http = None def get_connection(self): if self._http is None:...
39.192308
93
0.499836
from abc import ABC from types import NoneType import logictest import http_connector from log import log class TestHttp(logictest.SuiteRunner, ABC): def __init__(self, kind, pattern): super().__init__(kind, pattern) self._http = None def get_connection(self): if self._http is None:...
true
true
79054b71c4a1bf5b14634dfdc74224ffed211aa3
1,779
py
Python
WeatherDashboardCW.py
kuzned/rpi_weather
6e4102e0fd73d88f2bec01e0252919a05106767e
[ "MIT" ]
null
null
null
WeatherDashboardCW.py
kuzned/rpi_weather
6e4102e0fd73d88f2bec01e0252919a05106767e
[ "MIT" ]
null
null
null
WeatherDashboardCW.py
kuzned/rpi_weather
6e4102e0fd73d88f2bec01e0252919a05106767e
[ "MIT" ]
null
null
null
from gpiozero import Servo from gpiozero import LED from time import sleep from WeatherDataCW import WeatherData class WeatherDashboard: servo_pin = 17 led_pin = 14 servoCorrection=0.5 maxPW=(2.0+servoCorrection)/1000 minPW=(1.0-servoCorrection)/1000 def __init__(self, servo_position=...
30.672414
98
0.649241
from gpiozero import Servo from gpiozero import LED from time import sleep from WeatherDataCW import WeatherData class WeatherDashboard: servo_pin = 17 led_pin = 14 servoCorrection=0.5 maxPW=(2.0+servoCorrection)/1000 minPW=(1.0-servoCorrection)/1000 def __init__(self, servo_position=...
true
true
79054c2d4fec67af7bb797077ea3cddc2bd2c334
15,469
py
Python
tests/integ/test_auto_ml.py
bstriner/sagemaker-python-sdk
cc98dd057ccd4a38d9a0e44de05e2b38fc8f9526
[ "Apache-2.0" ]
1
2020-09-16T12:18:03.000Z
2020-09-16T12:18:03.000Z
tests/integ/test_auto_ml.py
bstriner/sagemaker-python-sdk
cc98dd057ccd4a38d9a0e44de05e2b38fc8f9526
[ "Apache-2.0" ]
null
null
null
tests/integ/test_auto_ml.py
bstriner/sagemaker-python-sdk
cc98dd057ccd4a38d9a0e44de05e2b38fc8f9526
[ "Apache-2.0" ]
null
null
null
# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
38.866834
107
0.739156
from __future__ import absolute_import import os import pytest import tests.integ from sagemaker import AutoML, CandidateEstimator, AutoMLInput from botocore.exceptions import ClientError from sagemaker.utils import unique_name_from_base from tests.integ import DATA_DIR, AUTO_ML_DEFAULT_TIMEMOUT_MINUTES,...
true
true
79054c3ceaa1df22b14cc922282eeb246d615aa6
9,405
py
Python
sdk/python/pulumi_aws/s3/analytics_configuration.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/s3/analytics_configuration.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/s3/analytics_configuration.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 Union from .. import utilities, tables class AnalyticsConfigur...
51.11413
165
0.645933
import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class AnalyticsConfiguration(pulumi.CustomResource): bucket: pulumi.Output[str] filter: pulumi.Output[dict] name: pulumi.Output[str] storage_class_analysis: pulumi.Output[dict] def __i...
true
true
79054c7e3af2a9f01df54f5e119515bb0908e283
627
py
Python
institution/migrations/0017_auto_20180906_1349.py
mmesiti/cogs3
c48cd48629570f418b93aec73de49bc2fb59edc2
[ "MIT" ]
null
null
null
institution/migrations/0017_auto_20180906_1349.py
mmesiti/cogs3
c48cd48629570f418b93aec73de49bc2fb59edc2
[ "MIT" ]
9
2019-08-01T09:50:34.000Z
2019-08-14T16:24:31.000Z
institution/migrations/0017_auto_20180906_1349.py
mmesiti/cogs3
c48cd48629570f418b93aec73de49bc2fb59edc2
[ "MIT" ]
null
null
null
# Generated by Django 2.0.2 on 2018-09-06 13:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('institution', '0016_institution_funding_document_email'), ] operations = [ migrations.AddField( model_name='institution', ...
26.125
67
0.623604
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('institution', '0016_institution_funding_document_email'), ] operations = [ migrations.AddField( model_name='institution', name='funding_document_receiver', ...
true
true
79054d417a1b3f0beba404cdee72f6a85ccd0081
8,929
py
Python
changedetectionio/tests/test_notification.py
Pritam-Patra/changedetection.io
eeba8c864d8375775ac04720856e537036ca643e
[ "Apache-2.0" ]
1
2022-01-21T06:25:24.000Z
2022-01-21T06:25:24.000Z
changedetectionio/tests/test_notification.py
Pritam-Patra/changedetection.io
eeba8c864d8375775ac04720856e537036ca643e
[ "Apache-2.0" ]
null
null
null
changedetectionio/tests/test_notification.py
Pritam-Patra/changedetection.io
eeba8c864d8375775ac04720856e537036ca643e
[ "Apache-2.0" ]
null
null
null
import os import time import re from flask import url_for from . util import set_original_response, set_modified_response, live_server_setup import logging from changedetectionio.notification import default_notification_body, default_notification_title # Hard to just add more live server URLs when one test is already ...
38.991266
121
0.634786
import os import time import re from flask import url_for from . util import set_original_response, set_modified_response, live_server_setup import logging from changedetectionio.notification import default_notification_body, default_notification_title def test_check_notification(client, live_server): live_serv...
true
true
79054d8f0181b9529f319719809883d247168857
1,732
py
Python
kachery/_temporarydirectory.py
flatironinstitute/kachery
d1076f6e8e2df26d3440fdb89f366ec44a502b9b
[ "Apache-2.0" ]
8
2020-03-05T19:41:03.000Z
2021-11-19T04:40:10.000Z
kachery/_temporarydirectory.py
flatironinstitute/kachery
d1076f6e8e2df26d3440fdb89f366ec44a502b9b
[ "Apache-2.0" ]
8
2019-11-15T03:40:07.000Z
2020-09-08T22:14:07.000Z
kachery/_temporarydirectory.py
flatironinstitute/kachery
d1076f6e8e2df26d3440fdb89f366ec44a502b9b
[ "Apache-2.0" ]
2
2020-08-06T19:56:12.000Z
2021-09-23T01:05:24.000Z
import os import shutil import tempfile import time class TemporaryDirectory(): def __init__(self, remove: bool=True, prefix: str='tmp'): self._remove = remove self._prefix = prefix def __enter__(self) -> str: if 'KACHERY_STORAGE_DIR' in os.environ: storage_dir = os.getenv...
33.307692
109
0.586028
import os import shutil import tempfile import time class TemporaryDirectory(): def __init__(self, remove: bool=True, prefix: str='tmp'): self._remove = remove self._prefix = prefix def __enter__(self) -> str: if 'KACHERY_STORAGE_DIR' in os.environ: storage_dir = os.getenv...
true
true
79054e2c58d5213eaf729dd2add06483f2c10192
16,145
py
Python
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/spbnetworkrange_525415b0593fd4072368412490b137fa.py
Vibaswan/ixnetwork_restpy
239fedc7050890746cbabd71ea1e91c68d9e5cad
[ "MIT" ]
null
null
null
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/spbnetworkrange_525415b0593fd4072368412490b137fa.py
Vibaswan/ixnetwork_restpy
239fedc7050890746cbabd71ea1e91c68d9e5cad
[ "MIT" ]
null
null
null
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/spbnetworkrange_525415b0593fd4072368412490b137fa.py
Vibaswan/ixnetwork_restpy
239fedc7050890746cbabd71ea1e91c68d9e5cad
[ "MIT" ]
null
null
null
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify,...
52.080645
266
0.698235
from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class SpbNetworkRange(Base): __slots__ = () _SDM_NAME = 'spbNetworkRange' _SDM_ATT_MAP = { 'EnableAdvertiseNetworkRange': 'enableAdvertiseNetworkRange', 'EnableHostName': 'enableHostName',...
true
true
79054e5faf9527e861973e04364d0957d65a1099
1,237
py
Python
g-code-testing/g_code_test_data/http/modules/magdeck.py
y3rsh/opentrons
b446567910db218030fef40396ab2255cc074bba
[ "Apache-2.0" ]
235
2017-10-27T20:37:27.000Z
2022-03-30T14:09:49.000Z
g-code-testing/g_code_test_data/http/modules/magdeck.py
y3rsh/opentrons
b446567910db218030fef40396ab2255cc074bba
[ "Apache-2.0" ]
8,425
2017-10-26T15:25:43.000Z
2022-03-31T23:54:26.000Z
g-code-testing/g_code_test_data/http/modules/magdeck.py
y3rsh/opentrons
b446567910db218030fef40396ab2255cc074bba
[ "Apache-2.0" ]
130
2017-11-09T21:02:37.000Z
2022-03-15T18:01:24.000Z
from functools import partial from g_code_test_data.http.http_settings import HTTP_SETTINGS from g_code_test_data.g_code_configuration import HTTPGCodeConfirmConfig from robot_server.service.legacy.routers.modules import post_serial_command from robot_server.service.legacy.models.modules import SerialCommand from opent...
29.452381
77
0.760711
from functools import partial from g_code_test_data.http.http_settings import HTTP_SETTINGS from g_code_test_data.g_code_configuration import HTTPGCodeConfirmConfig from robot_server.service.legacy.routers.modules import post_serial_command from robot_server.service.legacy.models.modules import SerialCommand from opent...
true
true
79054ecc4d68fd8489ac680e07dd052948e513d5
3,740
py
Python
django/basic_auth/example1/decorators.py
tullyrankin/python-frameworks
d4bccf6c537c26bc421afadc09b5c83c3c5a5f35
[ "MIT" ]
2
2016-08-15T07:05:40.000Z
2017-04-03T14:50:10.000Z
django/basic_auth/example1/decorators.py
tullyrankin/python-frameworks
d4bccf6c537c26bc421afadc09b5c83c3c5a5f35
[ "MIT" ]
null
null
null
django/basic_auth/example1/decorators.py
tullyrankin/python-frameworks
d4bccf6c537c26bc421afadc09b5c83c3c5a5f35
[ "MIT" ]
null
null
null
import base64 from django.http import HttpResponse from django.contrib.auth import authenticate, login # Reference: https://www.djangosnippets.org/snippets/243/ def view_or_basicauth(view, request, test_func, realm="", *args, **kwargs): """ This is a helper function used by both 'logged_in_or_basicauth' and...
37.4
79
0.649198
import base64 from django.http import HttpResponse from django.contrib.auth import authenticate, login def view_or_basicauth(view, request, test_func, realm="", *args, **kwargs): if test_func(request.user): return view(request, *args, **kwargs) if 'HTTP_AUTHORIZATION' in request.META...
true
true
79054f486c01712298f0bb79c509370968f8a559
4,124
py
Python
pydantic/validators.py
anentropic/pydantic
27887c6e997671ff0ea9d8f815e7628a40eb1134
[ "MIT" ]
null
null
null
pydantic/validators.py
anentropic/pydantic
27887c6e997671ff0ea9d8f815e7628a40eb1134
[ "MIT" ]
null
null
null
pydantic/validators.py
anentropic/pydantic
27887c6e997671ff0ea9d8f815e7628a40eb1134
[ "MIT" ]
null
null
null
from collections import OrderedDict from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum from pathlib import Path from typing import Any from uuid import UUID from .datetime_parse import parse_date, parse_datetime, parse_duration, parse_time from .exceptions import Con...
25.937107
113
0.660281
from collections import OrderedDict from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum from pathlib import Path from typing import Any from uuid import UUID from .datetime_parse import parse_date, parse_datetime, parse_duration, parse_time from .exceptions import Con...
true
true
79055052ba0de8c87f991974cca41c422c24016a
8,572
py
Python
ItemList.py
mzxrules/MM-Randomizer
56260563e3737cbff8a2bbb98ff8bcb161f3440e
[ "MIT" ]
1
2018-10-06T16:13:07.000Z
2018-10-06T16:13:07.000Z
ItemList.py
mzxrules/MM-Randomizer
56260563e3737cbff8a2bbb98ff8bcb161f3440e
[ "MIT" ]
null
null
null
ItemList.py
mzxrules/MM-Randomizer
56260563e3737cbff8a2bbb98ff8bcb161f3440e
[ "MIT" ]
null
null
null
from collections import namedtuple import logging import random from Items import ItemFactory #This file sets the item pools for various modes. Timed modes and triforce hunt are enforced first, and then extra items are specified per mode to fill in the remaining space. #Some basic items that various modes requ...
45.354497
477
0.615726
from collections import namedtuple import logging import random from Items import ItemFactory alwaysitems = (['Kokiri Sword', 'Gilded Sword', 'Great Fairy Sword', 'Hylian Shield', 'Mirror Shield'] + ['Deku Mask', 'Goron Mask', 'Zora Mask', 'Fierce Deity Mask'] + ['Postmans Hat', ...
true
true
790550ef453b5f646ef2d87dc1f1cbab439ff425
21,321
py
Python
pipeline/configs/grb-citeseer/config.py
sigeisler/grb
c89e21076dc05d1edb87dfe2eff20c29ba6bd0c1
[ "MIT" ]
null
null
null
pipeline/configs/grb-citeseer/config.py
sigeisler/grb
c89e21076dc05d1edb87dfe2eff20c29ba6bd0c1
[ "MIT" ]
null
null
null
pipeline/configs/grb-citeseer/config.py
sigeisler/grb
c89e21076dc05d1edb87dfe2eff20c29ba6bd0c1
[ "MIT" ]
null
null
null
"""Configuration for reproducing leaderboard of grb-citeseer dataset.""" import torch import torch.nn.functional as F from grb.evaluator import metric model_list = ["gcn", "gcn_ln", "gcn_at", "graphsage", "graphsage_ln", "graphsage_at", ...
39.193015
100
0.463862
import torch import torch.nn.functional as F from grb.evaluator import metric model_list = ["gcn", "gcn_ln", "gcn_at", "graphsage", "graphsage_ln", "graphsage_at", "sgcn", "sgcn_ln", "sgcn_at", ...
true
true
7905549ff257c755f3b337a529446a0563faa51d
4,278
py
Python
netpy/earl/__init__.py
stronklab/netpy
0d22a6ce43d66c3355457e681b83f338ae806e0f
[ "MIT" ]
null
null
null
netpy/earl/__init__.py
stronklab/netpy
0d22a6ce43d66c3355457e681b83f338ae806e0f
[ "MIT" ]
null
null
null
netpy/earl/__init__.py
stronklab/netpy
0d22a6ce43d66c3355457e681b83f338ae806e0f
[ "MIT" ]
null
null
null
from math import sqrt import networkx as nx import matplotlib.pyplot as plt import pygraphviz from networkx.drawing.nx_agraph import graphviz_layout class Distribution: from random import random from random import gauss from numpy.random import poisson _h = [0] h = property(lambda s: s._h[0]) ...
24.169492
112
0.586489
from math import sqrt import networkx as nx import matplotlib.pyplot as plt import pygraphviz from networkx.drawing.nx_agraph import graphviz_layout class Distribution: from random import random from random import gauss from numpy.random import poisson _h = [0] h = property(lambda s: s._h[0]) ...
false
true
790555c66bd4daf274748bedfb9610ca07d0dad9
3,576
py
Python
ctf/2020/nullcon/msg/solve.py
kamithanthanh/hacmao.github.io
87b06df827cc65f737831301bae1d5f3a2d014ff
[ "MIT" ]
1
2019-09-27T13:23:00.000Z
2019-09-27T13:23:00.000Z
ctf/2020/nullcon/msg/solve.py
kamithanthanh/hacmao.github.io
87b06df827cc65f737831301bae1d5f3a2d014ff
[ "MIT" ]
null
null
null
ctf/2020/nullcon/msg/solve.py
kamithanthanh/hacmao.github.io
87b06df827cc65f737831301bae1d5f3a2d014ff
[ "MIT" ]
1
2019-08-25T09:17:07.000Z
2019-08-25T09:17:07.000Z
#!/usr/bin/env python3 from Crypto.PublicKey import RSA, ECC import json from hashlib import sha256 from Crypto.Cipher import AES, PKCS1_OAEP from base64 import b64decode from Crypto.Signature import DSS from Crypto.Hash import SHA256 import socket from base64 import * from server import * # key = R...
44.7
761
0.683166
from Crypto.PublicKey import RSA, ECC import json from hashlib import sha256 from Crypto.Cipher import AES, PKCS1_OAEP from base64 import b64decode from Crypto.Signature import DSS from Crypto.Hash import SHA256 import socket from base64 import * from server import * message = json.loads('...
true
true
7905575a4a1a8ef4bbc139a7e7eb9cb22e8d7758
18,632
py
Python
pandas/tests/groupby/aggregate/test_other.py
ajspera/pandas
f38020f33052ea9029b410d7fae79bc8f249c0ac
[ "BSD-3-Clause" ]
5
2019-07-26T15:22:41.000Z
2021-09-28T09:22:17.000Z
pandas/tests/groupby/aggregate/test_other.py
ajspera/pandas
f38020f33052ea9029b410d7fae79bc8f249c0ac
[ "BSD-3-Clause" ]
null
null
null
pandas/tests/groupby/aggregate/test_other.py
ajspera/pandas
f38020f33052ea9029b410d7fae79bc8f249c0ac
[ "BSD-3-Clause" ]
3
2019-07-26T10:47:23.000Z
2020-08-10T12:40:32.000Z
""" test all other .agg behavior """ from collections import OrderedDict import datetime as dt from functools import partial import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, PeriodIndex, Series, date_range, period_range, ) from pandas...
30.695222
96
0.537784
from collections import OrderedDict import datetime as dt from functools import partial import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, PeriodIndex, Series, date_range, period_range, ) from pandas.core.groupby.groupby import Specific...
true
true
7905575b290cc37b57379ed96675626f5008d2cd
4,931
py
Python
seno/full_node/sync_store.py
emilson0407/seno-blockchain
fa73fc06639faaacbb82504a6c8698c3bcab57c0
[ "Apache-2.0" ]
33
2021-06-26T22:50:48.000Z
2022-02-09T04:31:40.000Z
seno/full_node/sync_store.py
emilson0407/seno-blockchain
fa73fc06639faaacbb82504a6c8698c3bcab57c0
[ "Apache-2.0" ]
18
2021-06-27T17:13:13.000Z
2022-01-04T11:45:56.000Z
seno/full_node/sync_store.py
emilson0407/seno-blockchain
fa73fc06639faaacbb82504a6c8698c3bcab57c0
[ "Apache-2.0" ]
19
2021-06-26T00:17:08.000Z
2022-03-15T06:58:21.000Z
import asyncio import logging from typing import Dict, List, Optional, Set, Tuple from seno.types.blockchain_format.sized_bytes import bytes32 from seno.util.ints import uint32, uint128 log = logging.getLogger(__name__) class SyncStore: # Whether or not we are syncing sync_mode: bool long_sync: bool ...
35.992701
119
0.653012
import asyncio import logging from typing import Dict, List, Optional, Set, Tuple from seno.types.blockchain_format.sized_bytes import bytes32 from seno.util.ints import uint32, uint128 log = logging.getLogger(__name__) class SyncStore: sync_mode: bool long_sync: bool peak_to_peer: Dict[bytes32, Se...
true
true
79055773e342b565349c3866c5c53ea28f9eb2a8
636
py
Python
pyffm/test/test_utils.py
mascaroa/pyffm
2445ed2c048347ebbfc76d39990065eb76a8d784
[ "MIT" ]
4
2020-12-22T02:59:37.000Z
2022-03-28T20:54:40.000Z
pyffm/test/test_utils.py
mascaroa/pyffm
2445ed2c048347ebbfc76d39990065eb76a8d784
[ "MIT" ]
1
2021-04-05T01:56:13.000Z
2021-11-10T02:40:31.000Z
pyffm/test/test_utils.py
mascaroa/pyffm
2445ed2c048347ebbfc76d39990065eb76a8d784
[ "MIT" ]
null
null
null
import unittest import numpy as np import string from pyffm.util import Map class TestMap(unittest.TestCase): def test_basic(self): map1 = Map() map_size_to_test = 1000 all_letters = string.ascii_uppercase + string.ascii_lowercase counter = 0 for char in "".join( ...
26.5
69
0.610063
import unittest import numpy as np import string from pyffm.util import Map class TestMap(unittest.TestCase): def test_basic(self): map1 = Map() map_size_to_test = 1000 all_letters = string.ascii_uppercase + string.ascii_lowercase counter = 0 for char in "".join( ...
true
true
790559a4a8ab6d684e8ef5b88798f1797fc0fa6e
200
py
Python
tests/util.py
popravich/rdbtools3
c2b097f58e7d3a3b12e6671aa413c263c1fb96cf
[ "MIT" ]
3
2016-01-12T23:14:47.000Z
2019-07-10T05:36:22.000Z
tests/util.py
popravich/rdbtools3
c2b097f58e7d3a3b12e6671aa413c263c1fb96cf
[ "MIT" ]
null
null
null
tests/util.py
popravich/rdbtools3
c2b097f58e7d3a3b12e6671aa413c263c1fb96cf
[ "MIT" ]
null
null
null
import io import os.path _DUMPS = os.path.join(os.path.dirname(__file__), 'dumps') def load_dump(fname): with open(os.path.join(_DUMPS, fname), 'rb') as f: return io.BytesIO(f.read())
18.181818
57
0.665
import io import os.path _DUMPS = os.path.join(os.path.dirname(__file__), 'dumps') def load_dump(fname): with open(os.path.join(_DUMPS, fname), 'rb') as f: return io.BytesIO(f.read())
true
true
79055abec64a4aaf513564325568d9bd7fc1157d
544
py
Python
bot/utils/prometheus_tools.py
trilleplay/kanelbulle
1e715dced4f63437b287078108d651155824429e
[ "MIT" ]
4
2018-09-23T10:13:16.000Z
2018-10-31T19:07:53.000Z
bot/utils/prometheus_tools.py
trilleplay/kanelbulle
1e715dced4f63437b287078108d651155824429e
[ "MIT" ]
5
2018-09-30T08:34:54.000Z
2018-10-27T09:04:53.000Z
bot/utils/prometheus_tools.py
trilleplay/kanelbulle
1e715dced4f63437b287078108d651155824429e
[ "MIT" ]
2
2018-09-29T22:32:43.000Z
2019-07-18T15:15:51.000Z
from prometheus_client import start_http_server, Gauge, Counter all_users = Gauge('users_in_all_guilds', 'All users the bot is able to see.') all_guilds = Gauge('guilds_bot_is_in', 'The amount of guilds the bot is in.') ready_events = Counter('ready_events', 'Amount of READY events recieved during uptime.') message_e...
45.333333
92
0.775735
from prometheus_client import start_http_server, Gauge, Counter all_users = Gauge('users_in_all_guilds', 'All users the bot is able to see.') all_guilds = Gauge('guilds_bot_is_in', 'The amount of guilds the bot is in.') ready_events = Counter('ready_events', 'Amount of READY events recieved during uptime.') message_e...
true
true
79055b2ff650728675ac64f5f2d9b12e54f1cd39
23,655
py
Python
tests/test_book.py
nilfoer/mangadb
860d7de310002735631ea26810b4df5b6bc08d7b
[ "MIT" ]
3
2021-01-14T16:22:41.000Z
2022-02-21T03:31:22.000Z
tests/test_book.py
nilfoer/mangadb
860d7de310002735631ea26810b4df5b6bc08d7b
[ "MIT" ]
13
2021-01-14T10:34:19.000Z
2021-05-20T08:47:54.000Z
tests/test_book.py
nilfoer/mangadb
860d7de310002735631ea26810b4df5b6bc08d7b
[ "MIT" ]
1
2022-02-24T03:10:04.000Z
2022-02-24T03:10:04.000Z
import os import datetime import logging import sqlite3 import pytest from utils import setup_mdb_dir, all_book_info, load_db_from_sql_file, TESTS_DIR from manga_db.manga_db import MangaDB from manga_db.manga import Book from manga_db.ext_info import ExternalInfo from manga_db.constants import LANG_IDS @pytest.mark.p...
36.960938
97
0.61023
import os import datetime import logging import sqlite3 import pytest from utils import setup_mdb_dir, all_book_info, load_db_from_sql_file, TESTS_DIR from manga_db.manga_db import MangaDB from manga_db.manga import Book from manga_db.ext_info import ExternalInfo from manga_db.constants import LANG_IDS @pytest.mark.p...
true
true
79055b433e8de7ec996a07b3b57b7d4a49623c67
40,771
py
Python
utils/analyzer/exploded-graph-rewriter.py
Alan-love/clang
aa231e4be75ac4759c236b755c57876f76e3cf05
[ "Apache-2.0" ]
3,102
2015-01-04T02:28:35.000Z
2022-03-30T12:53:41.000Z
utils/analyzer/exploded-graph-rewriter.py
Alan-love/clang
aa231e4be75ac4759c236b755c57876f76e3cf05
[ "Apache-2.0" ]
31
2015-01-27T20:39:41.000Z
2020-04-23T16:24:20.000Z
utils/analyzer/exploded-graph-rewriter.py
Alan-love/clang
aa231e4be75ac4759c236b755c57876f76e3cf05
[ "Apache-2.0" ]
1,868
2015-01-03T04:27:11.000Z
2022-03-25T13:37:35.000Z
#!/usr/bin/env python # #===- exploded-graph-rewriter.py - ExplodedGraph dump tool -----*- python -*--# # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===----------...
38.535917
79
0.522921
from __future__ import print_function import argparse import collections import difflib import json import logging import os import re def diff_dicts(curr, prev): removed = [k for k in prev if k not in curr or curr[k] != prev[k]] added = [k for k in curr if k not in prev or curr[k] != prev[k]] ...
true
true
79055b89596cab0ff251e02f305cffa5b4924fa6
447
py
Python
app/email.py
ruthjelimo/Pitch-app
c70258bd5dfc99520ed662276ef405137597cb1f
[ "MIT" ]
null
null
null
app/email.py
ruthjelimo/Pitch-app
c70258bd5dfc99520ed662276ef405137597cb1f
[ "MIT" ]
null
null
null
app/email.py
ruthjelimo/Pitch-app
c70258bd5dfc99520ed662276ef405137597cb1f
[ "MIT" ]
null
null
null
from flask_mail import Message from flask import render_template from . import mail subject_pref = 'Pitches' sender_email = "ruthjmimo@gmail.com" def mail_message(subject,template,to,**kwargs): sender_email = 'ruthjmimo@gmail.com' email = Message(subject, sender=sender_email, recipients=[to]) email.body=...
31.928571
66
0.740492
from flask_mail import Message from flask import render_template from . import mail subject_pref = 'Pitches' sender_email = "ruthjmimo@gmail.com" def mail_message(subject,template,to,**kwargs): sender_email = 'ruthjmimo@gmail.com' email = Message(subject, sender=sender_email, recipients=[to]) email.body=...
true
true
79055c9c0f17de54a96f1a37db4804abe6a4c55b
12,783
py
Python
examples/contrib/cifar10/main.py
nzare/ignite
002b595daa8a8345286c5e096c33e278948686a7
[ "BSD-3-Clause" ]
1
2020-08-29T16:49:36.000Z
2020-08-29T16:49:36.000Z
examples/contrib/cifar10/main.py
M3L6H/ignite
002b595daa8a8345286c5e096c33e278948686a7
[ "BSD-3-Clause" ]
5
2020-08-29T16:49:48.000Z
2020-08-29T17:05:54.000Z
examples/contrib/cifar10/main.py
M3L6H/ignite
002b595daa8a8345286c5e096c33e278948686a7
[ "BSD-3-Clause" ]
1
2020-10-15T06:21:01.000Z
2020-10-15T06:21:01.000Z
from pathlib import Path from datetime import datetime import fire import torch import torch.nn as nn import torch.optim as optim import ignite import ignite.distributed as idist from ignite.engine import Events, Engine, create_supervised_evaluator from ignite.metrics import Accuracy, Loss from ignite.handlers impor...
35.907303
120
0.662833
from pathlib import Path from datetime import datetime import fire import torch import torch.nn as nn import torch.optim as optim import ignite import ignite.distributed as idist from ignite.engine import Events, Engine, create_supervised_evaluator from ignite.metrics import Accuracy, Loss from ignite.handlers impor...
true
true
79055cc17652bc0b8bd56d2d115eac0ea2c2e3af
60
py
Python
q2_gamma/visualizers/__init__.py
ebolyen/q2-gamma
e2edd64dd9c1dfafe2c92ffedbab333df732c0d3
[ "BSD-3-Clause" ]
1
2018-03-29T16:21:18.000Z
2018-03-29T16:21:18.000Z
q2_gamma/visualizers/__init__.py
ebolyen/q2-gamma
e2edd64dd9c1dfafe2c92ffedbab333df732c0d3
[ "BSD-3-Clause" ]
null
null
null
q2_gamma/visualizers/__init__.py
ebolyen/q2-gamma
e2edd64dd9c1dfafe2c92ffedbab333df732c0d3
[ "BSD-3-Clause" ]
1
2019-06-06T20:03:07.000Z
2019-06-06T20:03:07.000Z
from .plot import plot from .simple_plot import simple_plot
20
36
0.833333
from .plot import plot from .simple_plot import simple_plot
true
true
79055d29831e0a256347de5b208f925dca717bb1
6,994
py
Python
flask_app/utilities/DataInterfaces/SqlInterface.py
cliftbar/flask_app_template
e006b68adde6c86f8ee8c262eb0a51d7aac760b5
[ "MIT" ]
null
null
null
flask_app/utilities/DataInterfaces/SqlInterface.py
cliftbar/flask_app_template
e006b68adde6c86f8ee8c262eb0a51d7aac760b5
[ "MIT" ]
null
null
null
flask_app/utilities/DataInterfaces/SqlInterface.py
cliftbar/flask_app_template
e006b68adde6c86f8ee8c262eb0a51d7aac760b5
[ "MIT" ]
null
null
null
import logging import time from abc import abstractmethod from enum import Enum from typing import Dict, Callable, Any, List from schema import Schema import sqlalchemy from sqlalchemy.engine import ResultProxy from sqlalchemy.orm import Query from sqlalchemy.schema import Table from sqlalchemy.engine.base import Eng...
37.602151
128
0.666285
import logging import time from abc import abstractmethod from enum import Enum from typing import Dict, Callable, Any, List from schema import Schema import sqlalchemy from sqlalchemy.engine import ResultProxy from sqlalchemy.orm import Query from sqlalchemy.schema import Table from sqlalchemy.engine.base import Eng...
true
true
79055df8ef88f547225e676f853952c2337d2462
1,454
py
Python
cyber_sdk/util/json.py
SaveTheAles/cyber.py
69211d4f9e861e3c64990725a4a483d2cbee0be1
[ "MIT" ]
null
null
null
cyber_sdk/util/json.py
SaveTheAles/cyber.py
69211d4f9e861e3c64990725a4a483d2cbee0be1
[ "MIT" ]
null
null
null
cyber_sdk/util/json.py
SaveTheAles/cyber.py
69211d4f9e861e3c64990725a4a483d2cbee0be1
[ "MIT" ]
null
null
null
import copy import json from abc import ABC from datetime import datetime from typing import Any from cyber_sdk.util.converter import to_isoformat def to_data(x: Any) -> Any: if "to_data" in dir(x): return x.to_data() if isinstance(x, list): return [to_data(g) for g in x] if isinstance(x,...
26.436364
91
0.644429
import copy import json from abc import ABC from datetime import datetime from typing import Any from cyber_sdk.util.converter import to_isoformat def to_data(x: Any) -> Any: if "to_data" in dir(x): return x.to_data() if isinstance(x, list): return [to_data(g) for g in x] if isinstance(x,...
true
true
79055e5ce17be169760d14eb8f18661e58b1245d
89,128
py
Python
akshare/__init__.py
LoveRabbit007/akshare
725acc58b63fa2ce203f671a18c63713a3621c3b
[ "MIT" ]
null
null
null
akshare/__init__.py
LoveRabbit007/akshare
725acc58b63fa2ce203f671a18c63713a3621c3b
[ "MIT" ]
null
null
null
akshare/__init__.py
LoveRabbit007/akshare
725acc58b63fa2ce203f671a18c63713a3621c3b
[ "MIT" ]
null
null
null
""" AKShare 是基于 Python 的开源财经数据接口库, 实现对股票, 期货, 期权, 基金, 债券, 外汇等金 融产品的量价数据, 基本面数据和另类数据从数据采集, 数据清洗到数据下载的工具, 满足金融数据科学 家, 数据科学爱好者在数据获取方面的需求. 它的特点是利用 AKShare 获取的是基于可信任数据源 发布的原始数据, 广大数据科学家可以利用原始数据进行再加工, 从而得出科学的结论. """ """ 版本更新记录: 0.1.13 更新所有基于 fushare 的接口 0.1.14 更新 requirements.txt 文件 0.1.15 自动安装所需要的 packages 0.1.16 修正部分函数命名 ...
25.871698
118
0.79617
__version__ = "1.2.33" __author__ = "Albert King" import sys if sys.version_info < (3, 7): print(f"AKShare {__version__} requires Python 3.7+ and 64 bit OS") sys.exit(1) del sys from akshare.fund.fund_fhsp_em import fund_cf_em, fund_fh_rank_em, fund_fh_em from akshare.other.other_game import club_rank_ga...
true
true
79055eadfcf0cb8d1cb96dc6ff1085b7d3f4d342
849
py
Python
src/AuShadha/demographics/guardian/dijit_fields_constants.py
GosthMan/AuShadha
3ab48825a0dba19bf880b6ac6141ab7a6adf1f3e
[ "PostgreSQL" ]
46
2015-03-04T14:19:47.000Z
2021-12-09T02:58:46.000Z
src/AuShadha/demographics/guardian/dijit_fields_constants.py
aytida23/AuShadha
3ab48825a0dba19bf880b6ac6141ab7a6adf1f3e
[ "PostgreSQL" ]
2
2015-06-05T10:29:04.000Z
2015-12-06T16:54:10.000Z
src/AuShadha/demographics/guardian/dijit_fields_constants.py
aytida23/AuShadha
3ab48825a0dba19bf880b6ac6141ab7a6adf1f3e
[ "PostgreSQL" ]
24
2015-03-23T01:38:11.000Z
2022-01-24T16:23:42.000Z
GUARDIAN_FORM_CONSTANTS = { 'guardian_name':{'max_length': 30, "data-dojo-type": "dijit.form.ValidationTextBox", "data-dojo-props": r"'required' :'true' ,'regExp':'[\\w]+','invalidMessage':'Invalid Character' " }, 'relation_to_guardian':{ ...
42.45
123
0.468787
GUARDIAN_FORM_CONSTANTS = { 'guardian_name':{'max_length': 30, "data-dojo-type": "dijit.form.ValidationTextBox", "data-dojo-props": r"'required' :'true' ,'regExp':'[\\w]+','invalidMessage':'Invalid Character' " }, 'relation_to_guardian':{ ...
true
true
7905629a5c8eb7bb5d89a3d06a2a42774518bb37
4,779
py
Python
tests/test_validator.py
finhold72/recaptcha
474ff67d468e8d3af8a2e58d9c34ff834d52bf2a
[ "MIT" ]
null
null
null
tests/test_validator.py
finhold72/recaptcha
474ff67d468e8d3af8a2e58d9c34ff834d52bf2a
[ "MIT" ]
null
null
null
tests/test_validator.py
finhold72/recaptcha
474ff67d468e8d3af8a2e58d9c34ff834d52bf2a
[ "MIT" ]
null
null
null
from unittest import mock import pytest from rest_framework.serializers import ValidationError from drf_recaptcha.client import RecaptchaResponse from drf_recaptcha.validators import ReCaptchaV2Validator, ReCaptchaV3Validator @pytest.mark.parametrize( ("validator_class", "params"), [ (ReCaptchaV2Val...
34.630435
107
0.634442
from unittest import mock import pytest from rest_framework.serializers import ValidationError from drf_recaptcha.client import RecaptchaResponse from drf_recaptcha.validators import ReCaptchaV2Validator, ReCaptchaV3Validator @pytest.mark.parametrize( ("validator_class", "params"), [ (ReCaptchaV2Val...
true
true
790562bc00dcdb90ab02470c69a150b42ec00587
2,331
py
Python
src/utils/config.py
ttgc/zigotoland
0f1910e9853761a0f8187bb20c79a467f19ff3e2
[ "MIT" ]
2
2019-06-27T22:43:05.000Z
2021-07-08T13:22:52.000Z
src/utils/config.py
ttgc/zigotoland
0f1910e9853761a0f8187bb20c79a467f19ff3e2
[ "MIT" ]
2
2019-06-28T08:34:52.000Z
2019-06-28T13:46:23.000Z
src/utils/config.py
ttgc/zigotoland
0f1910e9853761a0f8187bb20c79a467f19ff3e2
[ "MIT" ]
null
null
null
#!usr/bin/env python3.7 #-*-coding:utf-8-*- import json import discord PATH = "config.json" def singleton(class_): instances = {} def getinstance(*args, **kwargs): if class_ not in instances: instances[class_] = class_(*args, **kwargs) return instances[class_] return getinstan...
38.85
80
0.640927
import json import discord PATH = "config.json" def singleton(class_): instances = {} def getinstance(*args, **kwargs): if class_ not in instances: instances[class_] = class_(*args, **kwargs) return instances[class_] return getinstance @singleton class Config: def __ini...
true
true
7905636cb6219b7cb1702daadb1550929691dfd7
46
py
Python
cryptoquant/api/okex/config.py
studyquant/StudyQuant
24790634ac320b25361672754558c3797f4fc9e3
[ "Apache-2.0" ]
74
2018-08-10T17:05:57.000Z
2022-03-26T07:06:02.000Z
cryptoquant/api/okex/config.py
ezailwoo/studyquant
24790634ac320b25361672754558c3797f4fc9e3
[ "Apache-2.0" ]
1
2022-03-24T06:42:00.000Z
2022-03-24T06:42:00.000Z
cryptoquant/api/okex/config.py
ezailwoo/studyquant
24790634ac320b25361672754558c3797f4fc9e3
[ "Apache-2.0" ]
18
2020-09-22T09:03:49.000Z
2022-03-31T20:48:54.000Z
api_key = '' seceret_key = '' passphrase = ''
11.5
16
0.608696
api_key = '' seceret_key = '' passphrase = ''
true
true
7905648bce70b580b9648beb73466912b21db9a9
4,062
py
Python
instagram/settings.py
Brayonski/Instagram-1
7135f99d869d1e15310c02e73ca540ff8cacef18
[ "MIT" ]
6
2018-10-17T18:09:28.000Z
2020-09-25T19:30:47.000Z
instagram/settings.py
Brayonski/Instagram-1
7135f99d869d1e15310c02e73ca540ff8cacef18
[ "MIT" ]
4
2020-06-05T18:27:55.000Z
2021-09-07T23:53:10.000Z
instagram/settings.py
Brayonski/Instagram-1
7135f99d869d1e15310c02e73ca540ff8cacef18
[ "MIT" ]
11
2018-06-21T07:03:55.000Z
2019-07-29T06:59:25.000Z
import os import dj_database_url from decouple import config, Csv # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/...
27.821918
91
0.693747
import os import dj_database_url from decouple import config, Csv BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) MODE=config("MODE", default="dev") SECRET_KEY = config('SECRET_KEY') DEBUG = config('DEBUG', default=False, cast=bool) ALLOWED_HOSTS = ['*'] UPLOADCARE = { 'pub_key': c...
true
true
7905660d1f710852bc60081a5ce7c97980c9665a
2,207
py
Python
dmlab2d/settings_helper.py
Robert-Held/lab2d
ebf569aeda6c86a9493622b0e33e568686b4a608
[ "Apache-2.0" ]
377
2020-11-16T01:30:06.000Z
2022-03-24T09:30:00.000Z
dmlab2d/settings_helper.py
Robert-Held/lab2d
ebf569aeda6c86a9493622b0e33e568686b4a608
[ "Apache-2.0" ]
17
2020-11-18T13:57:12.000Z
2022-03-28T01:20:52.000Z
dmlab2d/settings_helper.py
Robert-Held/lab2d
ebf569aeda6c86a9493622b0e33e568686b4a608
[ "Apache-2.0" ]
47
2020-11-16T12:36:10.000Z
2022-03-24T17:50:18.000Z
# Lint as: python3 # Copyright 2020 The DMLab2D Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
35.031746
79
0.686905
import numbers from typing import Mapping, Sequence def _flatten_args(pairs_in, args_out, prefix, visited_stack): for key, v in pairs_in: if not isinstance(key, str): raise ValueError('Keys must be strings. %r' % key) flat_key = prefix + '.' + key if prefix else key if v is None: ...
true
true
790567e9dd7a343e995d4e222f05719a9750ecfe
14,359
py
Python
qiskit/circuit/library/grover_operator.py
SpinQTech/SpinQKit
2e24826688b2b26cf7efa66fd47f0e7ef883a96c
[ "Apache-2.0" ]
2
2021-12-20T05:19:44.000Z
2021-12-20T05:21:48.000Z
qiskit/circuit/library/grover_operator.py
SpinQTech/SpinQKit
2e24826688b2b26cf7efa66fd47f0e7ef883a96c
[ "Apache-2.0" ]
null
null
null
qiskit/circuit/library/grover_operator.py
SpinQTech/SpinQKit
2e24826688b2b26cf7efa66fd47f0e7ef883a96c
[ "Apache-2.0" ]
1
2021-12-20T05:20:35.000Z
2021-12-20T05:20:35.000Z
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or...
47.233553
101
0.548088
from typing import List, Optional, Union import numpy from qiskit.circuit import QuantumCircuit, QuantumRegister, AncillaRegister from qiskit.quantum_info import Operator from .standard_gates import MCXGate class GroverOperator(QuantumCircuit): def __init__( self, ...
true
true
790568afced767abc6eb9268aa1733b1c3326aa9
2,631
py
Python
utest/writer/test_filewriters.py
nopparat-mkw/robotframework
1c460dd57383f992eb3642a4b0c50fee2dc91581
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
utest/writer/test_filewriters.py
nopparat-mkw/robotframework
1c460dd57383f992eb3642a4b0c50fee2dc91581
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
utest/writer/test_filewriters.py
nopparat-mkw/robotframework
1c460dd57383f992eb3642a4b0c50fee2dc91581
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
import unittest from robot.parsing import TestCaseFile from robot.parsing.model import TestCaseTable from robot.utils import ET, ETSource, StringIO from robot.utils.asserts import assert_equal def create_test_case_file(): data = TestCaseFile(source='foo.txt') table = TestCaseTable(data) data.testcase_tab...
31.698795
90
0.659065
import unittest from robot.parsing import TestCaseFile from robot.parsing.model import TestCaseTable from robot.utils import ET, ETSource, StringIO from robot.utils.asserts import assert_equal def create_test_case_file(): data = TestCaseFile(source='foo.txt') table = TestCaseTable(data) data.testcase_tab...
true
true
790568b8149eb575b8c3d09f5df162c3ec0fbfec
4,179
py
Python
yandeley/models/files.py
shuichiro-makigaki/yandeley-python-sdk
2c15145d11ddfdf33a94da6c846afdd13f310b54
[ "Apache-2.0" ]
null
null
null
yandeley/models/files.py
shuichiro-makigaki/yandeley-python-sdk
2c15145d11ddfdf33a94da6c846afdd13f310b54
[ "Apache-2.0" ]
null
null
null
yandeley/models/files.py
shuichiro-makigaki/yandeley-python-sdk
2c15145d11ddfdf33a94da6c846afdd13f310b54
[ "Apache-2.0" ]
null
null
null
import json import os import re from yandeley.models.annotations import Annotation from yandeley.response import SessionResponseObject class File(SessionResponseObject): """ A file attached to a document. .. attribute:: id .. attribute:: size .. attribute:: file_name .. attribute:: mime_type...
33.97561
119
0.603494
import json import os import re from yandeley.models.annotations import Annotation from yandeley.response import SessionResponseObject class File(SessionResponseObject): content_type = 'application/vnd.mendeley-file.1+json' filename_regex = re.compile('filename="(\S+)"') @property def download_url(s...
true
true
7905695831cb68228214abcd4e9cbe043ee10984
532
py
Python
Day_55/sandbox.py
ecanro/100DaysOfCode_Python
a86ebe5a793fd4743e0de87454ba76925efdd23d
[ "MIT" ]
null
null
null
Day_55/sandbox.py
ecanro/100DaysOfCode_Python
a86ebe5a793fd4743e0de87454ba76925efdd23d
[ "MIT" ]
null
null
null
Day_55/sandbox.py
ecanro/100DaysOfCode_Python
a86ebe5a793fd4743e0de87454ba76925efdd23d
[ "MIT" ]
null
null
null
## ********Day 55 Start********** ## Advanced Python Decorator Functions class User: def __init__(self, name): self.name = name self.is_logged_in = False def is_authenticated_decorator(function): def wrapper(*args, **kwargs): if args[0].is_logged_in == True: function(args[...
24.181818
50
0.667293
e self.is_logged_in = False def is_authenticated_decorator(function): def wrapper(*args, **kwargs): if args[0].is_logged_in == True: function(args[0]) return wrapper @is_authenticated_decorator def create_blog_post(user): print(f"This is {user.name}'s new blog post.") new_user...
true
true
790569d6482d7e5566b735e8104a8a049aa90f87
585
py
Python
elasticsearch/elasticsearch.py
webvul/Allscanner
a1a4dc9369e28f5be2dffdb6a789147da9e44dc6
[ "MIT" ]
1
2020-01-08T22:43:27.000Z
2020-01-08T22:43:27.000Z
elasticsearch/elasticsearch.py
webvul/Allscanner
a1a4dc9369e28f5be2dffdb6a789147da9e44dc6
[ "MIT" ]
null
null
null
elasticsearch/elasticsearch.py
webvul/Allscanner
a1a4dc9369e28f5be2dffdb6a789147da9e44dc6
[ "MIT" ]
1
2020-09-15T01:07:07.000Z
2020-09-15T01:07:07.000Z
#coding:utf-8 import urllib2 import sys,socket def elasticburp(ip,port): addr = (ip,int(port)) url = "http://" + ip + ":" + str(port) + "/_cat" sock_9200 = socket.socket(socket.AF_INET,socket.SOCK_STREAM) try: sock_9200.settimeout(1) sock_9200.connect(addr) print '%s 9200 ...
20.892857
86
0.555556
import urllib2 import sys,socket def elasticburp(ip,port): addr = (ip,int(port)) url = "http://" + ip + ":" + str(port) + "/_cat" sock_9200 = socket.socket(socket.AF_INET,socket.SOCK_STREAM) try: sock_9200.settimeout(1) sock_9200.connect(addr) print '%s 9200 open!' ...
false
true
79056a0d4c4e25f66e8adcf62667faf578d40c78
12,288
py
Python
reporting/base.py
flagshipenterprise/django-prickly-reports
14375d2e24c2257c631c013432a92c5aa19f5aa9
[ "MIT" ]
1
2015-02-03T19:42:23.000Z
2015-02-03T19:42:23.000Z
reporting/base.py
flagshipenterprise/django-prickly-reports
14375d2e24c2257c631c013432a92c5aa19f5aa9
[ "MIT" ]
null
null
null
reporting/base.py
flagshipenterprise/django-prickly-reports
14375d2e24c2257c631c013432a92c5aa19f5aa9
[ "MIT" ]
null
null
null
from django import forms from django.http import QueryDict from django.forms.formsets import formset_factory from abc import ABCMeta, abstractmethod from collections import OrderedDict from datetime import date import itertools import re from fields import SubmitButtonField, SubmitButtonWidget class Filter(object): ...
35.008547
102
0.595296
from django import forms from django.http import QueryDict from django.forms.formsets import formset_factory from abc import ABCMeta, abstractmethod from collections import OrderedDict from datetime import date import itertools import re from fields import SubmitButtonField, SubmitButtonWidget class Filter(object): ...
true
true
79056a95587e00fccae95091e487e9684f3db15e
10,292
py
Python
grr/lib/rdfvalues/paths.py
panhania/grr
fe16a7311a528e31fe0e315a880e98273b8df960
[ "Apache-2.0" ]
null
null
null
grr/lib/rdfvalues/paths.py
panhania/grr
fe16a7311a528e31fe0e315a880e98273b8df960
[ "Apache-2.0" ]
null
null
null
grr/lib/rdfvalues/paths.py
panhania/grr
fe16a7311a528e31fe0e315a880e98273b8df960
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """Pathspecs are methods of specifying the path on the client. The GRR client has a number of drivers to virtualize access to different objects to create a Virtual File System (VFS) abstraction. These are called 'VFS Handlers' and they provide typical file-like operations (e.g. read, seek, tell a...
30.449704
80
0.667314
import itertools import posixpath import re from grr.lib import rdfvalue from grr.lib import utils from grr.lib.rdfvalues import standard as rdf_standard from grr.lib.rdfvalues import structs as rdf_structs from grr.proto import jobs_pb2 from grr.server import artifact_utils INTERPOLATED_REGEX = re.compile(r"%%([^%...
true
true
79056c4d6dbb00640cc2ebf158ebf31c20a234ed
8,530
py
Python
python/cuml/dask/cluster/kmeans.py
codereport/cuml
7225fadb72ef5408af58ab16ce062762b64f2c79
[ "Apache-2.0" ]
null
null
null
python/cuml/dask/cluster/kmeans.py
codereport/cuml
7225fadb72ef5408af58ab16ce062762b64f2c79
[ "Apache-2.0" ]
null
null
null
python/cuml/dask/cluster/kmeans.py
codereport/cuml
7225fadb72ef5408af58ab16ce062762b64f2c79
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2019-2020, 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 agre...
33.582677
78
0.617468
import cupy as cp from cuml.dask.common.base import BaseEstimator from cuml.dask.common.base import DelayedPredictionMixin from cuml.dask.common.base import DelayedTransformMixin from cuml.dask.common.base import mnmg_import from cuml.dask.common.input_utils import concatenate from cuml.dask.common.inp...
true
true
79056d2216512f0e0029ae4ed759c3d6388e83c9
2,651
py
Python
src/sqlfluff/core/rules/std/L042.py
Jophish/sqlfluff
c579ca3ec7c0a83a04e40aa94fe9478486198b04
[ "MIT" ]
null
null
null
src/sqlfluff/core/rules/std/L042.py
Jophish/sqlfluff
c579ca3ec7c0a83a04e40aa94fe9478486198b04
[ "MIT" ]
1
2020-04-02T09:05:39.000Z
2020-12-10T14:42:59.000Z
src/sqlfluff/core/rules/std/L042.py
Jophish/sqlfluff
c579ca3ec7c0a83a04e40aa94fe9478486198b04
[ "MIT" ]
null
null
null
"""Implementation of Rule L042.""" from sqlfluff.core.rules.base import BaseCrawler, LintResult from sqlfluff.core.rules.doc_decorators import document_configuration @document_configuration class Rule_L042(BaseCrawler): """Join/From clauses should not contain subqueries. Use CTEs instead. By default this ru...
31.559524
113
0.562429
from sqlfluff.core.rules.base import BaseCrawler, LintResult from sqlfluff.core.rules.doc_decorators import document_configuration @document_configuration class Rule_L042(BaseCrawler): config_keywords = ["forbid_subquery_in"] _config_mapping = { "join": ["join_clause"], "from": ["from_claus...
true
true
79056d3c213cf9c3c5b51f02b3618516f5ebaf18
179
py
Python
api/__init__.py
zhaojiejoe/fastapi-friendly-response-demo
7628e4af481a4df4661c16af1d7e0164ecf64952
[ "MIT" ]
1
2020-05-12T18:49:43.000Z
2020-05-12T18:49:43.000Z
api/__init__.py
zhaojiejoe/fastapi-friendly-response-demo
7628e4af481a4df4661c16af1d7e0164ecf64952
[ "MIT" ]
null
null
null
api/__init__.py
zhaojiejoe/fastapi-friendly-response-demo
7628e4af481a4df4661c16af1d7e0164ecf64952
[ "MIT" ]
null
null
null
from fastapi_utils.inferring_router import InferringRouter from . import views router = InferringRouter() router.include_router(views.router, prefix='/api', tags=['api'])
25.571429
65
0.765363
from fastapi_utils.inferring_router import InferringRouter from . import views router = InferringRouter() router.include_router(views.router, prefix='/api', tags=['api'])
true
true
79056e0540f5aa0eabc1dae02e853b45b7c8665c
6,164
py
Python
bsddb3/bsddb3-6.2.6/build/lib.freebsd-12.1-RELEASE-amd64-3.7/bsddb3/tests/test_compat.py
mpwillson/spambayes3
b51d7bb9016066234ce88dad65faabed85f63d78
[ "PSF-2.0" ]
1
2020-03-21T15:17:22.000Z
2020-03-21T15:17:22.000Z
bsddb3/bsddb3-6.2.6/Lib3/bsddb/test/test_compat.py
mpwillson/spambayes3
b51d7bb9016066234ce88dad65faabed85f63d78
[ "PSF-2.0" ]
1
2022-02-22T22:23:55.000Z
2022-02-22T22:23:55.000Z
bsddb3/bsddb3-6.2.6/build/lib.freebsd-12.1-RELEASE-amd64-3.7/bsddb3/tests/test_compat.py
mpwillson/spambayes3
b51d7bb9016066234ce88dad65faabed85f63d78
[ "PSF-2.0" ]
null
null
null
""" Copyright (c) 2008-2018, Jesus Cea Avion <jcea@jcea.es> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of...
28.018182
84
0.553861
import os, string import unittest from .test_all import db, hashopen, btopen, rnopen, verbose, \ get_new_database_path class CompatibilityTestCase(unittest.TestCase): def setUp(self): self.filename = get_new_database_path() def tearDown(self): try: os.remove(self.filena...
true
true
790571628ddd93fc8d5c7a10847001b8a363f6a8
7,116
py
Python
Spike generation/spike_recorder_focal.py
XiaoquinNUDT/Three-SNN-learning-algorithms-in-Brian2
b7a5b0aba03172cdc04e738f02a949c373c1aac2
[ "BSD-2-Clause" ]
8
2019-12-18T09:36:34.000Z
2021-06-22T15:47:49.000Z
Spike generation/spike_recorder_focal.py
Mary-Shi/Three-SNN-learning-algorithms-in-Brian2
b7a5b0aba03172cdc04e738f02a949c373c1aac2
[ "BSD-2-Clause" ]
null
null
null
Spike generation/spike_recorder_focal.py
Mary-Shi/Three-SNN-learning-algorithms-in-Brian2
b7a5b0aba03172cdc04e738f02a949c373c1aac2
[ "BSD-2-Clause" ]
6
2020-03-31T11:40:29.000Z
2022-03-14T01:26:40.000Z
""" load the dataset example and return the maximum image size, which is used to definite the spike generation network; images with different size are focused onto the center of the spike generation network; the generated poisson spikes are recorded and saved for further use. """ """ on 12th November by xiaoquinNUDT ve...
45.909677
127
0.657532
= True e Exception('You have provide the wrong dataset name or path, please check carefully') else: dataset_path_name = path_dataset + name_dataset if os.path.isfile('%s.pickle' % dataset_path_name): example = pickle.load(open('%s.pickle' % dataset_path_name)) flag_dataloade...
true
true
7905737374f205b4e3afb2b45da9c7c6b192352c
1,320
py
Python
codql-report/generator.py
Heersin/codeql_packer
5d1258ce2419a67161ac3b844219ebdbe5310e59
[ "MIT" ]
null
null
null
codql-report/generator.py
Heersin/codeql_packer
5d1258ce2419a67161ac3b844219ebdbe5310e59
[ "MIT" ]
null
null
null
codql-report/generator.py
Heersin/codeql_packer
5d1258ce2419a67161ac3b844219ebdbe5310e59
[ "MIT" ]
null
null
null
import os os.chdir("./export") from reader.csv_mod import CsvReader from reader.sarif_mod import SarifReader from reader.server_mod import RestfulReader from export.export import Exporter def generate(args): project_name = args.name sarif_list = args.sarif if sarif_list == None: sarif_list = ...
23.157895
54
0.681818
import os os.chdir("./export") from reader.csv_mod import CsvReader from reader.sarif_mod import SarifReader from reader.server_mod import RestfulReader from export.export import Exporter def generate(args): project_name = args.name sarif_list = args.sarif if sarif_list == None: sarif_list = ...
true
true
79057419b0cf6e46329fd2c2aad41db629000e02
85,313
py
Python
tests/providers/google/cloud/hooks/test_bigquery.py
khilawar4/airflow
5f3f65b82517f615f31f0c8a7f8ac0facb325235
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
3
2021-01-29T20:33:56.000Z
2021-08-06T17:35:16.000Z
tests/providers/google/cloud/hooks/test_bigquery.py
khilawar4/airflow
5f3f65b82517f615f31f0c8a7f8ac0facb325235
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
210
2021-07-17T00:25:52.000Z
2021-12-29T00:44:48.000Z
tests/providers/google/cloud/hooks/test_bigquery.py
khilawar4/airflow
5f3f65b82517f615f31f0c8a7f8ac0facb325235
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
2
2021-04-14T11:15:17.000Z
2021-12-15T16:58:24.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...
42.402087
110
0.631674
import re import unittest from unittest import mock import pytest from google.cloud.bigquery import DEFAULT_RETRY, DatasetReference, Table, TableReference from google.cloud.bigquery.dataset import AccessEntry, Dataset, DatasetListItem from google.cloud.exceptions import NotFound from parameterized i...
true
true
7905747535ec9cb9dbd9f0843e083b2ae9fb07f1
20,354
py
Python
yolo3_video.py
BG4WCE/keras-yolo3
be5afc9a8ac7c353941072960e1c099009946895
[ "MIT" ]
null
null
null
yolo3_video.py
BG4WCE/keras-yolo3
be5afc9a8ac7c353941072960e1c099009946895
[ "MIT" ]
null
null
null
yolo3_video.py
BG4WCE/keras-yolo3
be5afc9a8ac7c353941072960e1c099009946895
[ "MIT" ]
null
null
null
import argparse import os import numpy as np from keras.layers import Conv2D, Input, BatchNormalization, LeakyReLU, ZeroPadding2D, UpSampling2D from keras.layers.merge import add, concatenate from keras.models import Model import struct import cv2 import time from pathlib import Path #np.set_printoptions(threshold=np....
42.228216
136
0.532131
import argparse import os import numpy as np from keras.layers import Conv2D, Input, BatchNormalization, LeakyReLU, ZeroPadding2D, UpSampling2D from keras.layers.merge import add, concatenate from keras.models import Model import struct import cv2 import time from pathlib import Path np.set_printoptions(threshold=30)...
true
true
790575afb1e0a7c80b439a0b93665148b0e79233
1,500
py
Python
src/data/process_functions.py
acwooding/docmap_playground
388c0f357cadb9b6e4b4b6e25fb131713111dc48
[ "MIT" ]
null
null
null
src/data/process_functions.py
acwooding/docmap_playground
388c0f357cadb9b6e4b4b6e25fb131713111dc48
[ "MIT" ]
null
null
null
src/data/process_functions.py
acwooding/docmap_playground
388c0f357cadb9b6e4b4b6e25fb131713111dc48
[ "MIT" ]
null
null
null
""" Custom dataset processing/generation functions should be added to this file """ import pathlib from sklearn.datasets import fetch_20newsgroups from functools import partial from src import workflow, paths from src.log import logger import src.log.debug from tqdm.auto import tqdm from .. import paths from ..log ...
25.423729
94
0.662667
import pathlib from sklearn.datasets import fetch_20newsgroups from functools import partial from src import workflow, paths from src.log import logger import src.log.debug from tqdm.auto import tqdm from .. import paths from ..log import logger __all__ = [ 'process_20_newsgroups' ] def process_20_newsgroups(*, ...
true
true
790577160bc25eb556d764dd1eb42760f709d08b
2,425
py
Python
blogs/beamadvent/day2a.py
laurenzberger/training-data-analyst
3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3
[ "Apache-2.0" ]
6,140
2016-05-23T16:09:35.000Z
2022-03-30T19:00:46.000Z
blogs/beamadvent/day2a.py
laurenzberger/training-data-analyst
3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3
[ "Apache-2.0" ]
1,384
2016-07-08T22:26:41.000Z
2022-03-24T16:39:43.000Z
blogs/beamadvent/day2a.py
laurenzberger/training-data-analyst
3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3
[ "Apache-2.0" ]
5,110
2016-05-27T13:45:18.000Z
2022-03-31T18:40:42.000Z
#!/usr/bin/env python3 """ Copyright Google Inc. 2019 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...
34.15493
112
0.684536
import apache_beam as beam import numpy as np import argparse, logging def handle_ints(ints, startpos=0): if ints[startpos] == 99: return ints x1 = ints[startpos+1] x2 = ints[startpos+2] outpos = ints[startpos+3] if ints[startpos] == 1: ints[outpos] = ints[x1] + ints[x2] elif ints[star...
true
true
79057734c28313400a8b07ebf7f0004fe4fa55c7
2,453
py
Python
manimlib/utils/rate_functions.py
sunkisser/manim
39673a80d7bbbea258c35ce5a1d37a0911aae4f1
[ "MIT" ]
1
2022-03-23T06:27:22.000Z
2022-03-23T06:27:22.000Z
manimlib/utils/rate_functions.py
sunkisser/manim
39673a80d7bbbea258c35ce5a1d37a0911aae4f1
[ "MIT" ]
null
null
null
manimlib/utils/rate_functions.py
sunkisser/manim
39673a80d7bbbea258c35ce5a1d37a0911aae4f1
[ "MIT" ]
null
null
null
from typing import Callable import numpy as np from manimlib.utils.bezier import bezier def linear(t: float) -> float: return t def smooth(t: float) -> float: # Zero first and second derivatives at t=0 and t=1. # Equivalent to bezier([0, 0, 0, 1, 1, 1]) s = 1 - t return (t**3) * (10 * s * s + ...
24.287129
78
0.593967
from typing import Callable import numpy as np from manimlib.utils.bezier import bezier def linear(t: float) -> float: return t def smooth(t: float) -> float: s = 1 - t return (t**3) * (10 * s * s + 5 * s * t + t * t) def rush_into(t: float) -> float: return 2 * smooth(0.5 * t) def r...
true
true
7905785aeb01e7ad23f5075ce8852726143b76d7
405
py
Python
BlogComment/BlogComment/urls.py
collins-hue/Django-Blog-Comment
3af6a624367b01abee296b13c46dce11c7ee7cec
[ "MIT" ]
1
2022-03-18T15:51:43.000Z
2022-03-18T15:51:43.000Z
BlogComment/BlogComment/urls.py
collins-hue/Django-Blog-Comment
3af6a624367b01abee296b13c46dce11c7ee7cec
[ "MIT" ]
null
null
null
BlogComment/BlogComment/urls.py
collins-hue/Django-Blog-Comment
3af6a624367b01abee296b13c46dce11c7ee7cec
[ "MIT" ]
null
null
null
from django.conf import settings from django.conf.urls import include from django.conf.urls.static import static from django.contrib import admin from django.urls import path urlpatterns = [ path('admin/', admin.site.urls), path('', include('Blog.urls')), path('tinymce/', include('tinymce.urls')), ] urlp...
28.928571
89
0.750617
from django.conf import settings from django.conf.urls import include from django.conf.urls.static import static from django.contrib import admin from django.urls import path urlpatterns = [ path('admin/', admin.site.urls), path('', include('Blog.urls')), path('tinymce/', include('tinymce.urls')), ] urlp...
true
true
790579adf83f040af3e85de91119edb0e3623608
143
py
Python
Systemcode/imental-Flask/init.py
vemodalen-x/IRS_imental
050fd6a4694e4e7dfc396c1c7f13fd1ad97fbae6
[ "MIT" ]
3
2021-11-23T04:36:04.000Z
2022-01-18T08:05:10.000Z
Systemcode/imental-Flask/init.py
vemodalen-x/IRS_imental
050fd6a4694e4e7dfc396c1c7f13fd1ad97fbae6
[ "MIT" ]
null
null
null
Systemcode/imental-Flask/init.py
vemodalen-x/IRS_imental
050fd6a4694e4e7dfc396c1c7f13fd1ad97fbae6
[ "MIT" ]
2
2021-10-17T08:16:18.000Z
2021-11-23T04:36:10.000Z
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('setting') db = SQLAlchemy(app)
17.875
39
0.797203
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('setting') db = SQLAlchemy(app)
true
true
79057a1b9c6eeab7bb40ba4fcfb7fda297b2b665
176
py
Python
src/comments/urls.py
samrika25/TRAVIS_HEROKU_GIT
bcae6d0422d9a0369810944a91dd03db7df0d058
[ "MIT" ]
null
null
null
src/comments/urls.py
samrika25/TRAVIS_HEROKU_GIT
bcae6d0422d9a0369810944a91dd03db7df0d058
[ "MIT" ]
4
2021-03-30T12:35:36.000Z
2021-06-10T18:11:24.000Z
src/comments/urls.py
samrika25/TRAVIS_HEROKU_GIT
bcae6d0422d9a0369810944a91dd03db7df0d058
[ "MIT" ]
2
2021-02-07T16:16:36.000Z
2021-07-13T05:26:51.000Z
from django.urls import path from .views import DetailView app_name = 'comments' urlpatterns = [ path('<slug:model>/<slug:slug>', DetailView.as_view(), name='detail') ]
17.6
73
0.704545
from django.urls import path from .views import DetailView app_name = 'comments' urlpatterns = [ path('<slug:model>/<slug:slug>', DetailView.as_view(), name='detail') ]
true
true
79057a8012c36ee0c48205c123c30860a54cd615
2,930
py
Python
src/models/layers/subpixel.py
TECHENGINESSRL/audio-super-res
2f90a288e86ddca50c98c17b0513e73ab49087d3
[ "MIT" ]
712
2017-03-15T14:36:24.000Z
2022-03-27T08:51:43.000Z
src/models/layers/subpixel.py
YA07/audio-super-res
2f90a288e86ddca50c98c17b0513e73ab49087d3
[ "MIT" ]
43
2017-05-05T19:51:23.000Z
2022-02-17T05:57:47.000Z
src/models/layers/subpixel.py
YA07/audio-super-res
2f90a288e86ddca50c98c17b0513e73ab49087d3
[ "MIT" ]
173
2017-03-18T22:36:16.000Z
2022-03-19T07:06:43.000Z
import numpy as np import tensorflow as tf # ---------------------------------------------------------------------------- def SubPixel1D_v2(I, r): """One-dimensional subpixel upsampling layer Based on https://github.com/Tetrachrome/subpixel/blob/master/subpixel.py """ with tf.compat.v1.name_scope('subpixel')...
36.17284
88
0.567918
import numpy as np import tensorflow as tf def SubPixel1D_v2(I, r): with tf.compat.v1.name_scope('subpixel'): bsize, a, r = I.get_shape().as_list() bsize = tf.shape(input=I)[0] X = tf.split(1, a, I) if 'axis' in tf.squeeze.__code__.co_varnames: X = tf.concat(1, [tf.squeeze(x, axis=1) for x...
true
true
79057aad6749bbaf366bec0fafa663b6742e5216
224
py
Python
Exam-Prep/Exam_16-Aug-20/project/hardware/heavy_hardware.py
geodimitrov/PythonOOP_SoftUni
f1c6718c878b618b3ab3f174cd4d187bd178940b
[ "MIT" ]
1
2021-06-30T11:53:44.000Z
2021-06-30T11:53:44.000Z
Exam-Prep/Exam_16-Aug-20/project/hardware/heavy_hardware.py
geodimitrov/PythonOOP_SoftUni
f1c6718c878b618b3ab3f174cd4d187bd178940b
[ "MIT" ]
null
null
null
Exam-Prep/Exam_16-Aug-20/project/hardware/heavy_hardware.py
geodimitrov/PythonOOP_SoftUni
f1c6718c878b618b3ab3f174cd4d187bd178940b
[ "MIT" ]
null
null
null
from project.hardware.hardware import Hardware class HeavyHardware(Hardware): TYPE = "Heavy" def __init__(self, name, capacity, memory): super().__init__(name, self.TYPE, capacity * 2, int(memory * 0.75))
24.888889
75
0.691964
from project.hardware.hardware import Hardware class HeavyHardware(Hardware): TYPE = "Heavy" def __init__(self, name, capacity, memory): super().__init__(name, self.TYPE, capacity * 2, int(memory * 0.75))
true
true
79057b33de621f99661374c933fe56c46dfde3d0
567
py
Python
plots/stereoisomer_gen.py
Reaction-Space-Explorer/reac-space-exp
02c91247d9ee5107cbf9fa113e87edaf4bd392b0
[ "BSD-3-Clause" ]
4
2020-06-27T23:08:41.000Z
2022-01-09T16:20:48.000Z
plots/stereoisomer_gen.py
sahilrajiv/reac-space-exp
52f4b4eab755bd4a6830d838828c958149567396
[ "BSD-3-Clause" ]
15
2020-07-27T23:14:32.000Z
2022-03-12T00:59:20.000Z
plots/stereoisomer_gen.py
sahilrajiv/reac-space-exp
52f4b4eab755bd4a6830d838828c958149567396
[ "BSD-3-Clause" ]
3
2020-06-27T23:08:46.000Z
2021-04-20T09:29:33.000Z
from rdkit import Chem from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions molecules = open('glucose_degradation_output.csv','r') lines = molecules.readlines() counter = 0 with open('Glucose_Desc.csv', 'w') as the_file: the_file.write("Generation,Id,NumStereoIsomers"+'\n') ...
33.352941
94
0.730159
from rdkit import Chem from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions molecules = open('glucose_degradation_output.csv','r') lines = molecules.readlines() counter = 0 with open('Glucose_Desc.csv', 'w') as the_file: the_file.write("Generation,Id,NumStereoIsomers"+'\n') ...
true
true
79057c05cf4261cfbc8bca3de4c15b352a44373a
1,478
py
Python
tests/integration/location/test_location_logout.py
Joeyt1008/dash-core-components
c806ea66eb5b674ef84fd9efae01cfa5292f143e
[ "MIT" ]
null
null
null
tests/integration/location/test_location_logout.py
Joeyt1008/dash-core-components
c806ea66eb5b674ef84fd9efae01cfa5292f143e
[ "MIT" ]
null
null
null
tests/integration/location/test_location_logout.py
Joeyt1008/dash-core-components
c806ea66eb5b674ef84fd9efae01cfa5292f143e
[ "MIT" ]
null
null
null
import dash from dash.dependencies import Input, Output from dash.exceptions import PreventUpdate import dash_core_components as dcc import dash_html_components as html import flask import time def test_llgo001_location_logout(dash_dcc): app = dash.Dash(__name__) @app.server.route("/_logout", methods=["POST"...
28.980392
85
0.656292
import dash from dash.dependencies import Input, Output from dash.exceptions import PreventUpdate import dash_core_components as dcc import dash_html_components as html import flask import time def test_llgo001_location_logout(dash_dcc): app = dash.Dash(__name__) @app.server.route("/_logout", methods=["POST"...
true
true
79057c2b7bd9133f76d3760604909e6f651db56c
2,461
py
Python
cog/plugins/esgf/objects.py
William-Hill/COG
4f87fa7cb19d67ee27bae3b991be73427ee449bf
[ "BSD-3-Clause" ]
6
2016-03-10T19:38:17.000Z
2021-02-23T09:34:59.000Z
cog/plugins/esgf/objects.py
William-Hill/COG
4f87fa7cb19d67ee27bae3b991be73427ee449bf
[ "BSD-3-Clause" ]
602
2015-01-05T16:30:08.000Z
2021-02-02T21:44:38.000Z
cog/plugins/esgf/objects.py
cedadev/COG
6167f9114c7cf0422b34fb9f5f3f07f9657a7dbe
[ "BSD-3-Clause" ]
18
2015-02-12T15:50:17.000Z
2021-04-27T16:40:36.000Z
''' Module containing python objects matching the ESGF database tables. ''' from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Boolean, ForeignKey from sqlalchemy.orm import relationship Base = declarative_base() ROLE_USER = 'user' ROLE_PUBLISHER = 'publisher' ROL...
30.7625
91
0.697278
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Boolean, ForeignKey from sqlalchemy.orm import relationship Base = declarative_base() ROLE_USER = 'user' ROLE_PUBLISHER = 'publisher' ROLE_ADMIN = 'admin' ROLE_SUPERUSER = 'super' class ESGFUser(Base): __tab...
true
true
79057c456b6e09ef603aef955b42d08da09abfd3
7,570
py
Python
main_algo.py
ikekilinc/Columbus
aa6ff64ecf04d384184998227a2d16003aa2fe60
[ "MIT" ]
null
null
null
main_algo.py
ikekilinc/Columbus
aa6ff64ecf04d384184998227a2d16003aa2fe60
[ "MIT" ]
null
null
null
main_algo.py
ikekilinc/Columbus
aa6ff64ecf04d384184998227a2d16003aa2fe60
[ "MIT" ]
null
null
null
# Columbus - A Smart Navigation System for the Visually-Impaired # Ike Kilinc # This file integrates Columbus' primary start location and destination input # features with its core pathfinding algorithm. This file also facilitates # Columbus' speech recognition and audio functionalities. from speech_to_text import * ...
32.212766
108
0.628666
# features with its core pathfinding algorithm. This file also facilitates # Columbus' speech recognition and audio functionalities. from speech_to_text import * from node_mapper import * from path_finder import *
true
true
79057cdd75a786f5e425e5ce9db0527dc62f7973
12,840
py
Python
irrd/server/graphql/schema_generator.py
morrowc/irrd
8a2af9a6648a73fc3c31d21cf07ef80a49031a14
[ "BSD-2-Clause" ]
null
null
null
irrd/server/graphql/schema_generator.py
morrowc/irrd
8a2af9a6648a73fc3c31d21cf07ef80a49031a14
[ "BSD-2-Clause" ]
1
2021-04-20T14:57:52.000Z
2021-04-20T14:57:52.000Z
irrd/server/graphql/schema_generator.py
morrowc/irrd
8a2af9a6648a73fc3c31d21cf07ef80a49031a14
[ "BSD-2-Clause" ]
null
null
null
from collections import OrderedDict, defaultdict from typing import Optional, Dict, Tuple, List import ariadne from irrd.rpki.status import RPKIStatus from irrd.rpsl.fields import RPSLFieldListMixin, RPSLTextField, RPSLReferenceField from irrd.rpsl.rpsl_objects import (lookup_field_names, OBJECT_CLASS_MAPPING, RPSLAu...
43.822526
146
0.616745
from collections import OrderedDict, defaultdict from typing import Optional, Dict, Tuple, List import ariadne from irrd.rpki.status import RPKIStatus from irrd.rpsl.fields import RPSLFieldListMixin, RPSLTextField, RPSLReferenceField from irrd.rpsl.rpsl_objects import (lookup_field_names, OBJECT_CLASS_MAPPING, RPSLAu...
true
true
79057d644bd6f6676a3e83031a983e2a2886b351
1,030
py
Python
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler041_pandigital_prime.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
5
2021-06-02T23:44:25.000Z
2021-12-27T16:21:57.000Z
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler041_pandigital_prime.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
22
2021-05-31T01:33:25.000Z
2021-10-18T18:32:39.000Z
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler041_pandigital_prime.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
3
2021-06-19T03:37:47.000Z
2021-08-31T00:49:51.000Z
#!/usr/bin/env python """ Solution to Project Euler Problem http://projecteuler.net/ by Apalala <apalala@gmail.com> (cc) Attribution-ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is ...
22.391304
73
0.707767
from digits import is_pandigital from primality import primes_upto, is_prime def pandigital_primes(digits=7): for p in primes_upto(int("9" * digits)): if is_pandigital(p): yield p def test(): assert not is_prime(123) assert not is_prime(132) assert not is_prime(213) assert n...
true
true
79057e3faa199906fcf81398d881cfbc3f238795
2,160
py
Python
tools/doxygen_utils.py
MicrohexHQ/src
c079873c182067002b6a7a5564094ea0a4fe0aef
[ "BSD-3-Clause" ]
2
2019-07-08T11:58:27.000Z
2019-07-08T13:23:57.000Z
tools/doxygen_utils.py
Bia10/src
15b9ab2535222e492cd21b8528c27f763fb799d6
[ "BSD-3-Clause" ]
null
null
null
tools/doxygen_utils.py
Bia10/src
15b9ab2535222e492cd21b8528c27f763fb799d6
[ "BSD-3-Clause" ]
null
null
null
from __future__ import print_function import os import xml.etree.ElementTree as ET def load_xml_for_module(xml_dir_path, module_name, or_dummy=True): xml_tree = ET.Element("dummy") if or_dummy else None for sfx in ["_8hpp", "_8h"]: xml_path = os.path.join(xml_dir_path, "%s%s.xml" % (module_name, sfx))...
40.754717
109
0.622685
from __future__ import print_function import os import xml.etree.ElementTree as ET def load_xml_for_module(xml_dir_path, module_name, or_dummy=True): xml_tree = ET.Element("dummy") if or_dummy else None for sfx in ["_8hpp", "_8h"]: xml_path = os.path.join(xml_dir_path, "%s%s.xml" % (module_name, sfx))...
true
true
79057f7f2c81cfb2c6a87ad7a662320755b5d019
1,449
py
Python
benchmarks/bnb.py
alexchamberlain/mutant
3f4ec0df8b83b2de18766e2c9e1808cff4fd52a9
[ "MIT" ]
3
2019-06-15T13:13:39.000Z
2020-02-07T19:54:12.000Z
benchmarks/bnb.py
alexchamberlain/mutant
3f4ec0df8b83b2de18766e2c9e1808cff4fd52a9
[ "MIT" ]
276
2019-07-03T06:18:37.000Z
2021-07-28T05:24:59.000Z
benchmarks/bnb.py
alexchamberlain/mutant
3f4ec0df8b83b2de18766e2c9e1808cff4fd52a9
[ "MIT" ]
null
null
null
import logging import sys import time from rdflib.graph import Graph from hexastore import turtle from hexastore.memory import InMemoryHexastore logger = logging.getLogger(__name__) root = logging.getLogger() root.setLevel(logging.DEBUG) class Timer: def __enter__(self): self.start = time.perf_counte...
25.421053
93
0.668737
import logging import sys import time from rdflib.graph import Graph from hexastore import turtle from hexastore.memory import InMemoryHexastore logger = logging.getLogger(__name__) root = logging.getLogger() root.setLevel(logging.DEBUG) class Timer: def __enter__(self): self.start = time.perf_counte...
true
true
79057fbb3e6cc4b94d57c855cce54d732abfd431
459
py
Python
ServerScript/recievejson(legacy).py
wmizzi/tn2capstone
e9855ba6b49e2d05293df74846c64fa0c220a25d
[ "BSD-2-Clause" ]
null
null
null
ServerScript/recievejson(legacy).py
wmizzi/tn2capstone
e9855ba6b49e2d05293df74846c64fa0c220a25d
[ "BSD-2-Clause" ]
null
null
null
ServerScript/recievejson(legacy).py
wmizzi/tn2capstone
e9855ba6b49e2d05293df74846c64fa0c220a25d
[ "BSD-2-Clause" ]
null
null
null
#created by Angus Clark on 8/01/2017 # toDo incoperate the saving program into this_dir import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '130.56.253.43' print host # remove when done debugging port = 5201 # edit when port for comm is decided s.bind((host,port)) f = open('temp.json','wb') s...
19.956522
53
0.651416
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '130.56.253.43' print host port = 5201 s.bind((host,port)) f = open('temp.json','wb') s.listen(5) while True: c, addr = s.accept() while(l): f.write(l) l = c.recv(1024) f.close() c.close()
false
true
79057ff8f54339970083c98c62e0ab3da30f4036
11,982
py
Python
example/case_example.py
casework/CASE-API-Python
389a6eb7f0b248aa976b37228923106163e743ae
[ "Apache-2.0" ]
1
2019-11-09T03:45:32.000Z
2019-11-09T03:45:32.000Z
example/case_example.py
casework/CASE-API-Python
389a6eb7f0b248aa976b37228923106163e743ae
[ "Apache-2.0" ]
1
2019-06-28T18:44:46.000Z
2019-06-28T18:44:47.000Z
example/case_example.py
casework/CASE-API-Python
389a6eb7f0b248aa976b37228923106163e743ae
[ "Apache-2.0" ]
null
null
null
# NOTICE # # This software was produced for the U.S. Government under # contract SB-1341-14-CQ-0010, and is subject to the Rights # in Data-General Clause 52.227-14, Alt. IV (DEC 2007) # # (c) 2018 The MITRE Corporation. All Rights Reserved. #==================================================== # CASE API #!/usr/bin...
33.657303
95
0.608746
import datetime import uuid import rdflib from rdflib import RDF CASE = rdflib.Namespace('http://case.example.org/core#') class Document(object): def __init__(self, graph=None): if not graph: graph = rdflib.Graph() graph.namespace_manager.bind('case', CASE) ...
true
true
790580d80b8ef5203e3d00531be7c705e2e0a7bc
813
py
Python
pDeep/config/element.py
zhouxiexuan/pDeep3
3a95dc8d1479df96e491ef68accd775dac46af62
[ "Apache-2.0" ]
10
2020-05-28T17:04:19.000Z
2021-05-13T12:11:22.000Z
pDeep/config/element.py
zhouxiexuan/pDeep3
3a95dc8d1479df96e491ef68accd775dac46af62
[ "Apache-2.0" ]
7
2020-05-21T02:13:05.000Z
2021-02-21T15:29:15.000Z
pDeep/config/element.py
zhouxiexuan/pDeep3
3a95dc8d1479df96e491ef68accd775dac46af62
[ "Apache-2.0" ]
6
2020-02-25T15:53:39.000Z
2021-12-10T03:54:09.000Z
element_list = ["X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "A...
101.625
120
0.306273
element_list = ["X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "A...
true
true
7905813833e1a1d2bd03b59cec4012115c6135a5
702
py
Python
src/decisionengine/framework/modules/tests/test_Publisher.py
moibenko/decisionengine
4c458e0c225ec2ce1e82d56e752724983331b7d1
[ "Apache-2.0" ]
9
2018-06-11T20:06:50.000Z
2020-10-01T17:02:02.000Z
src/decisionengine/framework/modules/tests/test_Publisher.py
moibenko/decisionengine
4c458e0c225ec2ce1e82d56e752724983331b7d1
[ "Apache-2.0" ]
551
2018-06-25T21:06:37.000Z
2022-03-31T13:47:32.000Z
src/decisionengine/framework/modules/tests/test_Publisher.py
goodenou/decisionengine
b203e2c493cf501562accf1013c6257c348711b7
[ "Apache-2.0" ]
70
2018-06-11T20:07:01.000Z
2022-02-10T16:18:24.000Z
# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 from decisionengine.framework.modules.Publisher import Publisher def test_publisher_structure(): """ The module.publisher itself is a bit of a skeleton... """ params = {"1": 1, "2": 2, "channel_name": "t...
31.909091
86
0.706553
from decisionengine.framework.modules.Publisher import Publisher def test_publisher_structure(): params = {"1": 1, "2": 2, "channel_name": "test"} test_publisher = Publisher(params) assert test_publisher.get_parameters() == {"1": 1, "2": 2, "channel_name": "test"} test_publisher.set_data_block("ex...
true
true
7905813c1a802be246df68221752b8b3b9928ce2
733
py
Python
intel_query.py
sudo-rushil/DGA_Intel
6fcdba787dda999661cc2ee4f34da4feacd6e012
[ "MIT" ]
3
2019-11-27T08:06:12.000Z
2020-12-10T06:54:41.000Z
intel_query.py
sudo-rushil/DGA_Intel
6fcdba787dda999661cc2ee4f34da4feacd6e012
[ "MIT" ]
null
null
null
intel_query.py
sudo-rushil/DGA_Intel
6fcdba787dda999661cc2ee4f34da4feacd6e012
[ "MIT" ]
3
2020-07-23T12:47:08.000Z
2021-12-26T23:58:26.000Z
import whois def get_whois(domain): try: query = whois.query(domain) assert isinstance(query, whois._3_adjust.Domain) return query.__dict__ except: pass return None def get_scans(domain): url = "http://" + domain urls = [url] scans = vt.get_url_reports([url])[ur...
22.90625
59
0.601637
import whois def get_whois(domain): try: query = whois.query(domain) assert isinstance(query, whois._3_adjust.Domain) return query.__dict__ except: pass return None def get_scans(domain): url = "http://" + domain urls = [url] scans = vt.get_url_reports([url])[ur...
true
true
7905816a75a88e6c20a927fb765a527b85b73e51
5,050
py
Python
Transfer/YOLOv4-pytorch/eval_voc.py
chakkritte/EEEA-Net
260c2a5c673a806315fc5b529b9c9112c48ca8ae
[ "Apache-2.0" ]
3
2021-08-30T01:36:52.000Z
2021-11-05T07:36:28.000Z
Transfer/YOLOv4-pytorch/eval_voc.py
chakkritte/EEEA-Net
260c2a5c673a806315fc5b529b9c9112c48ca8ae
[ "Apache-2.0" ]
1
2021-11-29T12:00:56.000Z
2021-11-30T04:07:28.000Z
Transfer/YOLOv4-pytorch/eval_voc.py
chakkritte/EEEA-Net
260c2a5c673a806315fc5b529b9c9112c48ca8ae
[ "Apache-2.0" ]
2
2021-08-17T10:06:59.000Z
2021-08-30T01:36:57.000Z
import utils.gpu as gpu from model.build_model import Build_Model from utils.tools import * from eval.evaluator import Evaluator import argparse import time import logging import config.yolov4_config as cfg from utils.visualize import * from utils.torch_utils import * from utils.log import Logger import pooraka as prk ...
39.76378
129
0.577426
import utils.gpu as gpu from model.build_model import Build_Model from utils.tools import * from eval.evaluator import Evaluator import argparse import time import logging import config.yolov4_config as cfg from utils.visualize import * from utils.torch_utils import * from utils.log import Logger import pooraka as prk ...
true
true
7905818eece2f476bcb4cf2567ee243c0368a91d
6,114
py
Python
PythonAPI/carissma_project/PID_apply_static_sp.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
null
null
null
PythonAPI/carissma_project/PID_apply_static_sp.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
null
null
null
PythonAPI/carissma_project/PID_apply_static_sp.py
AbdulHoffmann/carla_carissma
8d382769ffa02a6c61a22c57160285505f5ff0a4
[ "MIT" ]
null
null
null
#!/usr/bin/env python # file trying to apply and test the pid controller on carla. import glob import os import sys import time import matplotlib.pyplot as plt from PID_controller import PID import numpy as np import speed_profile_reader as spr try: sys.path.append(glob.glob('../**/*%d.%d-%s.egg' % ( sys....
33.593407
133
0.564279
import glob import os import sys import time import matplotlib.pyplot as plt from PID_controller import PID import numpy as np import speed_profile_reader as spr try: sys.path.append(glob.glob('../**/*%d.%d-%s.egg' % ( sys.version_info.major, sys.version_info.minor, 'win-amd64' if os.nam...
true
true
790581dc3d8123de9299cda66837fb0fbb9494b3
5,477
py
Python
src/cogs/commands/music.py
Jonak-Adipta-Kalita/JAK-Discord-Bot
9e48654952b603aba581471773a24132f2f228fb
[ "MIT" ]
4
2021-08-31T14:21:25.000Z
2022-03-01T10:01:34.000Z
src/cogs/commands/music.py
Jonak-Adipta-Kalita/JAK-Discord-Bot
9e48654952b603aba581471773a24132f2f228fb
[ "MIT" ]
134
2021-11-03T05:14:07.000Z
2022-03-31T08:06:55.000Z
src/cogs/commands/music.py
Jonak-Adipta-Kalita/JAK-Discord-Bot
9e48654952b603aba581471773a24132f2f228fb
[ "MIT" ]
null
null
null
import disnake, youtube_dl import src.core.embeds as embeds import src.core.functions as funcs from disnake.ext import commands prefix = funcs.get_prefix() class Music(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot @commands.group(invoke_without_command=True, description="Conne...
37.258503
94
0.59266
import disnake, youtube_dl import src.core.embeds as embeds import src.core.functions as funcs from disnake.ext import commands prefix = funcs.get_prefix() class Music(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot @commands.group(invoke_without_command=True, description="Conne...
true
true
79058316b63fb7cef0f0b151c39807830494756e
164
py
Python
03 Variable/cal.py
codewithsandy/Python-Basic-Exp
4c70ada4a042923a94301453c7bd76e704cd2989
[ "MIT" ]
3
2021-05-08T13:11:41.000Z
2021-05-14T02:43:20.000Z
03 Variable/cal.py
codewithsandy/Python-Basic-Exp
4c70ada4a042923a94301453c7bd76e704cd2989
[ "MIT" ]
null
null
null
03 Variable/cal.py
codewithsandy/Python-Basic-Exp
4c70ada4a042923a94301453c7bd76e704cd2989
[ "MIT" ]
null
null
null
print("Enter 1st number") n1 = input() print("Enter 2nd number") n2 = input() print("Sum of Both = ", int(n1) + int(n2)) print("Sum of Both = ", int(n1) + int(n2))
23.428571
42
0.609756
print("Enter 1st number") n1 = input() print("Enter 2nd number") n2 = input() print("Sum of Both = ", int(n1) + int(n2)) print("Sum of Both = ", int(n1) + int(n2))
true
true
79058382308ced0197edcfd3915af02f502fc1d5
1,795
py
Python
Mean_Std_Calculation.py
SkyRd1/Statistical_Functions
3c7a4bba91e43110567f0d2fd1089699d9038206
[ "MIT" ]
null
null
null
Mean_Std_Calculation.py
SkyRd1/Statistical_Functions
3c7a4bba91e43110567f0d2fd1089699d9038206
[ "MIT" ]
null
null
null
Mean_Std_Calculation.py
SkyRd1/Statistical_Functions
3c7a4bba91e43110567f0d2fd1089699d9038206
[ "MIT" ]
null
null
null
#Author: Sepehr Roudini. #Date: 02/05/2018. #University of Iowa. #Department of Chemical Engineering. #Purpose: Calculating mean and Std #--------------------------------------------------------------------------------------------# #Defining function and importing necessary libraries. #----------------------...
48.513514
95
0.262953
true
true
790583b2c3acc0d327043db1ab6d3e03738f5d8d
1,466
py
Python
all_nba_team/api/hardcoded_queries.py
Voldy87/all-nba-team
d7d8eae20f79acfb2b09b419110a79aca1294784
[ "MIT" ]
null
null
null
all_nba_team/api/hardcoded_queries.py
Voldy87/all-nba-team
d7d8eae20f79acfb2b09b419110a79aca1294784
[ "MIT" ]
2
2020-02-11T22:30:42.000Z
2020-06-05T18:12:36.000Z
all_nba_team/api/hardcoded_queries.py
Voldy87/all-nba-team
d7d8eae20f79acfb2b09b419110a79aca1294784
[ "MIT" ]
null
null
null
FRANCHISES = """ select t1.aliases, overall, firsts, seconds, third, y1,y2, unique_a, unique_1, unique_12 from (select Count(A."PlayerID") as overall,T."Aliases" as aliases, MAX(A."year") as y1, MIN(A."year") as y2, Count (distinct A."PlayerID") as unique_a from public."all-nba-teams_list" A, public.teams T where A...
34.904762
147
0.697817
FRANCHISES = """ select t1.aliases, overall, firsts, seconds, third, y1,y2, unique_a, unique_1, unique_12 from (select Count(A."PlayerID") as overall,T."Aliases" as aliases, MAX(A."year") as y1, MIN(A."year") as y2, Count (distinct A."PlayerID") as unique_a from public."all-nba-teams_list" A, public.teams T where A...
true
true
790584b8be63177d5ff89bbdf329e29694e4d791
1,105
py
Python
unittests/gccxml10184_tester.py
iMichka/pygccxml
f872d056f477ed2438cd22b422d60dc924469805
[ "BSL-1.0" ]
null
null
null
unittests/gccxml10184_tester.py
iMichka/pygccxml
f872d056f477ed2438cd22b422d60dc924469805
[ "BSL-1.0" ]
null
null
null
unittests/gccxml10184_tester.py
iMichka/pygccxml
f872d056f477ed2438cd22b422d60dc924469805
[ "BSL-1.0" ]
1
2016-06-17T03:14:31.000Z
2016-06-17T03:14:31.000Z
# Copyright 2014-2017 Insight Software Consortium. # Copyright 2004-2009 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt import unittest import parser_test_case from pygccxml import parser from pygccxml import declarations code = \ """ class...
23.510638
65
0.703167
import unittest import parser_test_case from pygccxml import parser from pygccxml import declarations code = \ """ class A { public: virtual ~A() = 0; unsigned int a : 1; unsigned int unused : 31; }; """ class Test(parser_test_case.parser_test_case_t): def __init__(self, *args): par...
true
true
790586ff84fe73391e4d4066603c78ee07efaaea
4,054
py
Python
mldc/data/schema.py
qkrguswn2401/dstc8-meta-dialog
86a5ecb021719d49fcc5a7cd748984e12eb7e1bf
[ "MIT" ]
76
2019-06-18T13:30:11.000Z
2021-12-25T06:08:05.000Z
mldc/data/schema.py
qkrguswn2401/dstc8-meta-dialog
86a5ecb021719d49fcc5a7cd748984e12eb7e1bf
[ "MIT" ]
6
2019-07-22T22:48:46.000Z
2019-10-02T14:05:47.000Z
mldc/data/schema.py
qkrguswn2401/dstc8-meta-dialog
86a5ecb021719d49fcc5a7cd748984e12eb7e1bf
[ "MIT" ]
13
2019-06-27T06:47:12.000Z
2021-09-13T12:48:37.000Z
"""" defines a class that maps to the JSON input format and can be used with pydantic. """ import json import os import pickle from hashlib import md5 from typing import List, Optional from pydantic import BaseModel from mldc.util import NLGEvalOutput class MetaDlgDataDialog(BaseModel): id: Optional[str] domain:...
31.92126
94
0.695856
import json import os import pickle from hashlib import md5 from typing import List, Optional from pydantic import BaseModel from mldc.util import NLGEvalOutput class MetaDlgDataDialog(BaseModel): id: Optional[str] domain: str = "" task_id: str = "" user_id: str = "" bot_id: str = "" turns: List[str] ...
true
true
790587c615836f82f6c5850b1fa2b6843584abd0
6,548
py
Python
src/trainer.py
CvlabAssignment/WRcan
e77571472f5a3928b1e9cee5440d52f702e59a41
[ "MIT" ]
10
2021-07-27T13:47:10.000Z
2022-03-02T16:41:41.000Z
src/trainer.py
CvlabAssignment/WRcan
e77571472f5a3928b1e9cee5440d52f702e59a41
[ "MIT" ]
null
null
null
src/trainer.py
CvlabAssignment/WRcan
e77571472f5a3928b1e9cee5440d52f702e59a41
[ "MIT" ]
1
2021-09-29T09:37:04.000Z
2021-09-29T09:37:04.000Z
import os import math from decimal import Decimal import utility import torch import torch.nn.utils as utils from tqdm import tqdm class Trainer(): def __init__(self, args, loader, my_model, my_loss, ckp): self.args = args self.scale = args.scale self.ckp = ckp self.loader_train ...
34.645503
105
0.51069
import os import math from decimal import Decimal import utility import torch import torch.nn.utils as utils from tqdm import tqdm class Trainer(): def __init__(self, args, loader, my_model, my_loss, ckp): self.args = args self.scale = args.scale self.ckp = ckp self.loader_train ...
true
true
79058971dea1e3889bf6c81a306c2c5fc18b8adb
21,882
py
Python
virtual/lib/python3.8/site-packages/bootstrap4/renderers.py
devseme/Community-Watch
815c71431db52b85a7b6dc5bb27860c6066a6e4f
[ "MIT" ]
1,060
2017-04-26T10:31:24.000Z
2022-03-29T03:58:00.000Z
virtual/lib/python3.8/site-packages/bootstrap4/renderers.py
devseme/Community-Watch
815c71431db52b85a7b6dc5bb27860c6066a6e4f
[ "MIT" ]
298
2017-05-07T15:20:09.000Z
2022-03-28T09:01:42.000Z
virtual/lib/python3.8/site-packages/bootstrap4/renderers.py
devseme/Community-Watch
815c71431db52b85a7b6dc5bb27860c6066a6e4f
[ "MIT" ]
282
2017-04-26T12:08:43.000Z
2022-02-16T06:06:45.000Z
from bs4 import BeautifulSoup from django.forms import ( BaseForm, BaseFormSet, BoundField, CheckboxInput, CheckboxSelectMultiple, DateInput, EmailInput, FileInput, MultiWidget, NumberInput, PasswordInput, RadioSelect, Select, SelectDateWidget, TextInput, ...
39.285458
119
0.621744
from bs4 import BeautifulSoup from django.forms import ( BaseForm, BaseFormSet, BoundField, CheckboxInput, CheckboxSelectMultiple, DateInput, EmailInput, FileInput, MultiWidget, NumberInput, PasswordInput, RadioSelect, Select, SelectDateWidget, TextInput, ...
true
true
790589baeb8d74e89e928166764ecb0c256021a8
565
py
Python
Python OOP/test.py
zharmedia386/Data-Science-Stuff
40183c329e3b30c582c545c260ca7916f29e2f09
[ "MIT" ]
null
null
null
Python OOP/test.py
zharmedia386/Data-Science-Stuff
40183c329e3b30c582c545c260ca7916f29e2f09
[ "MIT" ]
null
null
null
Python OOP/test.py
zharmedia386/Data-Science-Stuff
40183c329e3b30c582c545c260ca7916f29e2f09
[ "MIT" ]
null
null
null
class Hero: def __init__(self,name,health,attackPower): self.__name = name self.__health = health self.__attPower = attackPower # getter def getName(self): return self.__name def getHealth(self): return self.__health # setter def diserang(self,serangPower): self.__health -= serangPower def setA...
18.225806
44
0.748673
class Hero: def __init__(self,name,health,attackPower): self.__name = name self.__health = health self.__attPower = attackPower def getName(self): return self.__name def getHealth(self): return self.__health def diserang(self,serangPower): self.__health -= serangPower def setAttPower(self,nil...
true
true
79058bec3f80261eb2e0bae4d5f0d39cd0b75db9
5,987
py
Python
tests/image/segmentation/test_model.py
sumanmichael/lightning-flash
4c69c1bf49fa74d0f2fdb9c4dbdcdfd5942352db
[ "Apache-2.0" ]
null
null
null
tests/image/segmentation/test_model.py
sumanmichael/lightning-flash
4c69c1bf49fa74d0f2fdb9c4dbdcdfd5942352db
[ "Apache-2.0" ]
null
null
null
tests/image/segmentation/test_model.py
sumanmichael/lightning-flash
4c69c1bf49fa74d0f2fdb9c4dbdcdfd5942352db
[ "Apache-2.0" ]
1
2021-07-14T09:17:46.000Z
2021-07-14T09:17:46.000Z
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
34.408046
103
0.719559
import os import re from typing import Tuple from unittest import mock import numpy as np import pytest import torch from flash import Trainer from flash.__main__ import main from flash.core.data.data_pipeline import DataPipeline from flash.core.data.data_source import DefaultDataKeys from flash.core.uti...
true
true
79058bef7a99d4d4210fb03d8456134c3422b2ee
29,968
py
Python
mmdet/models/roi_heads/bbox_heads/convfc_bbox_head.py
marcovalenti/mmdetection
215ea4174c1234ac4c3e23bf29020fc1cefc36ad
[ "Apache-2.0" ]
1
2021-09-30T11:30:40.000Z
2021-09-30T11:30:40.000Z
mmdet/models/roi_heads/bbox_heads/convfc_bbox_head.py
marcovalenti/mmdetection
215ea4174c1234ac4c3e23bf29020fc1cefc36ad
[ "Apache-2.0" ]
null
null
null
mmdet/models/roi_heads/bbox_heads/convfc_bbox_head.py
marcovalenti/mmdetection
215ea4174c1234ac4c3e23bf29020fc1cefc36ad
[ "Apache-2.0" ]
null
null
null
import torch.nn as nn import torch.nn.functional as F import torch from mmcv.cnn import ConvModule from mmcv.runner import force_fp32 from mmdet.models.builder import HEADS, build_loss from mmdet.models.losses import accuracy from .bbox_head import BBoxHead from mmdet.core import multi_apply, multiclass_nms from mmd...
45.200603
154
0.521523
import torch.nn as nn import torch.nn.functional as F import torch from mmcv.cnn import ConvModule from mmcv.runner import force_fp32 from mmdet.models.builder import HEADS, build_loss from mmdet.models.losses import accuracy from .bbox_head import BBoxHead from mmdet.core import multi_apply, multiclass_nms from mmd...
true
true
79058c9537ecebf0b7ca925ac34b01a00b522dcd
2,405
py
Python
telethon/sync.py
bb010g/Telethon
278f0e9e983d938589b6d541e71135ad5b6857c5
[ "MIT" ]
2
2021-04-29T14:19:25.000Z
2021-09-17T07:13:49.000Z
telethon/sync.py
exceloo/Telethon
30a0e390603072d3ec57a2f0eef0a297a9b0321b
[ "MIT" ]
5
2021-04-30T21:14:18.000Z
2022-03-12T00:21:58.000Z
telethon/sync.py
exceloo/Telethon
30a0e390603072d3ec57a2f0eef0a297a9b0321b
[ "MIT" ]
1
2020-04-16T22:02:26.000Z
2020-04-16T22:02:26.000Z
""" This magical module will rewrite all public methods in the public interface of the library so they can run the loop on their own if it's not already running. This rewrite may not be desirable if the end user always uses the methods they way they should be ran, but it's incredibly useful for quick scripts and the ru...
33.873239
79
0.710603
import asyncio import functools import inspect from . import connection from .client.account import _TakeoutClient from .client.telegramclient import TelegramClient from .tl import types, functions, custom from .tl.custom import ( Draft, Dialog, MessageButton, Forward, Button, Message, InlineResult, Conversati...
true
true
79058e1b90023f1994f12d9db036003e0c9f794e
6,506
py
Python
utils.py
smtnkc/gcn4epi
2b9dd973b2d5120f618d3c36e8aa9d7d4a4e6b69
[ "MIT" ]
null
null
null
utils.py
smtnkc/gcn4epi
2b9dd973b2d5120f618d3c36e8aa9d7d4a4e6b69
[ "MIT" ]
null
null
null
utils.py
smtnkc/gcn4epi
2b9dd973b2d5120f618d3c36e8aa9d7d4a4e6b69
[ "MIT" ]
null
null
null
import numpy as np import pickle as pkl import networkx as nx import scipy.sparse as sp from scipy.sparse.linalg.eigen.arpack import eigsh def sample_mask(idx, l): """Create mask.""" mask = np.zeros(l) mask[idx] = 1 return np.array(mask, dtype=np.bool) def load_data(cell_line, cross_cell_line, label...
36.144444
114
0.67553
import numpy as np import pickle as pkl import networkx as nx import scipy.sparse as sp from scipy.sparse.linalg.eigen.arpack import eigsh def sample_mask(idx, l): mask = np.zeros(l) mask[idx] = 1 return np.array(mask, dtype=np.bool) def load_data(cell_line, cross_cell_line, label_rate, k_mer): if ...
true
true
79058e7e2837f17f953fc9a88bbe6347313214c1
640
py
Python
src/util/summary_logging.py
wooseoklee4/AP-BSN
210013cfe0657e678e4b940fd4d5719ac0ac87c6
[ "MIT" ]
8
2022-03-23T08:07:19.000Z
2022-03-30T17:08:17.000Z
src/util/summary_logging.py
wooseoklee4/AP-BSN
210013cfe0657e678e4b940fd4d5719ac0ac87c6
[ "MIT" ]
1
2022-03-25T13:26:58.000Z
2022-03-26T10:35:04.000Z
src/util/summary_logging.py
wooseoklee4/AP-BSN
210013cfe0657e678e4b940fd4d5719ac0ac87c6
[ "MIT" ]
1
2022-03-29T03:34:38.000Z
2022-03-29T03:34:38.000Z
import time from torch.utils.tensorboard import SummaryWriter import numpy as np class LossWriter(SummaryWriter): def __init__(self, log_dir=None, comment=''): if log_dir == None: log_dir = './logs/tensorboard/' + time.strftime('%Y-%m-%d--%H-%M-%S', time.localtime(time.time())) super(...
29.090909
110
0.676563
import time from torch.utils.tensorboard import SummaryWriter import numpy as np class LossWriter(SummaryWriter): def __init__(self, log_dir=None, comment=''): if log_dir == None: log_dir = './logs/tensorboard/' + time.strftime('%Y-%m-%d--%H-%M-%S', time.localtime(time.time())) super(...
true
true
79058ebaf9276f397750a8afd5394d8d67191355
2,324
py
Python
test/test_get_import_data_response.py
idaholab/Deep-Lynx-Python-Package
99927cc877eba8e2ee396feec807da1c48c64893
[ "MIT" ]
3
2021-06-16T20:34:41.000Z
2021-06-16T23:54:36.000Z
test/test_get_import_data_response.py
idaholab/Deep-Lynx-Python-Package
99927cc877eba8e2ee396feec807da1c48c64893
[ "MIT" ]
null
null
null
test/test_get_import_data_response.py
idaholab/Deep-Lynx-Python-Package
99927cc877eba8e2ee396feec807da1c48c64893
[ "MIT" ]
null
null
null
# coding: utf-8 """ Deep Lynx The construction of megaprojects has consistently demonstrated challenges for project managers in regard to meeting cost, schedule, and performance requirements. Megaproject construction challenges are common place within megaprojects with many active projects in the United State...
58.1
1,455
0.790017
from __future__ import absolute_import import unittest import swagger_client from swagger_client.models.get_import_data_response import GetImportDataResponse from swagger_client.rest import ApiException class TestGetImportDataResponse(unittest.TestCase): def setUp(self): pass def tearDown(sel...
true
true
79058f13bf14612075f27b34498a476ca0a7c841
35,496
py
Python
alphazero/network/policies.py
timoklein/A0C
2825193f424bd5b74b654c929ef73775b0914ee5
[ "MIT" ]
6
2021-02-17T18:04:17.000Z
2022-02-15T11:08:22.000Z
alphazero/network/policies.py
timoklein/A0C
2825193f424bd5b74b654c929ef73775b0914ee5
[ "MIT" ]
1
2021-08-15T12:19:33.000Z
2021-08-23T16:41:43.000Z
alphazero/network/policies.py
timoklein/A0C
2825193f424bd5b74b654c929ef73775b0914ee5
[ "MIT" ]
1
2021-09-28T03:47:53.000Z
2021-09-28T03:47:53.000Z
from typing import ClassVar, List, Optional, Tuple, Callable, Union, cast import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as D from alphazero.network.distributions import SquashedNormal, GeneralizedBeta from alphazero.network.utils import ( _map_nonli...
38.708833
130
0.647087
from typing import ClassVar, List, Optional, Tuple, Callable, Union, cast import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as D from alphazero.network.distributions import SquashedNormal, GeneralizedBeta from alphazero.network.utils import ( _map_nonli...
true
true
79058f2911553e7e243d913a93293fd27deb9840
10,499
py
Python
tests/test_cufft.py
ajkxyz/cuda4py
3f04dd5d72d64e5bd68dee91de1193a7bb6e8033
[ "BSD-2-Clause-FreeBSD" ]
8
2016-03-12T00:36:04.000Z
2017-04-17T22:44:11.000Z
tests/test_cufft.py
Samsung/cuda4py
3f04dd5d72d64e5bd68dee91de1193a7bb6e8033
[ "BSD-2-Clause-FreeBSD" ]
2
2017-02-12T21:03:57.000Z
2020-11-13T13:34:29.000Z
tests/test_cufft.py
Samsung/cuda4py
3f04dd5d72d64e5bd68dee91de1193a7bb6e8033
[ "BSD-2-Clause-FreeBSD" ]
4
2016-03-05T04:40:37.000Z
2020-02-12T18:37:27.000Z
""" Copyright (c) 2014, Samsung Electronics Co.,Ltd. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and...
39.768939
79
0.620916
import cuda4py as cu import cuda4py.cufft as cufft import gc import logging import numpy import os import unittest class Test(unittest.TestCase): def setUp(self): logging.basicConfig(level=logging.DEBUG) self.old_env = os.environ.get("CUDA_DEVICE") if self.old_env is None: os...
true
true
79058f4721ac290d415e6df94c9376327041466d
2,470
py
Python
app/core/migrations/0001_initial.py
ergauravsoni/final-year-backend
473ba9e75101d25f41adfe0b756344ec23fa413c
[ "MIT" ]
null
null
null
app/core/migrations/0001_initial.py
ergauravsoni/final-year-backend
473ba9e75101d25f41adfe0b756344ec23fa413c
[ "MIT" ]
null
null
null
app/core/migrations/0001_initial.py
ergauravsoni/final-year-backend
473ba9e75101d25f41adfe0b756344ec23fa413c
[ "MIT" ]
null
null
null
# Generated by Django 3.2.4 on 2021-07-04 11:51 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter_user_first_name_max_length'), ] operations ...
51.458333
266
0.631174
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter_user_first_name_max_length'), ] operations = [ migrations.CreateModel( ...
true
true
79058f7ac41742757c7d9d6f859988cc9b35f5f5
2,369
py
Python
test/test_no_ssl.py
balabit-deps/balabit-os-6-python-urllib3
03fadded88b3631953f261ca8ed91121ee5383d1
[ "MIT" ]
6
2017-10-25T14:19:18.000Z
2021-11-15T10:22:21.000Z
test/test_no_ssl.py
balabit-deps/balabit-os-6-python-urllib3
03fadded88b3631953f261ca8ed91121ee5383d1
[ "MIT" ]
2
2018-09-04T20:59:45.000Z
2018-09-07T09:36:30.000Z
test/test_no_ssl.py
balabit-deps/balabit-os-6-python-urllib3
03fadded88b3631953f261ca8ed91121ee5383d1
[ "MIT" ]
9
2017-10-25T14:19:24.000Z
2022-01-31T17:09:16.000Z
""" Test what happens if Python was built without SSL * Everything that does not involve HTTPS should still work * HTTPS requests must fail with an error that points at the ssl module """ import sys import unittest class ImportBlocker(object): """ Block Imports To be placed on ``sys.meta_path``. This e...
26.322222
79
0.653018
import sys import unittest class ImportBlocker(object): def __init__(self, *namestoblock): self.namestoblock = namestoblock def find_module(self, fullname, path=None): if fullname in self.namestoblock: return self return None def load_module(self, fullname): ...
true
true
79058f9802c3b5bba3732dfd902a4855f279dbaa
297
py
Python
py25/bacpypes/service/test.py
amih90/bacpypes
27ab4f18aa252ceb6ffdc32d53af2995a2e92647
[ "MIT" ]
240
2015-07-17T16:27:54.000Z
2022-03-29T13:53:06.000Z
py25/bacpypes/service/test.py
amih90/bacpypes
27ab4f18aa252ceb6ffdc32d53af2995a2e92647
[ "MIT" ]
400
2015-07-23T05:37:52.000Z
2022-03-29T12:32:30.000Z
py25/bacpypes/service/test.py
amih90/bacpypes
27ab4f18aa252ceb6ffdc32d53af2995a2e92647
[ "MIT" ]
143
2015-07-17T18:22:27.000Z
2022-03-22T01:21:24.000Z
#!/usr/bin/env python """ Test Service """ from ..debugging import bacpypes_debugging, ModuleLogger # some debugging _debug = 0 _log = ModuleLogger(globals()) def some_function(*args): if _debug: some_function._debug("f %r", args) return args[0] + 1 bacpypes_debugging(some_function)
16.5
56
0.720539
from ..debugging import bacpypes_debugging, ModuleLogger _debug = 0 _log = ModuleLogger(globals()) def some_function(*args): if _debug: some_function._debug("f %r", args) return args[0] + 1 bacpypes_debugging(some_function)
true
true
7905910cd437177895c7ea56ca90edf0ff9764a1
2,668
py
Python
qtensor/optimisation/RGreedy.py
marwahaha/QTensor
936d078825a6418f9d32d2c176332422d8a4c137
[ "BSD-3-Clause" ]
20
2020-09-08T20:32:44.000Z
2022-03-18T11:27:57.000Z
qtensor/optimisation/RGreedy.py
marwahaha/QTensor
936d078825a6418f9d32d2c176332422d8a4c137
[ "BSD-3-Clause" ]
21
2020-10-09T04:44:48.000Z
2021-10-05T03:32:35.000Z
qtensor/optimisation/RGreedy.py
marwahaha/QTensor
936d078825a6418f9d32d2c176332422d8a4c137
[ "BSD-3-Clause" ]
4
2020-12-18T01:37:10.000Z
2021-07-26T21:24:20.000Z
import numpy as np import copy, operator from qtensor.optimisation.Optimizer import OrderingOptimizer from qtensor import utils from functools import reduce import networkx as nx import qtree def reducelist(f, lst, x=0): prev = x for i in lst: prev = f(prev, i) yield prev class RGreedyOptimize...
34.205128
90
0.552099
import numpy as np import copy, operator from qtensor.optimisation.Optimizer import OrderingOptimizer from qtensor import utils from functools import reduce import networkx as nx import qtree def reducelist(f, lst, x=0): prev = x for i in lst: prev = f(prev, i) yield prev class RGreedyOptimize...
true
true
790591255c8418d80b1a9a3e1c9688f36153f42d
10,225
py
Python
env/lib/python3.8/site-packages/plotly/graph_objs/scatter3d/_textfont.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
11,750
2015-10-12T07:03:39.000Z
2022-03-31T20:43:15.000Z
env/lib/python3.8/site-packages/plotly/graph_objs/scatter3d/_textfont.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
2,951
2015-10-12T00:41:25.000Z
2022-03-31T22:19:26.000Z
env/lib/python3.8/site-packages/plotly/graph_objs/scatter3d/_textfont.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
2,623
2015-10-15T14:40:27.000Z
2022-03-28T16:05:50.000Z
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatter3d" _path_str = "scatter3d.textfont" _valid_props = {"color", "colorsrc", "family",...
34.427609
82
0.557653
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): _parent_path_str = "scatter3d" _path_str = "scatter3d.textfont" _valid_props = {"color", "colorsrc", "family", "size", "sizesrc"} @prop...
true
true
7905919d08d1078de9d56ab3d9bf43e0af85b7de
3,582
py
Python
conda/_vendor/auxlib/collection.py
peschue/conda
dc25e8c8765c5dfd1f99d697617bc6148224e194
[ "BSD-3-Clause" ]
1
2018-12-21T22:11:55.000Z
2018-12-21T22:11:55.000Z
conda/_vendor/auxlib/collection.py
peschue/conda
dc25e8c8765c5dfd1f99d697617bc6148224e194
[ "BSD-3-Clause" ]
1
2019-04-02T23:35:13.000Z
2019-04-02T23:35:13.000Z
conda/_vendor/auxlib/collection.py
peschue/conda
dc25e8c8765c5dfd1f99d697617bc6148224e194
[ "BSD-3-Clause" ]
2
2018-03-02T19:55:14.000Z
2019-02-14T22:37:28.000Z
# -*- coding: utf-8 -*- """Common collection classes.""" from __future__ import print_function, division, absolute_import from functools import reduce from collections import Mapping, Set from .compat import isiterable, iteritems, odict, text_type def make_immutable(value): # this function is recursive, and if n...
30.355932
95
0.595757
from __future__ import print_function, division, absolute_import from functools import reduce from collections import Mapping, Set from .compat import isiterable, iteritems, odict, text_type def make_immutable(value): if isinstance(value, Mapping): if isinstance(value, frozendict): ...
true
true
7905920f96a2533d5e180884ee6a4c005481232a
15,464
py
Python
plugins/modules/oci_vault_secret_actions.py
hanielburton/oci-ansible-collection
dfdffde637f746d346ba35569be8c3a3407022f2
[ "Apache-2.0" ]
null
null
null
plugins/modules/oci_vault_secret_actions.py
hanielburton/oci-ansible-collection
dfdffde637f746d346ba35569be8c3a3407022f2
[ "Apache-2.0" ]
null
null
null
plugins/modules/oci_vault_secret_actions.py
hanielburton/oci-ansible-collection
dfdffde637f746d346ba35569be8c3a3407022f2
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # Copyright (c) 2017, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
41.237333
159
0.620215
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { "metadata_version": "1.1", "status": ["preview"], "supported_by": "community", } DOCUMENTATION = """ --- module: oci_vault_secret_actions short_description: Perform actions on a Secret reso...
true
true
790592a6e26ff673eddd59f451cc08a38e138677
1,136
py
Python
tests/unit/utils/test_youtube.py
ConorSheehan1/YouTubeTimestampRedditBot
5f36d96f6dca2d5f42b4c4d121008097c1c4f537
[ "MIT" ]
1
2021-12-31T15:38:55.000Z
2021-12-31T15:38:55.000Z
tests/unit/utils/test_youtube.py
ConorSheehan1/YouTubeTimestampRedditBot
5f36d96f6dca2d5f42b4c4d121008097c1c4f537
[ "MIT" ]
1
2022-01-17T18:48:12.000Z
2022-01-17T18:48:12.000Z
tests/unit/utils/test_youtube.py
ConorSheehan1/YouTubeTimestampRedditBot
5f36d96f6dca2d5f42b4c4d121008097c1c4f537
[ "MIT" ]
null
null
null
# Standard Library import unittest # YouTubeTimestampRedditBot from src.utils.youtube import is_youtube_url_without_timestamp class Youtube(unittest.TestCase): def test_is_youtube_url_without_timestamp(self): dicts = [ # no timestamps {"input": "https://youtube.com/asdf", "expecte...
39.172414
88
0.582746
import unittest from src.utils.youtube import is_youtube_url_without_timestamp class Youtube(unittest.TestCase): def test_is_youtube_url_without_timestamp(self): dicts = [ {"input": "https://youtube.com/asdf", "expected_output": True}, {"input": "wwww.youtube.com/as...
true
true
790592ca158e7920ce9710711ea9d87850f00b5e
4,040
py
Python
samples/v1/language_entities_gcs.py
busunkim96/python-language
f16bd6dae66990516320941748325b59f4eeebc6
[ "Apache-2.0" ]
null
null
null
samples/v1/language_entities_gcs.py
busunkim96/python-language
f16bd6dae66990516320941748325b59f4eeebc6
[ "Apache-2.0" ]
40
2019-07-16T10:04:48.000Z
2020-01-20T09:04:59.000Z
samples/v1/language_entities_gcs.py
busunkim96/python-language
f16bd6dae66990516320941748325b59f4eeebc6
[ "Apache-2.0" ]
2
2019-07-18T00:05:31.000Z
2019-11-27T14:17:22.000Z
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
38.113208
120
0.70297
from google.cloud import language_v1 from google.cloud.language_v1 import enums def sample_analyze_entities(gcs_content_uri): client = language_v1.LanguageServiceClient() type_ = enums.Document.Type.PLAIN_TEXT language = "en" document = {"gcs_con...
true
true
7905931b1d56097f7faadcc6929bf37a6fd624b9
3,396
py
Python
azure/mgmt/monitor/models/rule_management_event_data_source.py
EnjoyLifeFund/py36pkgs
0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
2
2020-07-29T14:22:17.000Z
2020-11-06T18:47:40.000Z
azure/mgmt/monitor/models/rule_management_event_data_source.py
EnjoyLifeFund/py36pkgs
0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
1
2016-08-01T07:37:04.000Z
2016-08-01T07:37:04.000Z
azure/mgmt/monitor/models/rule_management_event_data_source.py
EnjoyLifeFund/py36pkgs
0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
1
2020-12-12T21:04:41.000Z
2020-12-12T21:04:41.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
44.103896
209
0.659305
from .rule_data_source import RuleDataSource class RuleManagementEventDataSource(RuleDataSource): _validation = { 'odatatype': {'required': True}, } _attribute_map = { 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, 'odatatype': {'key': 'odata\\.type', 'type': '...
true
true
790593cfe62b7bcbe5c632cb438fd0aadd8ff5d1
621
py
Python
exit/losses.py
exitudio/neural-network-pytorch
2831eb92d396187cc0e043234c2dfd17fc83ae3b
[ "MIT" ]
null
null
null
exit/losses.py
exitudio/neural-network-pytorch
2831eb92d396187cc0e043234c2dfd17fc83ae3b
[ "MIT" ]
null
null
null
exit/losses.py
exitudio/neural-network-pytorch
2831eb92d396187cc0e043234c2dfd17fc83ae3b
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod import numpy as np from .constants import EPSILON import torch class Loss(ABC): def __init__(self, expected_output, predict_output): self._expected_output = expected_output self._predict_output = predict_output @abstractmethod def get_loss(self): ...
25.875
78
0.724638
from abc import ABC, abstractmethod import numpy as np from .constants import EPSILON import torch class Loss(ABC): def __init__(self, expected_output, predict_output): self._expected_output = expected_output self._predict_output = predict_output @abstractmethod def get_loss(self): ...
true
true