hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f710230f2cb958286fd2cd383520343ffe344500
1,403
py
Python
tests/utils/test_phone_numbers.py
Silvian/attendance-processor
b40eacf7fe8ab9473f7a75a8c8e0cc7ac03fb507
[ "MIT" ]
1
2020-10-29T13:07:25.000Z
2020-10-29T13:07:25.000Z
tests/utils/test_phone_numbers.py
Silvian/attendance-processor
b40eacf7fe8ab9473f7a75a8c8e0cc7ac03fb507
[ "MIT" ]
null
null
null
tests/utils/test_phone_numbers.py
Silvian/attendance-processor
b40eacf7fe8ab9473f7a75a8c8e0cc7ac03fb507
[ "MIT" ]
null
null
null
import pytest from utils.phone_numbers import fix_number_formatting, validate_phone_number @pytest.mark.parametrize( "number, expected_result", [ ("7446123456", "07446123456"), # Test number with missing 0 ("07446123456", "07446123456"), # Test number no spaces ("07446 123456", "07...
37.918919
95
0.680684
import pytest from utils.phone_numbers import fix_number_formatting, validate_phone_number @pytest.mark.parametrize( "number, expected_result", [ ("7446123456", "07446123456"), ("07446123456", "07446123456"), ("07446 123456", "07446123456"), ("+447446123456", "+44744612...
true
true
f71023e323fa23d2cf2eaffc7221a695ba60060f
20,092
py
Python
disnake/ext/commands/bot_base.py
MisileLab/disnake
c7f6a61f2fe2a05cb57027486d6f2cd7fe5399fa
[ "MIT" ]
null
null
null
disnake/ext/commands/bot_base.py
MisileLab/disnake
c7f6a61f2fe2a05cb57027486d6f2cd7fe5399fa
[ "MIT" ]
null
null
null
disnake/ext/commands/bot_base.py
MisileLab/disnake
c7f6a61f2fe2a05cb57027486d6f2cd7fe5399fa
[ "MIT" ]
null
null
null
""" The MIT License (MIT) Copyright (c) 2015-2021 Rapptz Copyright (c) 2021-present Disnake Development 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 limi...
33.375415
96
0.616016
from __future__ import annotations import asyncio import collections import collections.abc import inspect import sys import traceback from typing import Any, Callable, List, TYPE_CHECKING, Optional, TypeVar, Type, Union import disnake from .core import GroupMixin from .view import StringView from .context import ...
true
true
f71024eea5e98c7df524c35442bced80a11680cf
2,316
py
Python
dyndns.py
jkeuper/transip_dyndns
4a1d778b72f0a762f97bdaae16192b8216e99cea
[ "MIT" ]
null
null
null
dyndns.py
jkeuper/transip_dyndns
4a1d778b72f0a762f97bdaae16192b8216e99cea
[ "MIT" ]
null
null
null
dyndns.py
jkeuper/transip_dyndns
4a1d778b72f0a762f97bdaae16192b8216e99cea
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import sys import argparse from requests import get from transip_rest_client import TransipRestClient def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="DynDNS: Updates a DNS record for a dynamic IP address.") parser.add_argument("-u", "--user", help="Your ...
35.630769
106
0.648964
import sys import argparse from requests import get from transip_rest_client import TransipRestClient def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="DynDNS: Updates a DNS record for a dynamic IP address.") parser.add_argument("-u", "--user", help="Your username.", required=T...
true
true
f7102601e30fef5f8d8eff91e5adb145e938c0cf
4,105
py
Python
kivy/tests/test_widget.py
yunus-ceyhan/kivy
ba646bd82c8eb5c505c68d18de52f8f3e6cf199a
[ "MIT" ]
1
2022-02-06T11:20:43.000Z
2022-02-06T11:20:43.000Z
kivy/tests/test_widget.py
yunus-ceyhan/kivy
ba646bd82c8eb5c505c68d18de52f8f3e6cf199a
[ "MIT" ]
null
null
null
kivy/tests/test_widget.py
yunus-ceyhan/kivy
ba646bd82c8eb5c505c68d18de52f8f3e6cf199a
[ "MIT" ]
1
2022-01-19T09:10:47.000Z
2022-01-19T09:10:47.000Z
import unittest from tempfile import mkdtemp from shutil import rmtree class WidgetTestCase(unittest.TestCase): def setUp(self): from kivy.uix.widget import Widget self.cls = Widget self.root = Widget() def test_add_remove_widget(self): root = self.root self.assertEqu...
32.070313
74
0.60268
import unittest from tempfile import mkdtemp from shutil import rmtree class WidgetTestCase(unittest.TestCase): def setUp(self): from kivy.uix.widget import Widget self.cls = Widget self.root = Widget() def test_add_remove_widget(self): root = self.root self.assertEqu...
true
true
f71026672a7680d364cfb68c1f7b6f4ab8b30417
3,152
py
Python
trader/batch/non_fork_worker.py
9600dev/mmr
b08e63b7044f2b2061d8679b216822c82d309c86
[ "Apache-2.0" ]
12
2021-09-22T21:19:23.000Z
2022-01-03T21:38:47.000Z
trader/batch/non_fork_worker.py
9600dev/mmr
b08e63b7044f2b2061d8679b216822c82d309c86
[ "Apache-2.0" ]
null
null
null
trader/batch/non_fork_worker.py
9600dev/mmr
b08e63b7044f2b2061d8679b216822c82d309c86
[ "Apache-2.0" ]
3
2021-09-05T23:26:13.000Z
2022-03-25T01:01:22.000Z
import time import sys import random import datetime import rq import rq.job import rq.compat import rq.worker from rq.defaults import (DEFAULT_LOGGING_FORMAT, DEFAULT_LOGGING_DATE_FORMAT) class NonForkWorker(rq.Worker): def __init__(self, *args, **kwargs): if kwargs.get('default_worker_ttl', None) is N...
33.178947
95
0.611675
import time import sys import random import datetime import rq import rq.job import rq.compat import rq.worker from rq.defaults import (DEFAULT_LOGGING_FORMAT, DEFAULT_LOGGING_DATE_FORMAT) class NonForkWorker(rq.Worker): def __init__(self, *args, **kwargs): if kwargs.get('default_worker_ttl', None) is N...
true
true
f710267bb6eaca71d34daef2c77ac942970d7e2a
2,601
py
Python
setup.py
groupserver/gs.site.change.name
fdf9a6d2ea2b49c98f5fe0f88ba1de06c57ff052
[ "ZPL-2.1" ]
null
null
null
setup.py
groupserver/gs.site.change.name
fdf9a6d2ea2b49c98f5fe0f88ba1de06c57ff052
[ "ZPL-2.1" ]
null
null
null
setup.py
groupserver/gs.site.change.name
fdf9a6d2ea2b49c98f5fe0f88ba1de06c57ff052
[ "ZPL-2.1" ]
null
null
null
# -*- coding: utf-8 -*- ############################################################################ # # Copyright © 2011, 2012, 2013, 2014, 2015 OnlineGroups.net and # Contributors. # # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the Z...
33.346154
76
0.595925
true
true
f71028c1481c1fcee06411fa05f09fe527e33b31
50,356
py
Python
codegen/cpp_codegen.py
ardovm/wxGlade
a4cf8e65bcc6df5f65cf8ca5c49b9a628bf1e8eb
[ "MIT" ]
null
null
null
codegen/cpp_codegen.py
ardovm/wxGlade
a4cf8e65bcc6df5f65cf8ca5c49b9a628bf1e8eb
[ "MIT" ]
null
null
null
codegen/cpp_codegen.py
ardovm/wxGlade
a4cf8e65bcc6df5f65cf8ca5c49b9a628bf1e8eb
[ "MIT" ]
null
null
null
"""\ C++ code generator @copyright: 2002-2007 Alberto Griggio @copyright: 2012-2016 Carsten Grohmann @copyright: 2017-2020 Dietmar Schwertberger @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import os.path, re, logging from codegen import BaseLangCodeWriter, BaseSourceFileContent, _repla...
45.243486
120
0.558901
import os.path, re, logging from codegen import BaseLangCodeWriter, BaseSourceFileContent, _replace_tag from codegen import ClassLines as BaseClassLines import config, wcodegen class SourceFileContent(BaseSourceFileContent): rec_block_start = re.compile( r'^(?P<spaces>\s*)' ...
true
true
f710299efd3e51d5e4b2e5cd7c0de74cacf615c7
3,230
py
Python
tests/calendar_models_test.py
C4theBomb/python-calendar-app
6776403f7f2440c6497d9a53be5e8d617a2ee817
[ "MIT" ]
null
null
null
tests/calendar_models_test.py
C4theBomb/python-calendar-app
6776403f7f2440c6497d9a53be5e8d617a2ee817
[ "MIT" ]
null
null
null
tests/calendar_models_test.py
C4theBomb/python-calendar-app
6776403f7f2440c6497d9a53be5e8d617a2ee817
[ "MIT" ]
null
null
null
import sys import os from io import StringIO from datetime import datetime import unittest from unittest.mock import patch sys.path.append(os.path.abspath("./src/")) from calendarApp.models import Event, Calendar class CalendarModelTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.data1...
31.666667
101
0.583901
import sys import os from io import StringIO from datetime import datetime import unittest from unittest.mock import patch sys.path.append(os.path.abspath("./src/")) from calendarApp.models import Event, Calendar class CalendarModelTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.data1...
true
true
f71029e0362daf93beff056b71cb94f06389a620
15,953
py
Python
lib/tpn/visualstudio/templates.py
tpn/tpn
5c0fcc3c4b264dfb95b5029864c6006530150c85
[ "MIT" ]
2
2020-01-08T02:19:18.000Z
2022-01-11T09:06:03.000Z
lib/tpn/visualstudio/templates.py
tpn/tpn
5c0fcc3c4b264dfb95b5029864c6006530150c85
[ "MIT" ]
null
null
null
lib/tpn/visualstudio/templates.py
tpn/tpn
5c0fcc3c4b264dfb95b5029864c6006530150c85
[ "MIT" ]
1
2020-12-30T22:21:14.000Z
2020-12-30T22:21:14.000Z
"""Visual Studio Helper Utils.""" #=============================================================================== # Imports #=============================================================================== import uuid #=============================================================================== # Globals #=========...
50.166667
179
0.692848
import uuid vcxproj_template = """\ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Conf...
true
true
f71029e3924c8dd93bfee8142465de9c95b5d32c
742
py
Python
setup.py
sshh12/pymeritrade
0bb73922c8c08207cf55b934867cf780559d9871
[ "MIT" ]
1
2020-12-04T20:46:24.000Z
2020-12-04T20:46:24.000Z
setup.py
sshh12/pymeritrade
0bb73922c8c08207cf55b934867cf780559d9871
[ "MIT" ]
null
null
null
setup.py
sshh12/pymeritrade
0bb73922c8c08207cf55b934867cf780559d9871
[ "MIT" ]
null
null
null
import setuptools with open("README.md", "r") as fh: long_description = fh.read() with open("requirements.txt") as f: required = f.read().splitlines() setuptools.setup( name="pymeritrade", version="0.1.4", author="Shrivu Shankar", author_email="shrivu1122+pymeritrade@gmail.com", descri...
25.586207
52
0.672507
import setuptools with open("README.md", "r") as fh: long_description = fh.read() with open("requirements.txt") as f: required = f.read().splitlines() setuptools.setup( name="pymeritrade", version="0.1.4", author="Shrivu Shankar", author_email="shrivu1122+pymeritrade@gmail.com", descri...
true
true
f7102a3b2be5c1c5cc7c227eb2f94f35c34f04bc
4,838
py
Python
tests/test_DecodeSerialData.py
ricorx7/rti-python
1316323b782ddb8df357e55404f507a9573e172c
[ "BSD-3-Clause" ]
1
2017-06-10T13:27:44.000Z
2017-06-10T13:27:44.000Z
tests/test_DecodeSerialData.py
ricorx7/rti-python
1316323b782ddb8df357e55404f507a9573e172c
[ "BSD-3-Clause" ]
10
2019-12-28T18:06:18.000Z
2022-03-25T18:48:20.000Z
tests/test_DecodeSerialData.py
ricorx7/rti_python
1316323b782ddb8df357e55404f507a9573e172c
[ "BSD-3-Clause" ]
null
null
null
import threading import socket import sys import getopt from log import logger from Codecs.AdcpCodec import AdcpCodec from Comm.AdcpSerialPortServer import AdcpSerialPortServer class DecodeSerialData: def __init__(self, tcp_port, comm_port, baud): """ Initialize the thread to read the data from ...
32.911565
120
0.564283
import threading import socket import sys import getopt from log import logger from Codecs.AdcpCodec import AdcpCodec from Comm.AdcpSerialPortServer import AdcpSerialPortServer class DecodeSerialData: def __init__(self, tcp_port, comm_port, baud): self.is_alive = True self.raw_serial_socket = No...
true
true
f7102bbbb5e3e0d524fd7b1d3ea685d7b17ed8f4
1,421
py
Python
test/lmp/model/_lstm/conftest.py
a868111817/language-model-playground
814ab9ca7ba7c927de39123fdb7539acd2d0e5cc
[ "Beerware" ]
9
2020-07-31T10:27:28.000Z
2021-12-23T05:58:03.000Z
test/lmp/model/_lstm/conftest.py
Aidenzich/language-model-playground
daecd4e39bbf8128b04aa236ad1d31cd22c3c1d9
[ "Beerware" ]
10
2020-07-28T05:32:52.000Z
2022-03-04T06:36:23.000Z
test/lmp/model/_lstm/conftest.py
Aidenzich/language-model-playground
daecd4e39bbf8128b04aa236ad1d31cd22c3c1d9
[ "Beerware" ]
20
2020-07-08T07:05:39.000Z
2021-09-22T07:20:46.000Z
r"""Setup fixtures for testing :py:class:`lmp.model.LSTMModel`.""" import pytest import torch from lmp.model import LSTMModel from lmp.tknzr import BaseTknzr @pytest.fixture def lstm_model( tknzr: BaseTknzr, d_emb: int, d_hid: int, n_hid_lyr: int, n_pre_hid_lyr: int, ...
22.555556
66
0.581985
import pytest import torch from lmp.model import LSTMModel from lmp.tknzr import BaseTknzr @pytest.fixture def lstm_model( tknzr: BaseTknzr, d_emb: int, d_hid: int, n_hid_lyr: int, n_pre_hid_lyr: int, n_post_hid_lyr: int, p_emb: float, p_hid: float, ) ...
true
true
f7102c3ab6bd0cb874396d2b18df2dc4e19d5326
733
py
Python
backend/databasemodel/alembic/versions/b4eea63fd165_add_cityname_indexes_for_filtering.py
GispoCoding/tarmo
064eead90991fb2836173b647282e044dfa06c5a
[ "MIT" ]
null
null
null
backend/databasemodel/alembic/versions/b4eea63fd165_add_cityname_indexes_for_filtering.py
GispoCoding/tarmo
064eead90991fb2836173b647282e044dfa06c5a
[ "MIT" ]
92
2022-01-27T08:05:09.000Z
2022-03-31T06:54:46.000Z
backend/databasemodel/alembic/versions/b4eea63fd165_add_cityname_indexes_for_filtering.py
GispoCoding/tarmo
064eead90991fb2836173b647282e044dfa06c5a
[ "MIT" ]
null
null
null
"""add cityname indexes for filtering Revision ID: b4eea63fd165 Revises: 850af1d21f5e Create Date: 2022-05-05 17:39:57.826059 """ import os from alembic import op here = os.path.dirname(os.path.realpath(__file__)) # revision identifiers, used by Alembic. revision = "b4eea63fd165" down_revision = "850af1d21f5e" bra...
19.289474
53
0.723056
import os from alembic import op here = os.path.dirname(os.path.realpath(__file__)) revision = "b4eea63fd165" down_revision = "850af1d21f5e" branch_labels = None depends_on = None revision_dir = f"{here}/{revision}" def process_migration(script_name: str): filename = f"{revision_dir}/{script_name}.sql" ...
true
true
f7102cf126adafab6de592904ddaa1d404fe782b
1,011
py
Python
src/sima/metocean/blueprints/extremevalue.py
SINTEF/simapy
650b8c2f15503dad98e2bfc0d0788509593822c7
[ "MIT" ]
null
null
null
src/sima/metocean/blueprints/extremevalue.py
SINTEF/simapy
650b8c2f15503dad98e2bfc0d0788509593822c7
[ "MIT" ]
null
null
null
src/sima/metocean/blueprints/extremevalue.py
SINTEF/simapy
650b8c2f15503dad98e2bfc0d0788509593822c7
[ "MIT" ]
null
null
null
# # Generated with ExtremeValueBlueprint from dmt.blueprint import Blueprint from dmt.dimension import Dimension from dmt.attribute import Attribute from dmt.enum_attribute import EnumAttribute from dmt.blueprint_attribute import BlueprintAttribute from sima.sima.blueprints.moao import MOAOBlueprint class ExtremeValu...
50.55
121
0.739862
from dmt.blueprint import Blueprint from dmt.dimension import Dimension from dmt.attribute import Attribute from dmt.enum_attribute import EnumAttribute from dmt.blueprint_attribute import BlueprintAttribute from sima.sima.blueprints.moao import MOAOBlueprint class ExtremeValueBlueprint(MOAOBlueprint): def __in...
true
true
f7102d6826665c4b3d3b3525445b2c5af3a15fd8
2,323
py
Python
code/visualization/ucb.py
hust-cec-2021/ma2bea
196f8de33cc4902bd9cb1fdd5400e41f9c275b55
[ "MIT" ]
null
null
null
code/visualization/ucb.py
hust-cec-2021/ma2bea
196f8de33cc4902bd9cb1fdd5400e41f9c275b55
[ "MIT" ]
1
2021-09-08T13:39:10.000Z
2021-09-09T03:43:06.000Z
code/visualization/ucb.py
hust-cec-2021/ma2bea
196f8de33cc4902bd9cb1fdd5400e41f9c275b55
[ "MIT" ]
null
null
null
import os import argparse import numpy as np import matplotlib.pyplot as plt def get_args(): # create argument parser parser = argparse.ArgumentParser() # parameter for problem parser.add_argument('--seed', type=int, default=1) parser.add_argument('--benchmark_id', type=int, default=0) parser.a...
29.782051
116
0.494189
import os import argparse import numpy as np import matplotlib.pyplot as plt def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--seed', type=int, default=1) parser.add_argument('--benchmark_id', type=int, default=0) parser.add_argument('--rmp', type=float, default=0.3) ...
true
true
f7102d81b029f475ab955aea8189e37c558f7827
2,229
py
Python
dovpn.py
dhminch/dovpn
bcd35679d33608f243ceef23b8581c56cfe59dd8
[ "MIT" ]
null
null
null
dovpn.py
dhminch/dovpn
bcd35679d33608f243ceef23b8581c56cfe59dd8
[ "MIT" ]
null
null
null
dovpn.py
dhminch/dovpn
bcd35679d33608f243ceef23b8581c56cfe59dd8
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """Main function for the DOVPN project.""" import argparse import logging import os import yaml import vpnorchestrator def main(): """Main function that sets up script to run. Handles arguments, logging, and configuration before passing of control to the orchestrator object.""" ...
33.268657
91
0.645581
import argparse import logging import os import yaml import vpnorchestrator def main(): parser = argparse.ArgumentParser(description='Manage a DigitalOcean VPN.') parser.add_argument('-c', '--config', default="config.yaml", help='configuration file location') parser.add_ar...
true
true
f7102ec5b68677844155001f87b3bfc7105cb084
12,274
py
Python
chemprop/train/run_training.py
allisontam/chemprop
87ac151c68d8a200d564b064103c4f514e29f6bd
[ "MIT" ]
null
null
null
chemprop/train/run_training.py
allisontam/chemprop
87ac151c68d8a200d564b064103c4f514e29f6bd
[ "MIT" ]
null
null
null
chemprop/train/run_training.py
allisontam/chemprop
87ac151c68d8a200d564b064103c4f514e29f6bd
[ "MIT" ]
1
2020-04-02T13:10:34.000Z
2020-04-02T13:10:34.000Z
from argparse import Namespace import csv from logging import Logger import os from pprint import pformat from typing import List import numpy as np from tensorboardX import SummaryWriter import torch from tqdm import trange import pickle from torch.optim.lr_scheduler import ExponentialLR from .evaluate import evalua...
41.60678
157
0.644533
from argparse import Namespace import csv from logging import Logger import os from pprint import pformat from typing import List import numpy as np from tensorboardX import SummaryWriter import torch from tqdm import trange import pickle from torch.optim.lr_scheduler import ExponentialLR from .evaluate import evalua...
true
true
f7102ed9e03cc66c9c81ee370ec0eb1a82b28ef4
2,753
py
Python
ProgettoLube/WebInspector/venv/Lib/site-packages/skimage/color/tests/test_adapt_rgb.py
Lube-Project/ProgettoLube
cbf33971e2c2e865783ec1a2302625539186a338
[ "MIT" ]
2
2022-03-19T09:45:18.000Z
2022-03-19T15:26:24.000Z
ProgettoLube/WebInspector/venv/Lib/site-packages/skimage/color/tests/test_adapt_rgb.py
Lube-Project/ProgettoLube
cbf33971e2c2e865783ec1a2302625539186a338
[ "MIT" ]
7
2021-06-08T21:46:24.000Z
2022-03-12T00:35:31.000Z
site-packages/skimage/color/tests/test_adapt_rgb.py
Wristlebane/Pyto
901ac307b68486d8289105c159ca702318bea5b0
[ "MIT" ]
1
2020-06-29T15:18:22.000Z
2020-06-29T15:18:22.000Z
from functools import partial import numpy as np from skimage import img_as_float, img_as_uint from skimage import color, data, filters from skimage.color.adapt_rgb import adapt_rgb, each_channel, hsv_value # Down-sample image for quicker testing. COLOR_IMAGE = data.astronaut()[::5, ::6] GRAY_IMAGE = data.camera()[:...
28.978947
79
0.730839
from functools import partial import numpy as np from skimage import img_as_float, img_as_uint from skimage import color, data, filters from skimage.color.adapt_rgb import adapt_rgb, each_channel, hsv_value COLOR_IMAGE = data.astronaut()[::5, ::6] GRAY_IMAGE = data.camera()[::5, ::5] SIGMA = 3 smooth = partial(fil...
true
true
f71030712e51257e43c9ff71be37bc814684e32c
12,983
py
Python
timm/models/pit.py
Animatory/pytorch-image-models
3ace100fcfdab3619dc71307613c42e53fb70221
[ "Apache-2.0" ]
null
null
null
timm/models/pit.py
Animatory/pytorch-image-models
3ace100fcfdab3619dc71307613c42e53fb70221
[ "Apache-2.0" ]
null
null
null
timm/models/pit.py
Animatory/pytorch-image-models
3ace100fcfdab3619dc71307613c42e53fb70221
[ "Apache-2.0" ]
null
null
null
""" Pooling-based Vision Transformer (PiT) in PyTorch A PyTorch implement of Pooling-based Vision Transformers as described in 'Rethinking Spatial Dimensions of Vision Transformers' - https://arxiv.org/abs/2103.16302 This code was adapted from the original version at https://github.com/naver-ai/pit, original copyrigh...
33.722078
122
0.626281
import math import re from functools import partial from typing import Tuple import torch from torch import nn from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from .helpers import build_model_with_cfg from .layers import trunc_normal_, to_2tuple from .registry import register_model from .vision_...
true
true
f710319effdc93f2a10ac83e341c4ebc2f1204fe
37,086
py
Python
shells/backends/aws_tf_backend/src/data_model.py
oleksandr-r-q/CloudShell-Terraform-Shell
8d331cf8eebeae794e4e73a3c70af8064bafa434
[ "Apache-2.0" ]
4
2021-11-26T05:41:05.000Z
2022-03-11T20:01:40.000Z
shells/backends/aws_tf_backend/src/data_model.py
oleksandr-r-q/CloudShell-Terraform-Shell
8d331cf8eebeae794e4e73a3c70af8064bafa434
[ "Apache-2.0" ]
10
2021-07-14T05:19:54.000Z
2021-11-02T05:37:48.000Z
shells/backends/aws_tf_backend/src/data_model.py
oleksandr-r-q/CloudShell-Terraform-Shell
8d331cf8eebeae794e4e73a3c70af8064bafa434
[ "Apache-2.0" ]
1
2021-11-01T07:46:59.000Z
2021-11-01T07:46:59.000Z
from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \ AutoLoadResource from collections import defaultdict class LegacyUtils(object): def __init__(self): self._datamodel_clss_dict = self.__generate_datamodel_classes_dict() def migrate_autol...
33.1125
251
0.629024
from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \ AutoLoadResource from collections import defaultdict class LegacyUtils(object): def __init__(self): self._datamodel_clss_dict = self.__generate_datamodel_classes_dict() def migrate_autol...
true
true
f71031a3fd2f8846d71ea867cc54aa76a975b9a1
9,412
py
Python
mmdet/models/necks/m2fpn.py
ningdez/Tianchi_Cancer_303
59e9b6f906e48e7508f455ce29b97d430791fcf5
[ "MIT" ]
2
2020-06-23T14:12:03.000Z
2020-11-13T02:52:30.000Z
mmdet/models/necks/m2fpn.py
ningdez/Tianchi_Cancer_303
59e9b6f906e48e7508f455ce29b97d430791fcf5
[ "MIT" ]
1
2021-11-10T10:42:33.000Z
2021-11-10T10:42:33.000Z
mmdet/models/necks/m2fpn.py
ningdez/Tianchi_Cancer_303
59e9b6f906e48e7508f455ce29b97d430791fcf5
[ "MIT" ]
null
null
null
''' This code is based on pytorch_ssd and RFBNet. Details about the modules: TUM - Thinned U-shaped Module MLFPN - Multi-Level Feature Pyramid Network M2Det - Multi-level Multi-scale single-shot object Detector Author: Qijie Zhao (zhaoqijie@pku.edu.cn) Finished Date: 01/1...
39.881356
145
0.546855
import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import xavier_init import warnings warnings.filterwarnings('ignore') from ..registry import NECKS from ..utils import ConvModule class TUM(nn.Module): def __init__(self, first_level=True, input_planes=128, is_smooth=True, side_channel...
true
true
f710330a49da0167ad8b2a80e0fe83ccfd86d6d1
41
py
Python
src/infrastructure/db/models/__init__.py
oliveirahelena/flask-boilerplate
e614ad65f60d5ae04f94ba8e2f7c00d5821cf41f
[ "MIT" ]
null
null
null
src/infrastructure/db/models/__init__.py
oliveirahelena/flask-boilerplate
e614ad65f60d5ae04f94ba8e2f7c00d5821cf41f
[ "MIT" ]
null
null
null
src/infrastructure/db/models/__init__.py
oliveirahelena/flask-boilerplate
e614ad65f60d5ae04f94ba8e2f7c00d5821cf41f
[ "MIT" ]
null
null
null
from .orm import metadata, start_mappers
20.5
40
0.829268
from .orm import metadata, start_mappers
true
true
f71033e02a6b94c708b484a5a8b6d3a055181306
881
py
Python
test/apis/tensorflow/sound-classifier/predictor.py
wja30/cortex_0.31
522ec6226526dee6b4f8c3ed67bdf2b913d25de3
[ "Apache-2.0" ]
1
2020-09-09T04:04:30.000Z
2020-09-09T04:04:30.000Z
test/apis/tensorflow/sound-classifier/predictor.py
wja30/cortex_0.31
522ec6226526dee6b4f8c3ed67bdf2b913d25de3
[ "Apache-2.0" ]
null
null
null
test/apis/tensorflow/sound-classifier/predictor.py
wja30/cortex_0.31
522ec6226526dee6b4f8c3ed67bdf2b913d25de3
[ "Apache-2.0" ]
null
null
null
from scipy.io.wavfile import read import numpy as np import io import csv class TensorFlowPredictor: def __init__(self, tensorflow_client, config): self.client = tensorflow_client self.class_names = self.class_names_from_csv("class_names.csv") def class_names_from_csv(self, csv_file): ...
31.464286
84
0.648127
from scipy.io.wavfile import read import numpy as np import io import csv class TensorFlowPredictor: def __init__(self, tensorflow_client, config): self.client = tensorflow_client self.class_names = self.class_names_from_csv("class_names.csv") def class_names_from_csv(self, csv_file): ...
true
true
f710345e83902ad2ce3264936bfc7be3a0d99f86
62,597
py
Python
src/tests/run.py
watfordgnf/runtime
301056d6ff8f5ac0dea7fe07a8b450754ad846cb
[ "MIT" ]
1
2020-12-02T16:42:26.000Z
2020-12-02T16:42:26.000Z
src/tests/run.py
watfordgnf/runtime
301056d6ff8f5ac0dea7fe07a8b450754ad846cb
[ "MIT" ]
1
2020-12-02T09:16:02.000Z
2020-12-02T09:16:02.000Z
src/tests/run.py
watfordgnf/runtime
301056d6ff8f5ac0dea7fe07a8b450754ad846cb
[ "MIT" ]
null
null
null
#!/usr/bin/env python # ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. # ## # Title: run.py # # Notes: # # Universal script to setup and run the xunit console runner. The script relies # on run.proj and the bash and ...
38.076034
230
0.603336
This requires all tests run on linux x64 to be built by the # same platform and arch. If this is not done, the tests will run correctly; # however, expect failures due to incorrect exclusions in the xunit # wrappers setup at build time. # # Note that for linux targets the native components to the tests are still buil...
true
true
f71034708fa8005df0436c0f212fae7a6821a4c0
1,015
py
Python
sphinx/websupport/__init__.py
hason/sphinx
5cd0f235a891de80b637c20e0d90fd916cc68a86
[ "BSD-2-Clause" ]
null
null
null
sphinx/websupport/__init__.py
hason/sphinx
5cd0f235a891de80b637c20e0d90fd916cc68a86
[ "BSD-2-Clause" ]
null
null
null
sphinx/websupport/__init__.py
hason/sphinx
5cd0f235a891de80b637c20e0d90fd916cc68a86
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """ sphinx.websupport ~~~~~~~~~~~~~~~~~ Base Module for web support functions. :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import warnings from sphinx.deprecation import RemovedInSphinx20Warning try: fr...
36.25
95
0.708374
import warnings from sphinx.deprecation import RemovedInSphinx20Warning try: from sphinxcontrib.websupport import WebSupport from sphinxcontrib.websupport import errors from sphinxcontrib.websupport.search import BaseSearch, SEARCH_ADAPTERS from sphinxcontrib.websupport.storage import StorageB...
true
true
f71034b281252754f23f61cc8d343b1177404fdc
5,670
py
Python
faa_computer_admin/src/faa_computer_admin/control.py
njmei/fly-alcohol-assay
a3efc40e5ed5d48ed3a80e4b162e13736b0e04cc
[ "BSD-3-Clause" ]
null
null
null
faa_computer_admin/src/faa_computer_admin/control.py
njmei/fly-alcohol-assay
a3efc40e5ed5d48ed3a80e4b162e13736b0e04cc
[ "BSD-3-Clause" ]
null
null
null
faa_computer_admin/src/faa_computer_admin/control.py
njmei/fly-alcohol-assay
a3efc40e5ed5d48ed3a80e4b162e13736b0e04cc
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python from __future__ import print_function import roslib roslib.load_manifest('faa_computer_admin') import rospy import argparse import subprocess from faa_utilities import FindData from faa_data_processing import TrackingDataProcessor from faa_data_processing import VideoDataProcessor from faa_data_p...
37.8
118
0.65097
from __future__ import print_function import roslib roslib.load_manifest('faa_computer_admin') import rospy import argparse import subprocess from faa_utilities import FindData from faa_data_processing import TrackingDataProcessor from faa_data_processing import VideoDataProcessor from faa_data_processing import Figu...
true
true
f7103744258570afc23a22f07e345f4e747dd4cc
245
py
Python
DDGraphs/__init__.py
lancelotimb/dd-graphs
ff6f6f2efcdf9e3784c465c8977b41543654b4f0
[ "MIT" ]
null
null
null
DDGraphs/__init__.py
lancelotimb/dd-graphs
ff6f6f2efcdf9e3784c465c8977b41543654b4f0
[ "MIT" ]
null
null
null
DDGraphs/__init__.py
lancelotimb/dd-graphs
ff6f6f2efcdf9e3784c465c8977b41543654b4f0
[ "MIT" ]
null
null
null
from .init import init from .draw_timeseries_graph import draw_timeseries_graph from .draw_pie_charts import draw_pie_chart from .draw_top_list import draw_top_list __all__ = ["init", "draw_timeseries_graph", "draw_pie_chart", "draw_top_list"]
35
78
0.832653
from .init import init from .draw_timeseries_graph import draw_timeseries_graph from .draw_pie_charts import draw_pie_chart from .draw_top_list import draw_top_list __all__ = ["init", "draw_timeseries_graph", "draw_pie_chart", "draw_top_list"]
true
true
f710381da3f755d00f1686fe84e2e0bb0f62b4dc
1,215
py
Python
pyIsoDep/tests/read_csv.py
MattKrecicki/PYTHON-ISOTOPIC-DEPLETION-PACKAGE
ccad214de8721aa9b499ef70cd39966f18bceb76
[ "MIT" ]
1
2022-01-04T22:21:18.000Z
2022-01-04T22:21:18.000Z
pyIsoDep/tests/read_csv.py
DanKotlyar/PYTHON-ISOTOPIC-DEPLETION-PACKAGE
d9da8be6eff4ba301f9689ce5c38a5e50856d033
[ "MIT" ]
null
null
null
pyIsoDep/tests/read_csv.py
DanKotlyar/PYTHON-ISOTOPIC-DEPLETION-PACKAGE
d9da8be6eff4ba301f9689ce5c38a5e50856d033
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """read_csv Read the different csv files Created on Mon Oct 11 21:30:00 2021 @author: Dan Kotlyar Last updated on Mon Oct 11 21:45:00 2021 @author: Dan Kotlyar """ import numpy as np import pandas as pd def ReadCsv(csvFile): data = pd.read_csv('bootstrap.csv') ID = np.array(data['...
28.255814
77
0.604115
import numpy as np import pandas as pd def ReadCsv(csvFile): data = pd.read_csv('bootstrap.csv') ID = np.array(data['ZAID'], dtype=int) xsTypes = np.array(data['MT'], dtype=int) xsVals = np.array(data["XS [barns]"], dtype=float) N0 = np.array(data["N0 [atoms/b-cm]"], dtype=float) fullID = ...
true
true
f710383da7cf5e7b2bacdc981bb14cc2aeedc558
6,434
py
Python
components/start_page.py
SrGambiarra/KivyStudioDesigner
7f617b60aef3d5e99865cb559b9b5ee93a1988f5
[ "MIT" ]
3
2022-03-05T21:54:34.000Z
2022-03-15T12:55:45.000Z
components/start_page.py
SrGambiarra/KivyStudioDesigner
7f617b60aef3d5e99865cb559b9b5ee93a1988f5
[ "MIT" ]
2
2022-03-13T04:15:47.000Z
2022-03-30T11:51:41.000Z
components/start_page.py
SrGambiarra/KivyStudioDesigner
7f617b60aef3d5e99865cb559b9b5ee93a1988f5
[ "MIT" ]
null
null
null
__all__ = [ 'DesignerLinkLabel', 'RecentItem', 'RecentFilesBox' 'DesignerStartPage'] from utils.utils import get_designer, get_fs_encoding from kivy.properties import ObjectProperty, StringProperty from kivy.uix.scrollview import ScrollView from kivy.uix.boxlayout import BoxLayout from kivy.lang.builder impor...
27.495726
93
0.594809
__all__ = [ 'DesignerLinkLabel', 'RecentItem', 'RecentFilesBox' 'DesignerStartPage'] from utils.utils import get_designer, get_fs_encoding from kivy.properties import ObjectProperty, StringProperty from kivy.uix.scrollview import ScrollView from kivy.uix.boxlayout import BoxLayout from kivy.lang.builder impor...
true
true
f710388df0a9cbdd89b532dfa9a6713fd5628352
19,496
py
Python
tests/unit_tests/test_tethys_compute/test_models/test_dask/test_DaskJob.py
msouff/tethys
45795d1e6561d5db8fddd838f4d1ae1d91dbb837
[ "BSD-2-Clause" ]
null
null
null
tests/unit_tests/test_tethys_compute/test_models/test_dask/test_DaskJob.py
msouff/tethys
45795d1e6561d5db8fddd838f4d1ae1d91dbb837
[ "BSD-2-Clause" ]
1
2018-09-20T21:27:14.000Z
2018-09-20T21:27:14.000Z
tests/unit_tests/test_tethys_compute/test_models/test_dask/test_DaskJob.py
msouff/tethys
45795d1e6561d5db8fddd838f4d1ae1d91dbb837
[ "BSD-2-Clause" ]
null
null
null
from tethys_sdk.testing import TethysTestCase from tethys_compute.models.dask.dask_scheduler import Scheduler, DaskScheduler from tethys_compute.models.dask.dask_job import DaskJob from django.contrib.auth.models import User import dask from unittest import mock import time @dask.delayed def inc(x): return x + 1 ...
36.237918
119
0.671933
from tethys_sdk.testing import TethysTestCase from tethys_compute.models.dask.dask_scheduler import Scheduler, DaskScheduler from tethys_compute.models.dask.dask_job import DaskJob from django.contrib.auth.models import User import dask from unittest import mock import time @dask.delayed def inc(x): return x + 1 ...
true
true
f7103a621ee09bad322a5add73d81308b6b2be8c
6,345
py
Python
tensorflow/python/data/experimental/__init__.py
Sonata-Wang/tensorflow
8bbef0cd77879d05ed69bf30e76087847a8ca4a2
[ "Apache-2.0" ]
6
2019-02-05T22:36:51.000Z
2022-01-14T03:50:57.000Z
tensorflow/python/data/experimental/__init__.py
dipu989/tensorflow
3e21fe5faedab3a8258d344c8ad1cec2612a8aa8
[ "Apache-2.0" ]
1
2019-09-14T04:40:07.000Z
2020-11-18T18:16:17.000Z
tensorflow/python/data/experimental/__init__.py
dipu989/tensorflow
3e21fe5faedab3a8258d344c8ad1cec2612a8aa8
[ "Apache-2.0" ]
8
2016-01-14T13:12:56.000Z
2021-04-09T10:20:53.000Z
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
45.647482
96
0.849173
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.data.experimental.ops.batching import dense_to_sparse_batch from tensorflow.python.data.experimental.ops.batching import map_and_batch from tensorflow.python.data.experim...
true
true
f7103cf22159d3ede9a65e78e17f06013e656af4
4,661
py
Python
test/dungeons/TestSkullWoods.py
RoflCopter69/MultiWorld-Utilities
545bb8023c7b5be44584bf32bca696c8d7a19213
[ "MIT" ]
null
null
null
test/dungeons/TestSkullWoods.py
RoflCopter69/MultiWorld-Utilities
545bb8023c7b5be44584bf32bca696c8d7a19213
[ "MIT" ]
5
2020-01-18T21:10:46.000Z
2020-01-25T20:58:19.000Z
test/dungeons/TestSkullWoods.py
RoflCopter69/MultiWorld-Utilities
545bb8023c7b5be44584bf32bca696c8d7a19213
[ "MIT" ]
2
2020-01-18T17:36:50.000Z
2020-01-22T16:52:08.000Z
from test.dungeons.TestDungeon import TestDungeon class TestSkullWoods(TestDungeon): def testSkullWoodsFrontAllEntrances(self): self.starting_regions = ['Skull Woods First Section', 'Skull Woods First Section (Left)', 'Skull Woods First Section (Top)'] self.run_tests([ ["Skull Woods -...
47.080808
157
0.548809
from test.dungeons.TestDungeon import TestDungeon class TestSkullWoods(TestDungeon): def testSkullWoodsFrontAllEntrances(self): self.starting_regions = ['Skull Woods First Section', 'Skull Woods First Section (Left)', 'Skull Woods First Section (Top)'] self.run_tests([ ["Skull Woods -...
true
true
f7103e80a8ede0bdc771ecfc4ac8fc26714105f6
42
py
Python
.history/app/models_20210927050146.py
GraceOswal/pitch-perfect
d781c6e0f55c11f2a5e5dceb952f6b2de3c47c3b
[ "MIT" ]
null
null
null
.history/app/models_20210927050146.py
GraceOswal/pitch-perfect
d781c6e0f55c11f2a5e5dceb952f6b2de3c47c3b
[ "MIT" ]
null
null
null
.history/app/models_20210927050146.py
GraceOswal/pitch-perfect
d781c6e0f55c11f2a5e5dceb952f6b2de3c47c3b
[ "MIT" ]
null
null
null
from . import db # connect class user to
14
24
0.714286
from . import db
true
true
f7103ec2d4ba007ff5ea0a410b0557eaa6f6e7f4
1,153
py
Python
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/shared_set_status.py
googleapis/googleapis-gen
d84824c78563d59b0e58d5664bfaa430e9ad7e7a
[ "Apache-2.0" ]
7
2021-02-21T10:39:41.000Z
2021-12-07T07:31:28.000Z
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/shared_set_status.py
googleapis/googleapis-gen
d84824c78563d59b0e58d5664bfaa430e9ad7e7a
[ "Apache-2.0" ]
6
2021-02-02T23:46:11.000Z
2021-11-15T01:46:02.000Z
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/shared_set_status.py
googleapis/googleapis-gen
d84824c78563d59b0e58d5664bfaa430e9ad7e7a
[ "Apache-2.0" ]
4
2021-01-28T23:25:45.000Z
2021-08-30T01:55:16.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
28.825
74
0.700781
import proto __protobuf__ = proto.module( package='google.ads.googleads.v8.enums', marshal='google.ads.googleads.v8', manifest={ 'SharedSetStatusEnum', }, ) class SharedSetStatusEnum(proto.Message): class SharedSetStatus(proto.Enum): UNSPECIFIED = 0 UNKNO...
true
true
f7103fc1085344a33c3da77ee0da97ece10a9e77
1,420
py
Python
tests/conftest.py
xaviml/z2m_ikea_controller
e612af5a913e8b4784dcaa23ea5319115427d083
[ "MIT" ]
19
2019-11-21T19:51:40.000Z
2020-01-14T09:24:33.000Z
tests/conftest.py
xaviml/z2m_ikea_controller
e612af5a913e8b4784dcaa23ea5319115427d083
[ "MIT" ]
11
2019-11-20T16:43:35.000Z
2020-01-17T16:23:06.000Z
tests/conftest.py
xaviml/z2m_ikea_controller
e612af5a913e8b4784dcaa23ea5319115427d083
[ "MIT" ]
5
2019-12-20T21:31:07.000Z
2020-01-06T18:49:52.000Z
import asyncio from asyncio import Task from typing import Any, Callable import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.mqtt.mqttapi as mqtt import pytest from cx_core import Controller from pytest import MonkeyPatch from tests.test_utils import fake_fn async def fake_run_in( self: Contr...
32.272727
80
0.728169
import asyncio from asyncio import Task from typing import Any, Callable import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.mqtt.mqttapi as mqtt import pytest from cx_core import Controller from pytest import MonkeyPatch from tests.test_utils import fake_fn async def fake_run_in( self: Contr...
true
true
f7104045e9f92729e7e05787170a633970a9e9c2
921
py
Python
projects/Task019_ADAM/submission/scripts/convert.py
joeranbosma/nnDetection
2ebbf1cdc8a8794c73e325f06fea50632c78ae8c
[ "BSD-3-Clause" ]
242
2021-05-17T12:31:39.000Z
2022-03-31T11:51:29.000Z
projects/Task019_ADAM/submission/scripts/convert.py
joeranbosma/nnDetection
2ebbf1cdc8a8794c73e325f06fea50632c78ae8c
[ "BSD-3-Clause" ]
59
2021-06-02T07:32:10.000Z
2022-03-31T18:45:52.000Z
projects/Task019_ADAM/submission/scripts/convert.py
joeranbosma/nnDetection
2ebbf1cdc8a8794c73e325f06fea50632c78ae8c
[ "BSD-3-Clause" ]
38
2021-05-31T14:01:37.000Z
2022-03-21T08:24:40.000Z
import argparse from pathlib import Path from nndet.io import load_pickle from nndet.core.boxes.ops_np import box_center_np THRESHOLD = 0.5 if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('source', type=Path) args = parser.parse_args() source = args.source pre...
27.088235
94
0.604777
import argparse from pathlib import Path from nndet.io import load_pickle from nndet.core.boxes.ops_np import box_center_np THRESHOLD = 0.5 if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('source', type=Path) args = parser.parse_args() source = args.source pre...
true
true
f710422e65197ad6adf1832fd2c1d64dfa3c8bbc
5,612
py
Python
trainval.py
DoranLyong/DeepFish
3ea3e13653f708d4a8dcb54b990dcc2997edf4e9
[ "MIT" ]
1
2020-12-14T21:30:19.000Z
2020-12-14T21:30:19.000Z
trainval.py
DoranLyong/DeepFish
3ea3e13653f708d4a8dcb54b990dcc2997edf4e9
[ "MIT" ]
null
null
null
trainval.py
DoranLyong/DeepFish
3ea3e13653f708d4a8dcb54b990dcc2997edf4e9
[ "MIT" ]
null
null
null
import torch import numpy as np import argparse import pandas as pd import sys import os from torch import nn from torch.nn import functional as F import tqdm import pprint from src import utils as ut import torchvision from haven import haven_utils as hu from haven import haven_chk as hc from src import datasets, mod...
32.818713
91
0.596044
import torch import numpy as np import argparse import pandas as pd import sys import os from torch import nn from torch.nn import functional as F import tqdm import pprint from src import utils as ut import torchvision from haven import haven_utils as hu from haven import haven_chk as hc from src import datasets, mod...
true
true
f71042b95d0705e8bfa06f237b0c7ba6890bd92a
3,484
py
Python
scripts/gen_ksim_outside_exp.py
ctring/konex
7bf55f68f9ddcba6e2007e9c8049899cdb707d69
[ "MIT" ]
null
null
null
scripts/gen_ksim_outside_exp.py
ctring/konex
7bf55f68f9ddcba6e2007e9c8049899cdb707d69
[ "MIT" ]
null
null
null
scripts/gen_ksim_outside_exp.py
ctring/konex
7bf55f68f9ddcba6e2007e9c8049899cdb707d69
[ "MIT" ]
null
null
null
#!/usr/bin/python ''' Generate a command file for automated kSim experiment with out-of-dataset queries Example: ./gen_ksim_outside_exp.py 10 10 dataset.txt 0.3 experiment.txt results.txt -k 1 3 5 7 -m 7 --seed 23 -n 10 ''' from __future__ import absolute_import from __future__ import division from __future__ imp...
43.55
110
0.602755
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import random def pick_random(count, length, min_length=2, n=10): picked = [] for i in range(n): idx = random.randint(0, count - 1) start = random.randint(0...
true
true
f71042eebecd3985f43d5e37331634edf3eff6ca
407
py
Python
pmfp/__main__.py
Python-Tools/pmfp
832273890eec08e84f9c68d03f3316b2c8139133
[ "MIT" ]
4
2017-09-15T03:38:56.000Z
2019-12-16T02:03:14.000Z
pmfp/__main__.py
Python-Tools/pmfp
832273890eec08e84f9c68d03f3316b2c8139133
[ "MIT" ]
1
2021-04-27T10:51:42.000Z
2021-04-27T10:51:42.000Z
pmfp/__main__.py
Python-Tools/pmfp
832273890eec08e84f9c68d03f3316b2c8139133
[ "MIT" ]
null
null
null
#!/usr/bin/env python """PMFP. 一个项目管理脚手架. """ import warnings from .entrypoint import ppm import sys from typing import List from pmfp.entrypoint import ppm from colorama import init init() def main(argv: List[str] = sys.argv[1:]) -> None: """服务启动入口. 设置覆盖顺序`环境变量>命令行参数`>`'-c'指定的配置文件`>`项目启动位置的配置文件`>默认配置. ...
15.074074
56
0.658477
import warnings from .entrypoint import ppm import sys from typing import List from pmfp.entrypoint import ppm from colorama import init init() def main(argv: List[str] = sys.argv[1:]) -> None: ppm(argv) return None if __name__ == "__main__": main(sys.argv[1:])
true
true
f710440ca35c421c0923057216c8cf72bdf47d8b
57,471
py
Python
tests_python/tests_009/test_contract.py
ulrikstrid/tezos
96d4653ba4fb48eccdd0ca309c98254c39396712
[ "MIT" ]
null
null
null
tests_python/tests_009/test_contract.py
ulrikstrid/tezos
96d4653ba4fb48eccdd0ca309c98254c39396712
[ "MIT" ]
null
null
null
tests_python/tests_009/test_contract.py
ulrikstrid/tezos
96d4653ba4fb48eccdd0ca309c98254c39396712
[ "MIT" ]
null
null
null
import os import re import json import itertools from typing import List, Union, Any import pytest from client.client import Client from tools import utils from tools.constants import IDENTITIES from .contract_paths import ( CONTRACT_PATH, ILLTYPED_CONTRACT_PATH, all_contracts, all_legacy_contracts, ) ...
36.746164
80
0.58071
import os import re import json import itertools from typing import List, Union, Any import pytest from client.client import Client from tools import utils from tools.constants import IDENTITIES from .contract_paths import ( CONTRACT_PATH, ILLTYPED_CONTRACT_PATH, all_contracts, all_legacy_contracts, ) ...
true
true
f71044d972aeda32c49abd7d7f83422f3a1eb8f0
5,359
py
Python
PaddleAudio/paddleaudio/features/augment.py
AshburnLee/models
98fa58030f8ce352b3818f43897ac719ccffdffc
[ "Apache-2.0" ]
1
2022-02-13T08:33:52.000Z
2022-02-13T08:33:52.000Z
PaddleAudio/paddleaudio/features/augment.py
AshburnLee/models
98fa58030f8ce352b3818f43897ac719ccffdffc
[ "Apache-2.0" ]
null
null
null
PaddleAudio/paddleaudio/features/augment.py
AshburnLee/models
98fa58030f8ce352b3818f43897ac719ccffdffc
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
31.156977
83
0.631274
from typing import Iterable, List, Optional, Tuple, TypeVar import numpy as np from numpy import ndarray as array from paddleaudio.backends import depth_convert from paddleaudio.utils import ParameterError __all__ = [ 'depth_augment', 'spect_augment', 'random_crop1d', 'random_crop2d', ...
true
true
f71045928932e18081469a28d0e1d162f32eb006
4,059
py
Python
search_service/__init__.py
lukelowery/amundsensearchlibrary
cdaf1e3b75edd55bee8b0c65178863e25b0a479a
[ "Apache-2.0" ]
null
null
null
search_service/__init__.py
lukelowery/amundsensearchlibrary
cdaf1e3b75edd55bee8b0c65178863e25b0a479a
[ "Apache-2.0" ]
null
null
null
search_service/__init__.py
lukelowery/amundsensearchlibrary
cdaf1e3b75edd55bee8b0c65178863e25b0a479a
[ "Apache-2.0" ]
null
null
null
import ast import importlib import os import logging import logging.config import sys from flask import Flask, Blueprint from flask_restful import Api from flask_cors import CORS from typing import Dict, Any # noqa: F401 from flasgger import Swagger from search_service.api.dashboard import SearchDashboardAPI from se...
38.292453
111
0.74033
import ast import importlib import os import logging import logging.config import sys from flask import Flask, Blueprint from flask_restful import Api from flask_cors import CORS from typing import Dict, Any from flasgger import Swagger from search_service.api.dashboard import SearchDashboardAPI from search_service...
true
true
f7104645b4e560e005f0f55e7673f10e687b7f5e
828
py
Python
Sample REST API/SampleProject/urls.py
tanvipenumudy/Cookiecutter_Django_REST-API
f6604d7798ecebf0c432cdf141c24b0c2d85fdf2
[ "MIT" ]
null
null
null
Sample REST API/SampleProject/urls.py
tanvipenumudy/Cookiecutter_Django_REST-API
f6604d7798ecebf0c432cdf141c24b0c2d85fdf2
[ "MIT" ]
null
null
null
Sample REST API/SampleProject/urls.py
tanvipenumudy/Cookiecutter_Django_REST-API
f6604d7798ecebf0c432cdf141c24b0c2d85fdf2
[ "MIT" ]
null
null
null
"""SampleProject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class...
34.5
77
0.713768
from django.conf.urls import url from django.contrib import admin from MyApp import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^idealweight/',views.IdealWeight) ]
true
true
f71046c1dc5db319fb44c820336093811da73c30
931
py
Python
algorithm_web/admin/problem.py
KMU-algolab/algorithm
2b734978da78b936244580ed1febe4f9f6cf1aea
[ "MIT" ]
null
null
null
algorithm_web/admin/problem.py
KMU-algolab/algorithm
2b734978da78b936244580ed1febe4f9f6cf1aea
[ "MIT" ]
10
2019-03-15T05:12:23.000Z
2020-05-06T13:05:49.000Z
algorithm_web/admin/problem.py
KMU-algolab/algorithm
2b734978da78b936244580ed1febe4f9f6cf1aea
[ "MIT" ]
null
null
null
from django.contrib import admin from .. import models @admin.register(models.Problem) class ProblemeAdmin(admin.ModelAdmin): """ 문제관리 """ list_display = ['problem_name', 'limit_time', 'limit_memory', 'scoring_type', 'level', 'info', 'is_open', 'checker_code'] class Meta: model = models....
19.808511
125
0.647691
from django.contrib import admin from .. import models @admin.register(models.Problem) class ProblemeAdmin(admin.ModelAdmin): list_display = ['problem_name', 'limit_time', 'limit_memory', 'scoring_type', 'level', 'info', 'is_open', 'checker_code'] class Meta: model = models.Problem @admin.register...
true
true
f710474b36d3e20f8e9a1f23e934f85fb7128046
6,277
py
Python
tests/unit/dsetUtilTest.py
murlock/hsds
9f5fc3cdb64017d07e34eb422eee5398553d213c
[ "Apache-2.0" ]
null
null
null
tests/unit/dsetUtilTest.py
murlock/hsds
9f5fc3cdb64017d07e34eb422eee5398553d213c
[ "Apache-2.0" ]
null
null
null
tests/unit/dsetUtilTest.py
murlock/hsds
9f5fc3cdb64017d07e34eb422eee5398553d213c
[ "Apache-2.0" ]
null
null
null
############################################################################## # Copyright by The HDF Group. # # All rights reserved. # # # # Th...
38.27439
114
0.498487
true
true
f71048378dda0fc6890665ea8932c66d76ee0535
6,037
py
Python
fedot/core/pipelines/tuning/unified.py
bahia14/Fedot_Times_Series_Forecast
995751068733541ba2f546065082709ce0fb63ae
[ "BSD-3-Clause" ]
null
null
null
fedot/core/pipelines/tuning/unified.py
bahia14/Fedot_Times_Series_Forecast
995751068733541ba2f546065082709ce0fb63ae
[ "BSD-3-Clause" ]
null
null
null
fedot/core/pipelines/tuning/unified.py
bahia14/Fedot_Times_Series_Forecast
995751068733541ba2f546065082709ce0fb63ae
[ "BSD-3-Clause" ]
null
null
null
from datetime import timedelta from functools import partial import numpy as np from hyperopt import fmin, space_eval, tpe from fedot.core.data.data_split import train_test_data_setup from fedot.core.log import Log from fedot.core.pipelines.tuning.hyperparams import convert_params, get_node_params from fedot.core.pip...
40.246667
96
0.597813
from datetime import timedelta from functools import partial import numpy as np from hyperopt import fmin, space_eval, tpe from fedot.core.data.data_split import train_test_data_setup from fedot.core.log import Log from fedot.core.pipelines.tuning.hyperparams import convert_params, get_node_params from fedot.core.pip...
true
true
f71048c31984514aba32b993f0eaae5c4531e8fa
97,683
py
Python
theano/tensor/signal/pool.py
zploskey/Theano
9b3f6351d41d9f5e01b198e3de7538d7f032c409
[ "BSD-3-Clause" ]
1
2017-06-30T21:37:52.000Z
2017-06-30T21:37:52.000Z
theano/tensor/signal/pool.py
zploskey/Theano
9b3f6351d41d9f5e01b198e3de7538d7f032c409
[ "BSD-3-Clause" ]
null
null
null
theano/tensor/signal/pool.py
zploskey/Theano
9b3f6351d41d9f5e01b198e3de7538d7f032c409
[ "BSD-3-Clause" ]
1
2020-01-06T20:28:42.000Z
2020-01-06T20:28:42.000Z
""" Ops for downsampling images. Planned: Pool, DownsampleAvg, DownsampleSoftmax. """ from __future__ import absolute_import, print_function, division # This file should move along with conv.py import warnings import itertools import numpy as np from six.moves import xrange import six.moves.builtins as builtins impor...
39.595865
139
0.490106
from __future__ import absolute_import, print_function, division import warnings import itertools import numpy as np from six.moves import xrange import six.moves.builtins as builtins import theano from theano import gof, OpenMPOp, tensor, Variable, Apply from theano.gof import ParamsType, EnumList from theano.gradi...
true
true
f7104a1e09cb5f5864d25354d11d833d0bfc4a7e
1,306
py
Python
app/core/tests/test_admin.py
rodnaskorn/recipe-app-api
a3d16d77ef51ea39d9ac433772de99f29e2fc1cd
[ "MIT" ]
null
null
null
app/core/tests/test_admin.py
rodnaskorn/recipe-app-api
a3d16d77ef51ea39d9ac433772de99f29e2fc1cd
[ "MIT" ]
null
null
null
app/core/tests/test_admin.py
rodnaskorn/recipe-app-api
a3d16d77ef51ea39d9ac433772de99f29e2fc1cd
[ "MIT" ]
null
null
null
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_superuser( email='admin@test.com', ...
31.095238
68
0.637825
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_superuser( email='admin@test.com', ...
true
true
f7104a21aebf2e2aa07cc55c113bdba2ce69ca83
16,448
py
Python
python/ccxt/tidebit.py
xeddmc/ccxt
9ddd88e6bbc4b2162cf45d331995bb86235d2a59
[ "MIT" ]
1
2021-03-01T17:45:33.000Z
2021-03-01T17:45:33.000Z
python/ccxt/tidebit.py
xeddmc/ccxt
9ddd88e6bbc4b2162cf45d331995bb86235d2a59
[ "MIT" ]
4
2020-09-06T22:46:57.000Z
2021-05-10T08:35:02.000Z
python/ccxt/tidebit.py
xeddmc/ccxt
9ddd88e6bbc4b2162cf45d331995bb86235d2a59
[ "MIT" ]
1
2019-11-08T12:36:13.000Z
2019-11-08T12:36:13.000Z
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange from ccxt.base.errors import ExchangeError from ccxt.base.errors import InsufficientFunds from ccxt...
36.632517
155
0.486685
ge import Exchange from ccxt.base.errors import ExchangeError from ccxt.base.errors import InsufficientFunds from ccxt.base.errors import OrderNotFound class tidebit (Exchange): def describe(self): return self.deep_extend(super(tidebit, self).describe(), { 'id': 'tidebit', 'nam...
true
true
f7104af5717a6011d196d1dc4179149301442dfe
803
py
Python
tests/test_gameshow.py
AndrewWasHere/gameshow
70441bff391f7313a1e186f68ee9df7df83c90fa
[ "BSD-3-Clause" ]
null
null
null
tests/test_gameshow.py
AndrewWasHere/gameshow
70441bff391f7313a1e186f68ee9df7df83c90fa
[ "BSD-3-Clause" ]
null
null
null
tests/test_gameshow.py
AndrewWasHere/gameshow
70441bff391f7313a1e186f68ee9df7df83c90fa
[ "BSD-3-Clause" ]
null
null
null
""" Copyright 2016, Andrew Lin All rights reserved. This software is licensed under the BSD 3-Clause License. See LICENSE.txt at the root of the project or https://opensource.org/licenses/BSD-3-Clause """ import pytest from app.gameshow import make_gameshow @pytest.fixture def app(): """The whole gameshow app."...
21.131579
57
0.697385
import pytest from app.gameshow import make_gameshow @pytest.fixture def app(): a = make_gameshow() return a.test_client() def test_scoreboard(app): response = app.get('/') assert response.status_code == 200 assert response.content_type.startswith('text/html') def test_proctor(app): resp...
true
true
f7104bc49d07210082b385fe7fdff2047bffb718
9,835
py
Python
env/lib/python3.6/site-packages/jet/dashboard/dashboard.py
anthowen/duplify
846d01c1b21230937fdf0281b0cf8c0b08a8c24e
[ "MIT" ]
2
2019-12-04T16:24:44.000Z
2020-04-06T21:49:34.000Z
env/lib/python3.6/site-packages/jet/dashboard/dashboard.py
anthowen/duplify
846d01c1b21230937fdf0281b0cf8c0b08a8c24e
[ "MIT" ]
21
2021-02-04T01:37:44.000Z
2022-03-12T01:00:55.000Z
env/lib/python3.6/site-packages/jet/dashboard/dashboard.py
anthowen/duplify
846d01c1b21230937fdf0281b0cf8c0b08a8c24e
[ "MIT" ]
null
null
null
from importlib import import_module try: from django.core.urlresolvers import reverse except ImportError: # Django 1.11 from django.urls import reverse from django.template.loader import render_to_string from jet.dashboard import modules from jet.dashboard.models import UserDashboardModule from django.utils.tr...
30.927673
106
0.54306
from importlib import import_module try: from django.core.urlresolvers import reverse except ImportError: from django.urls import reverse from django.template.loader import render_to_string from jet.dashboard import modules from jet.dashboard.models import UserDashboardModule from django.utils.translation imp...
true
true
f7104c3230ed827c44d1fa39deafc95074822af7
2,126
py
Python
gateware/info/git.py
paddatrapper/HDMI2USB-litex-firmware
6a0235abe0ce9195b1717742c13c0dc4d45c3f4d
[ "BSD-2-Clause" ]
4
2018-08-19T03:50:15.000Z
2020-07-24T23:08:48.000Z
gateware/info/git.py
bunnie/litex-buildenv
7a704884a7f139716880ea02fec9309e253878e4
[ "BSD-2-Clause" ]
null
null
null
gateware/info/git.py
bunnie/litex-buildenv
7a704884a7f139716880ea02fec9309e253878e4
[ "BSD-2-Clause" ]
null
null
null
import binascii import os import subprocess import sys from migen.fhdl import * from litex.soc.interconnect.csr import * def git_root(): if sys.platform == "win32": # Git on Windows is likely to use Unix-style paths (`/c/path/to/repo`), # whereas directories passed to Python should be Windows-styl...
28.72973
83
0.574788
import binascii import os import subprocess import sys from migen.fhdl import * from litex.soc.interconnect.csr import * def git_root(): if sys.platform == "win32": git = subprocess.Popen( "git rev-parse --show-toplevel", cwd=os.path.dirname(__fi...
true
true
f7104c78c2bdf22a9a4177a3028c98b9bd1f60e0
20,626
py
Python
conans/model/build_info.py
pasrom/conan
5704fafa72e6619abb9714d99df5d13081d6f357
[ "MIT" ]
null
null
null
conans/model/build_info.py
pasrom/conan
5704fafa72e6619abb9714d99df5d13081d6f357
[ "MIT" ]
null
null
null
conans/model/build_info.py
pasrom/conan
5704fafa72e6619abb9714d99df5d13081d6f357
[ "MIT" ]
null
null
null
import os from collections import OrderedDict from copy import copy from conans.errors import ConanException from conans.util.conan_v2_mode import conan_v2_behavior DEFAULT_INCLUDE = "include" DEFAULT_LIB = "lib" DEFAULT_BIN = "bin" DEFAULT_RES = "res" DEFAULT_SHARE = "share" DEFAULT_BUILD = "" DEFAULT_FRAMEWORK = "F...
36.832143
101
0.635412
import os from collections import OrderedDict from copy import copy from conans.errors import ConanException from conans.util.conan_v2_mode import conan_v2_behavior DEFAULT_INCLUDE = "include" DEFAULT_LIB = "lib" DEFAULT_BIN = "bin" DEFAULT_RES = "res" DEFAULT_SHARE = "share" DEFAULT_BUILD = "" DEFAULT_FRAMEWORK = "F...
true
true
f7104c814506d615d1761157b853952abbef975d
4,425
py
Python
regression/run/arrayclass/python/test.py
ExternalRepositories/shroud
86c39d2324d947d28055f9024f52cc493eb0c813
[ "BSD-3-Clause" ]
73
2017-10-11T17:01:50.000Z
2022-01-01T21:42:12.000Z
regression/run/arrayclass/python/test.py
ExternalRepositories/shroud
86c39d2324d947d28055f9024f52cc493eb0c813
[ "BSD-3-Clause" ]
29
2018-03-21T19:34:29.000Z
2022-02-04T18:13:14.000Z
regression/run/arrayclass/python/test.py
ExternalRepositories/shroud
86c39d2324d947d28055f9024f52cc493eb0c813
[ "BSD-3-Clause" ]
8
2017-11-22T14:27:01.000Z
2022-03-30T08:49:03.000Z
# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) # ####################################################################### # # Test Python API generated from references....
33.522727
73
0.629153
Equal((10,), arr6.shape) self.assertEqual(10, arr6.size) arr7 = arrinst.fetchArrayPtrConst() self.assertIsInstance(arr4, np.ndarray) self.assertEqual('float64', arr7.dtype.name) self.assertEqual(1, arr7.ndim) self.assertEqual((10,), arr7.shape) self.assertEq...
true
true
f7104cdb14a8ffefb3c373799881a44789831177
522
py
Python
project_version/help.py
dmytrostriletskyi/project-version
c4c29f2e7b633a69eda1f89d022eadff3fe33d41
[ "MIT" ]
7
2022-01-18T20:12:29.000Z
2022-01-25T18:04:09.000Z
project_version/help.py
dmytrostriletskyi/project-version
c4c29f2e7b633a69eda1f89d022eadff3fe33d41
[ "MIT" ]
3
2022-01-29T15:46:46.000Z
2022-01-29T16:19:40.000Z
project_version/help.py
dmytrostriletskyi/project-version
c4c29f2e7b633a69eda1f89d022eadff3fe33d41
[ "MIT" ]
null
null
null
""" Provide help message for command line interface commands. """ PROVIDER_NAME_HELP = 'A provider of hosting for software development and version control name.' ORGANIZATION_NAME_HELP = "The provider's organization name." REPOSITORY_NAME_HELP = "The provider's repository name." BRANCH = 'A branch.' BASE_BRANCH = 'A br...
47.454545
95
0.781609
PROVIDER_NAME_HELP = 'A provider of hosting for software development and version control name.' ORGANIZATION_NAME_HELP = "The provider's organization name." REPOSITORY_NAME_HELP = "The provider's repository name." BRANCH = 'A branch.' BASE_BRANCH = 'A branch to compare a project version with. Usually, a default branch....
true
true
f7104d2f9d9499f3cf55c7355a54c7358562d6b1
1,015
py
Python
examples/classify_names/rough_work.py
huangruizhe/espresso
ee658bcc959bfbe8a7a61d7374d532d082d2aa26
[ "MIT" ]
null
null
null
examples/classify_names/rough_work.py
huangruizhe/espresso
ee658bcc959bfbe8a7a61d7374d532d082d2aa26
[ "MIT" ]
null
null
null
examples/classify_names/rough_work.py
huangruizhe/espresso
ee658bcc959bfbe8a7a61d7374d532d082d2aa26
[ "MIT" ]
null
null
null
# Online Python compiler (interpreter) to run Python online. # Write Python 3 code in this online editor and run it. import numpy as np list_a = [] for i in range(2): for j in range(5): list_a.append(i) list_a = np.random.permutation(list_a) print('class labels') print(list_a) list_a = np.array(list_a) i...
30.757576
85
0.782266
import numpy as np list_a = [] for i in range(2): for j in range(5): list_a.append(i) list_a = np.random.permutation(list_a) print('class labels') print(list_a) list_a = np.array(list_a) index_i = 0 classid_of_index0=list_a[index_i] print('class_of_index0: ', classid_of_index0) classid_of_index0_locati...
true
true
f7104d4af3e8e0b0704eb63303567f70590746a2
16,667
py
Python
calipy/viewer.py
jaedong27/calipy
ed5b5af2654b2a25e16af4267683cafc83d72729
[ "MIT" ]
1
2020-02-17T10:50:41.000Z
2020-02-17T10:50:41.000Z
calipy/viewer.py
jaedong27/calipy
ed5b5af2654b2a25e16af4267683cafc83d72729
[ "MIT" ]
1
2020-02-17T10:51:27.000Z
2020-02-17T10:51:27.000Z
calipy/viewer.py
jaedong27/calipy
ed5b5af2654b2a25e16af4267683cafc83d72729
[ "MIT" ]
null
null
null
import vtk from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor import math import numpy as np import numpy.matlib import os import json import cv2 # Z # / # / # / # ---------- X # | # | # | # Y class vtkRenderer(): def __init__(self, widget=None...
39.032787
141
0.628427
import vtk from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor import math import numpy as np import numpy.matlib import os import json import cv2 class vtkRenderer(): def __init__(self, widget=None): self.ren = vtk.vtkRenderer() if widget is not None: ...
true
true
f7104d857d6a0526aa83bfe43b03b59f697ae241
1,653
py
Python
setup.py
DiegoHeer/QuickFSScraping
cd0622eb56a9b3bee13dd3c8960a1c95e2c2443e
[ "MIT" ]
1
2021-01-19T09:15:06.000Z
2021-01-19T09:15:06.000Z
setup.py
DiegoHeer/QuickFSScraping
cd0622eb56a9b3bee13dd3c8960a1c95e2c2443e
[ "MIT" ]
null
null
null
setup.py
DiegoHeer/QuickFSScraping
cd0622eb56a9b3bee13dd3c8960a1c95e2c2443e
[ "MIT" ]
1
2021-01-19T10:04:29.000Z
2021-01-19T10:04:29.000Z
from distutils.core import setup from setuptools import find_packages import os # User-friendly description from README.md current_directory = os.path.dirname(os.path.abspath(__file__)) package_name = os.path.basename(current_directory) try: with open(os.path.join(current_directory, 'README.md'), encoding='utf-8')...
33.734694
92
0.69026
from distutils.core import setup from setuptools import find_packages import os current_directory = os.path.dirname(os.path.abspath(__file__)) package_name = os.path.basename(current_directory) try: with open(os.path.join(current_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read()...
true
true
f7104e042a9381fe9862f42a9135c2bac0fc99aa
14,268
py
Python
cdippy/stndata.py
wdar/cdippy
ef38b3445351ec8d9d7ea30b5b0d15825d794b0b
[ "BSD-3-Clause" ]
null
null
null
cdippy/stndata.py
wdar/cdippy
ef38b3445351ec8d9d7ea30b5b0d15825d794b0b
[ "BSD-3-Clause" ]
278
2018-10-28T13:48:18.000Z
2022-03-28T11:07:24.000Z
cdippy/stndata.py
wdar/cdippy
ef38b3445351ec8d9d7ea30b5b0d15825d794b0b
[ "BSD-3-Clause" ]
null
null
null
from datetime import datetime, timedelta from bisect import bisect_left import numpy.ma as ma from cdippy.cdippy import CDIPnc, Archive, Realtime, RealtimeXY, Historic import cdippy.timestamp_utils as tsu import cdippy.utils as cu class StnData(CDIPnc): """ Returns data and metadata for the specified s...
41.597668
124
0.584665
from datetime import datetime, timedelta from bisect import bisect_left import numpy.ma as ma from cdippy.cdippy import CDIPnc, Archive, Realtime, RealtimeXY, Historic import cdippy.timestamp_utils as tsu import cdippy.utils as cu class StnData(CDIPnc): max_deployments = 99 parameter_vars = ['waveHs...
true
true
f7104e1171ca3c5b939f29866585440a8400cd28
19,337
py
Python
Interface/Reduce.py
shaesaert/TuLiPXML
56cf4d58a9d7e17b6f6aebe6de8d5a1231035671
[ "BSD-3-Clause" ]
1
2021-05-28T23:44:28.000Z
2021-05-28T23:44:28.000Z
Interface/Reduce.py
shaesaert/TuLiPXML
56cf4d58a9d7e17b6f6aebe6de8d5a1231035671
[ "BSD-3-Clause" ]
2
2017-10-03T18:54:08.000Z
2018-08-21T09:50:09.000Z
Interface/Reduce.py
shaesaert/TuLiPXML
56cf4d58a9d7e17b6f6aebe6de8d5a1231035671
[ "BSD-3-Clause" ]
1
2018-10-06T12:58:52.000Z
2018-10-06T12:58:52.000Z
""" Local routines Written by S.Haesaert CONTENT helpfull functions for JPL project Bridging Tulip with the Statechart autocoder DATE 2 June """ # TODO : Check whether output set of reduced mealy machines (i,e.,ctrl.outputs) is too big? from __future__ import absolute_import from __future__ import...
42.875831
128
0.584734
from __future__ import absolute_import from __future__ import print_function import logging from itertools import product as it_product from networkx.algorithms.minors import equivalence_classes from tulip import transys from Interface import synth2 as synth logger = logging.getLogger(__name__) def remove_aux_in...
true
true
f7104e5f53580b564470d7f299654cf1542444e0
469
py
Python
env/Lib/site-packages/plotly/validators/scatterpolar/marker/colorbar/tickformatstop/_value.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
8a4707301d19c3826c31026c4077930bcd6a8182
[ "MIT" ]
11,750
2015-10-12T07:03:39.000Z
2022-03-31T20:43:15.000Z
env/Lib/site-packages/plotly/validators/scatterpolar/marker/colorbar/tickformatstop/_value.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
8a4707301d19c3826c31026c4077930bcd6a8182
[ "MIT" ]
2,951
2015-10-12T00:41:25.000Z
2022-03-31T22:19:26.000Z
env/Lib/site-packages/plotly/validators/scatterpolar/marker/colorbar/tickformatstop/_value.py
andresgreen-byte/Laboratorio-1--Inversion-de-Capital
8a4707301d19c3826c31026c4077930bcd6a8182
[ "MIT" ]
2,623
2015-10-15T14:40:27.000Z
2022-03-28T16:05:50.000Z
import _plotly_utils.basevalidators class ValueValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="value", parent_name="scatterpolar.marker.colorbar.tickformatstop", **kwargs ): super(ValueValidator, self).__init__( plot...
27.588235
67
0.637527
import _plotly_utils.basevalidators class ValueValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="value", parent_name="scatterpolar.marker.colorbar.tickformatstop", **kwargs ): super(ValueValidator, self).__init__( plot...
true
true
f7104f1742e63a1113fe4bfce148895fa8e5ac2d
2,699
py
Python
twilio/access_token.py
quippp/twilio-python
22b84cdfd19a6b1bde84350053870a7c507af410
[ "MIT" ]
14
2016-12-10T18:44:38.000Z
2020-08-05T21:09:42.000Z
twilio/access_token.py
quippp/twilio-python
22b84cdfd19a6b1bde84350053870a7c507af410
[ "MIT" ]
1
2016-05-26T21:39:12.000Z
2016-05-26T21:39:14.000Z
v/lib/python2.7/site-packages/twilio/access_token.py
josh6beasttt/HangWithFriends
0c5113bf1203190364d4922754c21eb5d87a5c25
[ "Apache-2.0" ]
5
2017-01-08T13:00:25.000Z
2020-06-03T09:46:17.000Z
import time from twilio import jwt class IpMessagingGrant(object): """ Grant to access Twilio IP Messaging """ def __init__(self, service_sid=None, endpoint_id=None, deployment_role_sid=None, push_credential_sid=None): self.service_sid = service_sid self.endpoint_id = endpoint...
28.410526
79
0.603557
import time from twilio import jwt class IpMessagingGrant(object): def __init__(self, service_sid=None, endpoint_id=None, deployment_role_sid=None, push_credential_sid=None): self.service_sid = service_sid self.endpoint_id = endpoint_id self.deployment_role_sid = deploymen...
true
true
f7104f79652ee5e3c7047f0cf3b972ab698cbea7
6,962
py
Python
nova/console/websocketproxy.py
ebalduf/nova-backports
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
[ "Apache-2.0" ]
null
null
null
nova/console/websocketproxy.py
ebalduf/nova-backports
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
[ "Apache-2.0" ]
null
null
null
nova/console/websocketproxy.py
ebalduf/nova-backports
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
[ "Apache-2.0" ]
1
2020-07-24T00:41:18.000Z
2020-07-24T00:41:18.000Z
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
40.011494
78
0.620511
import socket import sys from oslo_log import log as logging from six.moves import http_cookies as Cookie import six.moves.urllib.parse as urlparse import websockify import nova.conf from nova.consoleauth import rpcapi as consoleauth_rpcapi from nova import context from nova import exception from nova...
true
true
f710508ef545bbdf41fe33a0d1d1d6589a1d0706
1,215
py
Python
sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response.py
iscai-msft/azure-sdk-for-python
83715b95c41e519d5be7f1180195e2fba136fc0f
[ "MIT" ]
8
2021-01-13T23:44:08.000Z
2021-03-17T10:13:36.000Z
sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response.py
iscai-msft/azure-sdk-for-python
83715b95c41e519d5be7f1180195e2fba136fc0f
[ "MIT" ]
226
2019-07-24T07:57:21.000Z
2019-10-15T01:07:24.000Z
sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/models/get_personal_preferences_response.py
iscai-msft/azure-sdk-for-python
83715b95c41e519d5be7f1180195e2fba136fc0f
[ "MIT" ]
2
2020-05-21T22:51:22.000Z
2020-05-26T20:53:01.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 ...
36.818182
88
0.61893
from msrest.serialization import Model class GetPersonalPreferencesResponse(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'favorite_lab_resource_ids': {'key': 'favoriteLabResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs): super(GetPersonal...
true
true
f71050d4778b9b286032e81da7a40b8d26399ce8
5,024
py
Python
model/model.py
zoumt1633/pytorch-project-template
871e00ebde6c2191de5f61b4cb7010c72b93c198
[ "Apache-2.0" ]
1
2021-04-23T03:26:55.000Z
2021-04-23T03:26:55.000Z
model/model.py
zoumt1633/pytorch-project-template
871e00ebde6c2191de5f61b4cb7010c72b93c198
[ "Apache-2.0" ]
null
null
null
model/model.py
zoumt1633/pytorch-project-template
871e00ebde6c2191de5f61b4cb7010c72b93c198
[ "Apache-2.0" ]
1
2021-09-06T02:38:50.000Z
2021-09-06T02:38:50.000Z
import torch import torch.nn from torch.nn.parallel import DistributedDataParallel as DDP from collections import OrderedDict import os.path as osp import wandb from utils.utils import DotDict class Model: def __init__(self, hp, net_arch, loss_f, rank=0, world_size=1): self.hp = hp self.device =...
36.405797
87
0.579618
import torch import torch.nn from torch.nn.parallel import DistributedDataParallel as DDP from collections import OrderedDict import os.path as osp import wandb from utils.utils import DotDict class Model: def __init__(self, hp, net_arch, loss_f, rank=0, world_size=1): self.hp = hp self.device =...
true
true
f71050ebef8199c7d5a9e55369e430fba92d5a18
366
py
Python
5th May Assignments/case study 1/question_2.py
JangirSumit/data_science
a1957122f8a4c66e3b4c7b7c93a74c53a2db1fe4
[ "MIT" ]
15
2019-05-05T04:48:42.000Z
2022-02-15T12:08:33.000Z
5th May Assignments/case study 1/question_2.py
JangirSumit/data_science
a1957122f8a4c66e3b4c7b7c93a74c53a2db1fe4
[ "MIT" ]
null
null
null
5th May Assignments/case study 1/question_2.py
JangirSumit/data_science
a1957122f8a4c66e3b4c7b7c93a74c53a2db1fe4
[ "MIT" ]
53
2019-11-10T05:09:25.000Z
2022-03-28T01:26:32.000Z
# 2. Write a code which accepts a sequence of words as input # and prints the words in a sequence after sorting them alphabetically. print("Enter sequence of words") print("For example -\nMy name is Sumit\n") words = input(">>> ") temp = words.split(" ") temp.sort() sorted_string = " ".join(temp) print("string afte...
24.4
71
0.702186
print("Enter sequence of words") print("For example -\nMy name is Sumit\n") words = input(">>> ") temp = words.split(" ") temp.sort() sorted_string = " ".join(temp) print("string after sorting is - \n") print(f"{sorted_string}")
true
true
f7105223a14265887aab39c6802321ba32a7ba59
1,840
py
Python
test/test_precision.py
HubBucket-Team/tensorforce
92c987424c89e96238a3689aa4018df0d9d40504
[ "Apache-2.0" ]
1
2019-09-23T18:39:57.000Z
2019-09-23T18:39:57.000Z
test/test_precision.py
VonRosenchild/tensorforce
92c987424c89e96238a3689aa4018df0d9d40504
[ "Apache-2.0" ]
null
null
null
test/test_precision.py
VonRosenchild/tensorforce
92c987424c89e96238a3689aa4018df0d9d40504
[ "Apache-2.0" ]
1
2019-09-23T18:40:00.000Z
2019-09-23T18:40:00.000Z
# Copyright 2018 Tensorforce Team. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
33.454545
105
0.634783
import pytest import unittest import numpy as np import tensorflow as tf from tensorforce import util from test.unittest_base import UnittestBase class TestPrecision(UnittestBase, unittest.TestCase): exclude_bounded_action = True require_observe = True def test_precision(self): ...
true
true
f710538cddf41d04cf71c058a094540469e6a98f
1,910
py
Python
src/exoplanet/distributions/physical_test.py
ericagol/exoplanet
ec270622f28cd53d3052ed44d20f30b5d2b4dcb6
[ "MIT" ]
null
null
null
src/exoplanet/distributions/physical_test.py
ericagol/exoplanet
ec270622f28cd53d3052ed44d20f30b5d2b4dcb6
[ "MIT" ]
null
null
null
src/exoplanet/distributions/physical_test.py
ericagol/exoplanet
ec270622f28cd53d3052ed44d20f30b5d2b4dcb6
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import numpy as np import pymc3 as pm from scipy.stats import kstest from .base_test import _Base from .physical import ImpactParameter, QuadLimbDark class TestPhysical(_Base): random_seed = 19860925 def test_quad_limb_dark(self): with self._model(): dist = QuadL...
28.507463
76
0.517277
import numpy as np import pymc3 as pm from scipy.stats import kstest from .base_test import _Base from .physical import ImpactParameter, QuadLimbDark class TestPhysical(_Base): random_seed = 19860925 def test_quad_limb_dark(self): with self._model(): dist = QuadLimbDark("u", shape=2) ...
true
true
f71053f2708262ba17f196f6455e6664b8f9d762
121,550
py
Python
payload/network.py
RhubarbSin/arin-whois-rws
76d733e218157f0cc9c9efe2b61c50656f095ac2
[ "MIT" ]
4
2015-12-04T21:02:08.000Z
2020-01-09T12:15:11.000Z
payload/network.py
RhubarbSin/arin-whois-rws
76d733e218157f0cc9c9efe2b61c50656f095ac2
[ "MIT" ]
null
null
null
payload/network.py
RhubarbSin/arin-whois-rws
76d733e218157f0cc9c9efe2b61c50656f095ac2
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011,2012,2013 American Registry for Internet Numbers # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear i...
45.169082
309
0.61861
import sys import getopt import re as re_ import base64 import datetime as datetime_ etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) XMLParser_import_library = None try: from lxml import etree as etree_ ...
false
true
f710547f67632e5a20d33fad4e5177244d58a71a
2,670
py
Python
azure/mgmt/network/v2017_03_01/models/connectivity_information.py
EnjoyLifeFund/Debian_py36_packages
1985d4c73fabd5f08f54b922e73a9306e09c77a5
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
1
2022-01-25T22:52:58.000Z
2022-01-25T22:52:58.000Z
azure/mgmt/network/v2017_03_01/models/connectivity_information.py
EnjoyLifeFund/Debian_py36_packages
1985d4c73fabd5f08f54b922e73a9306e09c77a5
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
azure/mgmt/network/v2017_03_01/models/connectivity_information.py
EnjoyLifeFund/Debian_py36_packages
1985d4c73fabd5f08f54b922e73a9306e09c77a5
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
null
null
null
# 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 ...
39.264706
76
0.63221
from msrest.serialization import Model class ConnectivityInformation(Model): _validation = { 'hops': {'readonly': True}, 'connection_status': {'readonly': True}, 'avg_latency_in_ms': {'readonly': True}, 'min_latency_in_ms': {'readonly': True}, 'max_latency_in_ms...
true
true
f71055aa651cf305c9a8166cdce7eaafefa9e974
29
py
Python
code/abc039_b_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
3
2019-08-16T16:55:48.000Z
2021-04-11T10:21:40.000Z
code/abc039_b_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
null
null
null
code/abc039_b_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
null
null
null
print(int(int(input())**.25))
29
29
0.62069
print(int(int(input())**.25))
true
true
f7105759a01a9f8a1433c4a5979ba50ebcbdd63e
311,762
py
Python
python/phonenumbers/carrierdata/data0.py
elineda/python-phonenumbers
112c05ea2c1bf0b346494456832ffd0fef29be63
[ "Apache-2.0" ]
null
null
null
python/phonenumbers/carrierdata/data0.py
elineda/python-phonenumbers
112c05ea2c1bf0b346494456832ffd0fef29be63
[ "Apache-2.0" ]
null
null
null
python/phonenumbers/carrierdata/data0.py
elineda/python-phonenumbers
112c05ea2c1bf0b346494456832ffd0fef29be63
[ "Apache-2.0" ]
null
null
null
"""Per-prefix data, mapping each prefix to a dict of locale:name. Auto-generated file, do not edit by hand. """ from ..util import u # Copyright (C) 2011-2020 The Libphonenumber Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
31.104659
125
0.53265
from ..util import u data = { '1242357':{'en': 'BaTelCo'}, '1242359':{'en': 'BaTelCo'}, '1242375':{'en': 'BaTelCo'}, '1242376':{'en': 'BaTelCo'}, '1242395':{'en': 'BaTelCo'}, '124242':{'en': 'BaTelCo'}, '124243':{'en': 'BaTelCo'}, '124244':{'en': 'BaTelCo'}, '124245':{'en': 'BaTelCo'}, '1242462...
true
true
f7105885e9a4c5e32b25abca7ec9383fb427430d
22,990
py
Python
python/mxnet/image.py
Leopard-X/MXNET
7ac046c58f0815223712f77288722a7b06755ec3
[ "Apache-2.0" ]
1
2019-09-10T17:06:29.000Z
2019-09-10T17:06:29.000Z
python/mxnet/image.py
Leopard-X/MXNET
7ac046c58f0815223712f77288722a7b06755ec3
[ "Apache-2.0" ]
null
null
null
python/mxnet/image.py
Leopard-X/MXNET
7ac046c58f0815223712f77288722a7b06755ec3
[ "Apache-2.0" ]
null
null
null
# pylint: disable=no-member, too-many-lines, redefined-builtin, protected-access, unused-import, invalid-name # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module, too-many-branches, too-many-statements """Read invidual image files and perform augmentations.""" from __future__ import absolute_impor...
31.666667
130
0.588473
from __future__ import absolute_import, print_function import os import random import logging import numpy as np try: import cv2 except ImportError: cv2 = None from .base import numeric_types from . import ndarray as nd from . import _ndarray_internal as _internal from ._ndarray_internal import _cvimresiz...
true
true
f71058b38f7fbd38e77a131f05712abc41a0e552
1,539
py
Python
mqtt-servers/server2.py
pranaypareek/cc
1d8ee42d3bbe5295543ad0119053baf1cfdbd7d3
[ "Apache-2.0" ]
null
null
null
mqtt-servers/server2.py
pranaypareek/cc
1d8ee42d3bbe5295543ad0119053baf1cfdbd7d3
[ "Apache-2.0" ]
null
null
null
mqtt-servers/server2.py
pranaypareek/cc
1d8ee42d3bbe5295543ad0119053baf1cfdbd7d3
[ "Apache-2.0" ]
null
null
null
""" A small Test application to show how to use Flask-MQTT. """ import eventlet import json from flask import Flask, render_template from flask_mqtt import Mqtt from flask_socketio import SocketIO from flask_bootstrap import Bootstrap eventlet.monkey_patch() app = Flask(__name__) app.config['SECRET'] = 'my secret ...
26.534483
87
0.7141
import eventlet import json from flask import Flask, render_template from flask_mqtt import Mqtt from flask_socketio import SocketIO from flask_bootstrap import Bootstrap eventlet.monkey_patch() app = Flask(__name__) app.config['SECRET'] = 'my secret key' app.config['TEMPLATES_AUTO_RELOAD'] = True app.config['MQTT_B...
true
true
f710597e3b715d2570693e3c3d3b9b7e2b838899
620
py
Python
hashpy/crc32.py
njaladan/hashbrowns
33f226781bd102eec6d8f45fdf46e4d3b7915cf1
[ "MIT" ]
7
2018-07-01T12:42:08.000Z
2022-03-10T14:27:48.000Z
hashpy/crc32.py
njaladan/hashbrowns
33f226781bd102eec6d8f45fdf46e4d3b7915cf1
[ "MIT" ]
5
2018-04-19T22:06:28.000Z
2018-05-15T23:11:33.000Z
hashpy/crc32.py
njaladan/hashbrowns
33f226781bd102eec6d8f45fdf46e4d3b7915cf1
[ "MIT" ]
1
2020-06-16T00:23:31.000Z
2020-06-16T00:23:31.000Z
# # CRC32 hash implementation # using polynomial 0x04c11db7 # _author: nagaganesh jaladanki # class crc32(): def __init__(self, data=None): self.poly = 0x04c11db7 if data != None: self.update(data) def update(self, bytestring): if type(bytestring) != bytes: byt...
20.666667
53
0.609677
class crc32(): def __init__(self, data=None): self.poly = 0x04c11db7 if data != None: self.update(data) def update(self, bytestring): if type(bytestring) != bytes: bytestring = str.encode(bytestring) bytestring = bytearray(bytestring) padde...
false
true
f7105bfdf7b8d86c2077099103949015886a8533
15,565
py
Python
Detection/MtcnnDetector.py
qma16443/AIcamp_MTCNN
431c3ce1cabf24266690322d525bdf7133666dc0
[ "MIT" ]
null
null
null
Detection/MtcnnDetector.py
qma16443/AIcamp_MTCNN
431c3ce1cabf24266690322d525bdf7133666dc0
[ "MIT" ]
null
null
null
Detection/MtcnnDetector.py
qma16443/AIcamp_MTCNN
431c3ce1cabf24266690322d525bdf7133666dc0
[ "MIT" ]
null
null
null
import cv2 import time import numpy as np import sys sys.path.append("../") from train_models.MTCNN_config import config from Detection.nms import py_nms class MtcnnDetector(object): def __init__(self, detectors, min_face_size=25, stride=2, thr...
34.743304
123
0.477739
import cv2 import time import numpy as np import sys sys.path.append("../") from train_models.MTCNN_config import config from Detection.nms import py_nms class MtcnnDetector(object): def __init__(self, detectors, min_face_size=25, stride=2, thr...
true
true
f7105ca75b04c3c8c1d2283faf3211318318e6be
2,694
py
Python
tk/users/views.py
ShinJungJae/TK-backend
b58b54a4d664e6512188ade63ca192a1fdf36382
[ "MIT" ]
null
null
null
tk/users/views.py
ShinJungJae/TK-backend
b58b54a4d664e6512188ade63ca192a1fdf36382
[ "MIT" ]
null
null
null
tk/users/views.py
ShinJungJae/TK-backend
b58b54a4d664e6512188ade63ca192a1fdf36382
[ "MIT" ]
null
null
null
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from . import models, serializers class ExploreUsers(APIView): def get(self, request, format=None): last_five = models.User.objects.all().order_by('-date_joined')[:5] serializ...
26.15534
79
0.690052
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from . import models, serializers class ExploreUsers(APIView): def get(self, request, format=None): last_five = models.User.objects.all().order_by('-date_joined')[:5] serializ...
true
true
f7105db64aa4eae243200441bceaf95732ded3c3
104
py
Python
tests/example_files/imports_template.py
kracekumar/pep585-upgrade
949a8d6d9afeee4b178ee4a1d534aa174e5adb7d
[ "BSD-3-Clause" ]
null
null
null
tests/example_files/imports_template.py
kracekumar/pep585-upgrade
949a8d6d9afeee4b178ee4a1d534aa174e5adb7d
[ "BSD-3-Clause" ]
null
null
null
tests/example_files/imports_template.py
kracekumar/pep585-upgrade
949a8d6d9afeee4b178ee4a1d534aa174e5adb7d
[ "BSD-3-Clause" ]
null
null
null
from __future__ import annotations from typing import List x: List def b(*, x: list[str]): pass
10.4
34
0.692308
from __future__ import annotations from typing import List x: List def b(*, x: list[str]): pass
true
true
f7105f00c7bb9e047b58c19b604412f60319b49d
430
py
Python
maluforce/__version__.py
rmcferrao/maluforce
12c776dc129c8d778086e22fd8ad9de996816081
[ "MIT" ]
null
null
null
maluforce/__version__.py
rmcferrao/maluforce
12c776dc129c8d778086e22fd8ad9de996816081
[ "MIT" ]
null
null
null
maluforce/__version__.py
rmcferrao/maluforce
12c776dc129c8d778086e22fd8ad9de996816081
[ "MIT" ]
null
null
null
"""Version details for maluforce""" __title__ = "maluforce" __description__ = "A basic Salesforce and Pandas interface" __url__ = "https://github.com/rodrigoelemesmo/maluforce" __version__ = "0.0.6" __author__ = "Rodrigo Maluf" __author_email__ = "rodrigo1793@gmail.com" __license__ = "None" __maintainer__ = "Rodrigo M...
33.076923
59
0.781395
__title__ = "maluforce" __description__ = "A basic Salesforce and Pandas interface" __url__ = "https://github.com/rodrigoelemesmo/maluforce" __version__ = "0.0.6" __author__ = "Rodrigo Maluf" __author_email__ = "rodrigo1793@gmail.com" __license__ = "None" __maintainer__ = "Rodrigo Maluf" __maintainer_email__ = "rodrig...
true
true
f710618df3ce59a74e0e72dab814554fa94101d9
7,201
py
Python
graph4nlp/pytorch/test/seq_decoder/graph2seq/src/g2s_v2/core/utils/vocab_utils.py
stjordanis/graph4nlp
c6ebde32bc77d3a7b78f86a93f19b1c057963ffa
[ "Apache-2.0" ]
18
2020-09-09T03:33:29.000Z
2021-07-22T11:17:16.000Z
graph4nlp/pytorch/test/seq_decoder/graph2seq/src/g2s_v2/core/utils/vocab_utils.py
stjordanis/graph4nlp
c6ebde32bc77d3a7b78f86a93f19b1c057963ffa
[ "Apache-2.0" ]
null
null
null
graph4nlp/pytorch/test/seq_decoder/graph2seq/src/g2s_v2/core/utils/vocab_utils.py
stjordanis/graph4nlp
c6ebde32bc77d3a7b78f86a93f19b1c057963ffa
[ "Apache-2.0" ]
1
2021-11-01T08:41:26.000Z
2021-11-01T08:41:26.000Z
# -*- coding: utf-8 -*- from __future__ import print_function import os import re import pickle import numpy as np from collections import Counter from functools import lru_cache from . import constants from .data_utils import tokenize word_detector = re.compile('\w') class VocabModel(object): def __init__(self,...
37.118557
129
0.617831
from __future__ import print_function import os import re import pickle import numpy as np from collections import Counter from functools import lru_cache from . import constants from .data_utils import tokenize word_detector = re.compile('\w') class VocabModel(object): def __init__(self, data_set, config): ...
true
true
f710621a406cb46d8fd1148a07770249421a7f62
2,190
py
Python
config/settings/local.py
sahilpysquad/SMT
b03d5d2e32fcda26cdbae35588cfd0f785c02d3a
[ "MIT" ]
null
null
null
config/settings/local.py
sahilpysquad/SMT
b03d5d2e32fcda26cdbae35588cfd0f785c02d3a
[ "MIT" ]
1
2022-03-30T20:23:58.000Z
2022-03-30T20:23:58.000Z
config/settings/local.py
sahilpysquad/SMT
b03d5d2e32fcda26cdbae35588cfd0f785c02d3a
[ "MIT" ]
null
null
null
from .base import * # noqa from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = env( "DJANGO_SECRET_KEY...
39.818182
97
0.583105
from .base import * from .base import env = True = env( "DJANGO_SECRET_KEY", default="Zn3KXHlnNzLcEZ9pnrLwkkhwzlkzJp7bjgy6DqXLLqyGP59Ayn1J7ZrlpxcnVxWe", ) = ["localhost", "0.0.0.0", "127.0.0.1"] = { "default": { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATIO...
true
true
f71062ea8686c0a6c55bd7f8ff2dfe5d3c51b140
4,096
py
Python
sandpileModel_v0_0_1.py
Alex-Github-Programmer/fractal
ab463a715a6a9883b43a4eefe899c1af549f5ddd
[ "MIT" ]
null
null
null
sandpileModel_v0_0_1.py
Alex-Github-Programmer/fractal
ab463a715a6a9883b43a4eefe899c1af549f5ddd
[ "MIT" ]
null
null
null
sandpileModel_v0_0_1.py
Alex-Github-Programmer/fractal
ab463a715a6a9883b43a4eefe899c1af549f5ddd
[ "MIT" ]
null
null
null
import array class bmp: """ bmp data structure """ def __init__(self, w=1080, h=1920): self.w = w self.h = h def calc_data_size (self): if((self.w*3)%4 == 0): self.dataSize = self.w * 3 * self.h else: self.dataSize = (((self.w * 3) // 4 + 1) * 4) * se...
33.57377
80
0.523682
import array class bmp: def __init__(self, w=1080, h=1920): self.w = w self.h = h def calc_data_size (self): if((self.w*3)%4 == 0): self.dataSize = self.w * 3 * self.h else: self.dataSize = (((self.w * 3) // 4 + 1) * 4) * self.h self.fileSize = s...
true
true
f71063a4b5711bb34d16be052982c1c2e1e50f81
9,849
py
Python
detectron2/export/api.py
YinchaoGao/detectron2
04958b93e1232935e126c2fd9e6ccd3f57c3a8f3
[ "Apache-2.0" ]
null
null
null
detectron2/export/api.py
YinchaoGao/detectron2
04958b93e1232935e126c2fd9e6ccd3f57c3a8f3
[ "Apache-2.0" ]
null
null
null
detectron2/export/api.py
YinchaoGao/detectron2
04958b93e1232935e126c2fd9e6ccd3f57c3a8f3
[ "Apache-2.0" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import copy import logging import os import torch from caffe2.proto import caffe2_pb2 from torch import nn from detectron2.config import CfgNode as CN from .caffe2_export import export_caffe2_detection_model from .caffe2_export import export_onnx...
36.076923
98
0.653873
import copy import logging import os import torch from caffe2.proto import caffe2_pb2 from torch import nn from detectron2.config import CfgNode as CN from .caffe2_export import export_caffe2_detection_model from .caffe2_export import export_onnx_model as export_onnx_model_impl from .caffe2_export import run_and_sav...
true
true
f7106495e4d1a8e150aa9de84bcd4cc085c2136a
5,775
py
Python
code/old_FINDER_CN_cost_tf/my_testReal_v2.py
faraz2023/FINDER
170255f9a442b11e1a27483fe6eaf2ee61766454
[ "MIT" ]
null
null
null
code/old_FINDER_CN_cost_tf/my_testReal_v2.py
faraz2023/FINDER
170255f9a442b11e1a27483fe6eaf2ee61766454
[ "MIT" ]
null
null
null
code/old_FINDER_CN_cost_tf/my_testReal_v2.py
faraz2023/FINDER
170255f9a442b11e1a27483fe6eaf2ee61766454
[ "MIT" ]
null
null
null
import sys,os sys.path.append(os.path.dirname(__file__) + os.sep + '../') from FINDER import FINDER import numpy as np from tqdm import tqdm import time import networkx as nx import pandas as pd import pickle as cp import random def mkdir(path): if not os.path.exists(path): os.mkdir(path) g_type = "barab...
42.153285
127
0.56658
import sys,os sys.path.append(os.path.dirname(__file__) + os.sep + '../') from FINDER import FINDER import numpy as np from tqdm import tqdm import time import networkx as nx import pandas as pd import pickle as cp import random def mkdir(path): if not os.path.exists(path): os.mkdir(path) g_type = "barab...
true
true
f710660d6ad8ecf6f6d600d86493d14a6e55249c
326,598
py
Python
pandas/core/frame.py
UrielMaD/pandas
b5233c447f3ed0ecfe256501e357326b82ce9120
[ "BSD-3-Clause" ]
null
null
null
pandas/core/frame.py
UrielMaD/pandas
b5233c447f3ed0ecfe256501e357326b82ce9120
[ "BSD-3-Clause" ]
null
null
null
pandas/core/frame.py
UrielMaD/pandas
b5233c447f3ed0ecfe256501e357326b82ce9120
[ "BSD-3-Clause" ]
null
null
null
""" DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to do with the labeling information """ from __future__ import...
34.371501
170
0.531602
from __future__ import annotations import collections from collections import abc import datetime from io import StringIO import itertools import mmap from textwrap import dedent from typing import ( IO, TYPE_CHECKING, Any, AnyStr, Dict, FrozenSet, Hashable, Iterable, Iterator, ...
true
true
f710668d288a186a66be2bcf743c10315b88fa0a
2,738
py
Python
taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/compat.py
hectormartinez/rougexstem
32da9eab253cb88fc1882e59026e8b5b40900a25
[ "Apache-2.0" ]
null
null
null
taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/compat.py
hectormartinez/rougexstem
32da9eab253cb88fc1882e59026e8b5b40900a25
[ "Apache-2.0" ]
null
null
null
taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/compat.py
hectormartinez/rougexstem
32da9eab253cb88fc1882e59026e8b5b40900a25
[ "Apache-2.0" ]
null
null
null
# Natural Language Toolkit: Compatibility Functions # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Steven Bird <sb@csse.unimelb.edu.au> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT """ Backwards compatibility with previ...
34.658228
70
0.597516
true
true
f710673561a8d0361c9a9589feaf7aab93ae560e
231
py
Python
servermanager/admin.py
wjzhangcsu/MyDjangoBlog
6f1a1d9205ad84b38ba1cbc1bf3bdba46eaaa9d7
[ "MIT" ]
1
2018-04-23T06:29:22.000Z
2018-04-23T06:29:22.000Z
servermanager/admin.py
lxguidu/DjangoBlog
620ab1d8131cc7124d5a85fc1ef153a4271d4abc
[ "MIT" ]
15
2020-02-11T21:37:20.000Z
2022-03-11T23:12:25.000Z
servermanager/admin.py
wjzhangcsu/MyDjangoBlog
6f1a1d9205ad84b38ba1cbc1bf3bdba46eaaa9d7
[ "MIT" ]
null
null
null
from django.contrib import admin # Register your models here. from .models import commands class CommandsAdmin(admin.ModelAdmin): list_display = ('title', 'command', 'describe') admin.site.register(commands, CommandsAdmin)
21
51
0.766234
from django.contrib import admin from .models import commands class CommandsAdmin(admin.ModelAdmin): list_display = ('title', 'command', 'describe') admin.site.register(commands, CommandsAdmin)
true
true
f71069b14bf1ad73d77cf9f7bb28f95c8cd7322e
1,506
py
Python
lib/surface/compute/vpn_tunnels/__init__.py
google-cloud-sdk-unofficial/google-cloud-sdk
2a48a04df14be46c8745050f98768e30474a1aac
[ "Apache-2.0" ]
2
2019-11-10T09:17:07.000Z
2019-12-18T13:44:08.000Z
lib/surface/compute/vpn_tunnels/__init__.py
google-cloud-sdk-unofficial/google-cloud-sdk
2a48a04df14be46c8745050f98768e30474a1aac
[ "Apache-2.0" ]
null
null
null
lib/surface/compute/vpn_tunnels/__init__.py
google-cloud-sdk-unofficial/google-cloud-sdk
2a48a04df14be46c8745050f98768e30474a1aac
[ "Apache-2.0" ]
1
2020-07-25T01:40:19.000Z
2020-07-25T01:40:19.000Z
# -*- coding: utf-8 -*- # # Copyright 2014 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
34.227273
117
0.749668
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from googlecloudsdk.calliope import base class VpnTunnels(base.Group): detailed_help = None VpnTunnels.category = base.NETWORKING_CATEGORY VpnTunnels.detailed_help = { 'DESCRIP...
true
true
f7106e85bf3410c064655c4349ec8f21e9e33c1d
450
py
Python
src/conreality/sdk/message.py
conreality/conreality.py
7c5d40367aebdc69eb2c77bc71793b8dd5737c29
[ "Unlicense" ]
4
2017-06-16T21:21:06.000Z
2018-06-06T10:20:48.000Z
src/conreality/sdk/message.py
conreality/conreality.py
7c5d40367aebdc69eb2c77bc71793b8dd5737c29
[ "Unlicense" ]
2
2020-07-02T04:41:51.000Z
2022-02-11T06:31:54.000Z
src/conreality/sdk/message.py
conreality/conreality.py
7c5d40367aebdc69eb2c77bc71793b8dd5737c29
[ "Unlicense" ]
null
null
null
# This is free and unencumbered software released into the public domain. class Message: """A message.""" def __init__(self, id=None): self.id = id def __repr__(self): """Returns a human-readable string representation of this object.""" return "message{{id={}}}".format(self.id) ...
28.125
76
0.642222
class Message: def __init__(self, id=None): self.id = id def __repr__(self): return "message{{id={}}}".format(self.id) def __str__(self): return self.__repr__()
true
true
f7106e89f73ac2d0682993b85172d2beb9988f1a
3,271
py
Python
exchangelib/configuration.py
ifour92/exchangelib
eb86f2ab9f9a16e07f0d19e0dcf69065b02d9f8a
[ "BSD-2-Clause" ]
null
null
null
exchangelib/configuration.py
ifour92/exchangelib
eb86f2ab9f9a16e07f0d19e0dcf69065b02d9f8a
[ "BSD-2-Clause" ]
null
null
null
exchangelib/configuration.py
ifour92/exchangelib
eb86f2ab9f9a16e07f0d19e0dcf69065b02d9f8a
[ "BSD-2-Clause" ]
null
null
null
import logging from cached_property import threaded_cached_property from .credentials import BaseCredentials from .protocol import RetryPolicy, FailFast from .transport import AUTH_TYPE_MAP from .util import split_url from .version import Version log = logging.getLogger(__name__) class Configuration: """ A...
43.039474
120
0.682972
import logging from cached_property import threaded_cached_property from .credentials import BaseCredentials from .protocol import RetryPolicy, FailFast from .transport import AUTH_TYPE_MAP from .util import split_url from .version import Version log = logging.getLogger(__name__) class Configuration: def __ini...
true
true
f710702e90b4523c81be699400931b542b2a5907
668
py
Python
libraries/boost-build/src/example/python_modules/python_helpers.py
austinkeller/pwiz
aa8e575cb40fd5e97cc7d922e4d8da44c9277cca
[ "Apache-2.0" ]
198
2015-01-13T05:47:18.000Z
2022-03-09T04:46:46.000Z
libs/boost/tools/build/example/python_modules/python_helpers.py
flingone/frameworks_base_cmds_remoted
4509d9f0468137ed7fd8d100179160d167e7d943
[ "Apache-2.0" ]
61
2015-05-27T11:20:11.000Z
2019-12-20T15:06:21.000Z
libs/boost/tools/build/example/python_modules/python_helpers.py
flingone/frameworks_base_cmds_remoted
4509d9f0468137ed7fd8d100179160d167e7d943
[ "Apache-2.0" ]
139
2015-01-15T20:09:31.000Z
2022-01-31T15:21:16.000Z
# Copyright 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Declare a couple of functions called from Boost.Build # # Each function will receive as many arguments as there ":"-separated # argument...
37.111111
82
0.715569
def test1(l): return ["foo", "bar"] def test2(l, l2): return [l[0], l2[0]]
true
true
f7107105fc2ad424c38b5ad9e757ac35f41dbfc7
3,837
py
Python
aiida/cmdline/commands/cmd_data/cmd_remote.py
lekah/aiida_core
54b22a221657b47044483dc9d4f51788ce8ab6b2
[ "BSD-2-Clause" ]
null
null
null
aiida/cmdline/commands/cmd_data/cmd_remote.py
lekah/aiida_core
54b22a221657b47044483dc9d4f51788ce8ab6b2
[ "BSD-2-Clause" ]
null
null
null
aiida/cmdline/commands/cmd_data/cmd_remote.py
lekah/aiida_core
54b22a221657b47044483dc9d4f51788ce8ab6b2
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
40.389474
105
0.614021
true
true
f71071d4bb2196aec59b0c0f18d4ae62abec55f4
1,313
py
Python
api/clean/sequence_nick.py
Latent-Lxx/dazhou-dw
902b4b625cda4c9e4eb205017b8955b81f37a0b5
[ "MIT" ]
null
null
null
api/clean/sequence_nick.py
Latent-Lxx/dazhou-dw
902b4b625cda4c9e4eb205017b8955b81f37a0b5
[ "MIT" ]
null
null
null
api/clean/sequence_nick.py
Latent-Lxx/dazhou-dw
902b4b625cda4c9e4eb205017b8955b81f37a0b5
[ "MIT" ]
1
2022-02-11T04:44:37.000Z
2022-02-11T04:44:37.000Z
# !/usr/bin/python3 # -*- coding: utf-8 -*- # @Time : 2021/7/5 下午5:29 # @Author : Latent # @Email : latentsky@gmail.com # @File : sequence_nick.py # @Software: PyCharm # @class : 清晰店铺的相关信息 """ 字段说明: 1.nick_id ---->数据库自增 2.nick_name 3.nick 4.brand 5.company_name 6.platform """ from tools_class import Tools_Class cla...
20.84127
57
0.529322
from tools_class import Tools_Class class Sequence_Nick(object): @classmethod def sequence_brand(cls, data): seller = Sequence_Nick.sequence_seller(data=data) sid = Tools_Class.tools_md5(nick=seller) brand = data['public']['brand'] ...
true
true
f710733735df4a859b306164419416ca4ee1c954
889
py
Python
setup.py
whitehead-internal/DialogTag
226def810db21fd34c1ac9363e841a3357dacf96
[ "MIT" ]
null
null
null
setup.py
whitehead-internal/DialogTag
226def810db21fd34c1ac9363e841a3357dacf96
[ "MIT" ]
null
null
null
setup.py
whitehead-internal/DialogTag
226def810db21fd34c1ac9363e841a3357dacf96
[ "MIT" ]
null
null
null
import setuptools with open("README.md", mode="r", encoding="utf-8") as readme_file: long_description = readme_file.read() setuptools.setup( name="DialogTag", version="1.1.3", author="Bhavitvya Malik", author_email="bhavitvya.malik@gmail.com", description="A python library to classify dialogue...
30.655172
70
0.662542
import setuptools with open("README.md", mode="r", encoding="utf-8") as readme_file: long_description = readme_file.read() setuptools.setup( name="DialogTag", version="1.1.3", author="Bhavitvya Malik", author_email="bhavitvya.malik@gmail.com", description="A python library to classify dialogue...
true
true
f7107448bde30ae16755d5ac91e74e290f2cc800
1,086
py
Python
autodiff/examples/svm.py
gwtaylor/pyautodiff
7973e26f1c233570ed4bb10d08634ec7378e2152
[ "BSD-3-Clause" ]
59
2015-02-03T20:50:59.000Z
2020-05-26T05:38:54.000Z
autodiff/examples/svm.py
gwtaylor/pyautodiff
7973e26f1c233570ed4bb10d08634ec7378e2152
[ "BSD-3-Clause" ]
3
2015-05-10T06:22:45.000Z
2016-12-06T02:20:58.000Z
autodiff/examples/svm.py
gwtaylor/pyautodiff
7973e26f1c233570ed4bb10d08634ec7378e2152
[ "BSD-3-Clause" ]
11
2015-04-15T16:52:09.000Z
2017-06-28T12:10:39.000Z
""" Linear SVM ========== This script fits a linear support vector machine classifier to random data. It illustrates how a function defined purely by NumPy operations can be minimized directly with a gradient-based solver. """ import numpy as np from autodiff.optimize import fmin_l_bfgs_b def test_svm(): rng =...
24.681818
79
0.632597
import numpy as np from autodiff.optimize import fmin_l_bfgs_b def test_svm(): rng = np.random.RandomState(1) x = rng.rand(10, 5) y = 2 * (rng.rand(10) > 0.5) - 1 l2_regularization = 1e-4 def loss_fn(weights, bias): margin = y * (np.dot(x, weights) + bias) loss = np.max...
true
true
f71075962ac4461a97d97f6545a5d430a4db8c29
1,259
py
Python
PyRemoteConsole/common_connection.py
Wykleph/PyRemoteConsole
98c4df6c78060c1506681965a05d5240165eb111
[ "MIT" ]
null
null
null
PyRemoteConsole/common_connection.py
Wykleph/PyRemoteConsole
98c4df6c78060c1506681965a05d5240165eb111
[ "MIT" ]
null
null
null
PyRemoteConsole/common_connection.py
Wykleph/PyRemoteConsole
98c4df6c78060c1506681965a05d5240165eb111
[ "MIT" ]
null
null
null
try: from prawframe.obfuscation import Scrambler except ImportError: from .obfuscation import Encryptor def bytes_packet(_bytes, termination_string=']'): """ Create a packet containing the amount of bytes for the proceeding data. :param _bytes: :param termination_string: :return: """ ...
24.686275
75
0.656076
try: from prawframe.obfuscation import Scrambler except ImportError: from .obfuscation import Encryptor def bytes_packet(_bytes, termination_string=']'): return '{}{}'.format(len(_bytes), termination_string) def scrambles_input_unscrambles_output(func): scrambler = Encryptor().load_key_file() ...
true
true
f710765d0c0048687b632aaad0876e54da59b574
2,249
py
Python
lib/models/resnet_trans_head.py
hz-ants/CDPN-source-
625f9a80858f8a2fb9e74f88ea83073495141693
[ "Apache-2.0" ]
31
2020-12-21T09:36:30.000Z
2022-03-04T03:27:48.000Z
lib/models/resnet_trans_head.py
hz-ants/CDPN-source-
625f9a80858f8a2fb9e74f88ea83073495141693
[ "Apache-2.0" ]
3
2021-03-29T10:54:41.000Z
2021-04-28T08:33:48.000Z
lib/models/resnet_trans_head.py
hz-ants/CDPN-source-
625f9a80858f8a2fb9e74f88ea83073495141693
[ "Apache-2.0" ]
13
2020-12-21T09:42:05.000Z
2022-03-25T06:04:24.000Z
import torch.nn as nn import torch class TransHeadNet(nn.Module): def __init__(self, in_channels, num_layers=3, num_filters=256, kernel_size=3, output_dim=3, freeze=False, with_bias_end=True): super(TransHeadNet, self).__init__() self.freeze = freeze if kernel_size == 3: ...
37.483333
134
0.549133
import torch.nn as nn import torch class TransHeadNet(nn.Module): def __init__(self, in_channels, num_layers=3, num_filters=256, kernel_size=3, output_dim=3, freeze=False, with_bias_end=True): super(TransHeadNet, self).__init__() self.freeze = freeze if kernel_size == 3: ...
true
true
f710769b0ae8210f3a325400b468f41629c87e45
4,382
py
Python
pipelines/cont_pipeline.py
SurvivorT/SRTP
1ddc0c4ec31d61daf9f4292c533722e61818eb51
[ "MIT" ]
489
2017-02-21T21:40:22.000Z
2022-03-31T08:01:30.000Z
pipelines/cont_pipeline.py
AliBeikmohammadi/MADRL
3156eb6d6a1e8a4c91ff1dce9f5fc565b2c25c94
[ "MIT" ]
35
2017-03-10T12:28:11.000Z
2022-02-14T14:58:21.000Z
pipelines/cont_pipeline.py
AliBeikmohammadi/MADRL
3156eb6d6a1e8a4c91ff1dce9f5fc565b2c25c94
[ "MIT" ]
121
2017-02-24T20:13:53.000Z
2022-03-08T08:56:32.000Z
#!/usr/bin/env python # # File: cont_pipeline.py # # Created: Friday, July 15 2016 by rejuvyesh <mail@rejuvyesh.com> # import argparse import os import yaml import shutil import rltools from pipelines import pipeline # Fix python 2.x try: input = raw_input except NameError: pass def phase_train(spec, spec_f...
43.82
166
0.438384
import argparse import os import yaml import shutil import rltools from pipelines import pipeline try: input = raw_input except NameError: pass def phase_train(spec, spec_file): rltools.util.header('=== Running {} ==='.format(spec_file)) storagedir = spec['options']['storagedir'] n_...
true
true
f71076ba0db1bec326551e5faa965b228c3a02be
1,296
py
Python
src/resnet_model/read_lmdb.py
Granular-data/cloudless
e45d93b48b8e668a8a6cea6fab51d59f389591a8
[ "Apache-2.0" ]
null
null
null
src/resnet_model/read_lmdb.py
Granular-data/cloudless
e45d93b48b8e668a8a6cea6fab51d59f389591a8
[ "Apache-2.0" ]
null
null
null
src/resnet_model/read_lmdb.py
Granular-data/cloudless
e45d93b48b8e668a8a6cea6fab51d59f389591a8
[ "Apache-2.0" ]
null
null
null
import sys sys.path.insert(0,'../../../deeplab-public-ver2/python') import caffe import leveldb import numpy as np from caffe.proto import caffe_pb2 import csv import cv2 # Wei Yang 2015-08-19 # Source # Read LevelDB/LMDB # ================== # http://research.beenfrog.com/code/2015/03/28/read-leveldb-lmdb-f...
25.411765
97
0.623457
import sys sys.path.insert(0,'../../../deeplab-public-ver2/python') import caffe import leveldb import numpy as np from caffe.proto import caffe_pb2 import csv import cv2 leveldb_dir = "../../../../datasets/planet_cloudless/leveldb/train_leveldb" PC_DIR = "../../../../datasets/planet_cloudless/" OUT_DIR =...
true
true
f71076f22cf14b8fce877f67e5317aca94dd9306
7,920
py
Python
docs/conf.py
determined-ai/pedl_sphinx_theme
9edfa7c6ce6926def9fc69b8ddd7666f3419a907
[ "MIT" ]
null
null
null
docs/conf.py
determined-ai/pedl_sphinx_theme
9edfa7c6ce6926def9fc69b8ddd7666f3419a907
[ "MIT" ]
2
2020-03-10T00:15:46.000Z
2020-04-04T19:39:15.000Z
docs/conf.py
determined-ai/pedl_sphinx_theme
9edfa7c6ce6926def9fc69b8ddd7666f3419a907
[ "MIT" ]
null
null
null
import sys import os sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('./demo/')) from determined_ai_sphinx_theme import __version__ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # do...
31.935484
80
0.716162
import sys import os sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('./demo/')) from determined_ai_sphinx_theme import __version__ extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinxcontrib.httpdomain', ] suppress_warning...
true
true