hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71c29769d72428dea8c648a9ffeb523dd34dd62 | 6,207 | py | Python | examples/mountaincar.py | knollsen/agent57 | 7d3d7890f8eb3a1420945e0b7bcb85ad87459167 | [
"MIT"
] | 1 | 2021-02-24T08:22:35.000Z | 2021-02-24T08:22:35.000Z | examples/mountaincar.py | knollsen/agent57 | 7d3d7890f8eb3a1420945e0b7bcb85ad87459167 | [
"MIT"
] | null | null | null | examples/mountaincar.py | knollsen/agent57 | 7d3d7890f8eb3a1420945e0b7bcb85ad87459167 | [
"MIT"
] | null | null | null | import gym
from keras.optimizers import Adam
import traceback
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
from agent.agent57 import ActorUser
from agent.policy import EpsilonGreedy, AnnealingEpsilonGreedy
from agent.memory import PERRankBaseMemory, PERProportionalMemory
from ... | 27.343612 | 80 | 0.595779 | import gym
from keras.optimizers import Adam
import traceback
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
from agent.agent57 import ActorUser
from agent.policy import EpsilonGreedy, AnnealingEpsilonGreedy
from agent.memory import PERRankBaseMemory, PERProportionalMemory
from ... | true | true |
f71c2a25b344a3cfa098ae966121ffc6edd9ccd3 | 4,074 | py | Python | train.py | artemkurylev/Context-Aware_Crowd_Counting-pytorch | d68ddd87b99f2afc512357cb8fcb0ca41ea22865 | [
"MIT"
] | 71 | 2019-05-21T02:10:46.000Z | 2022-03-17T05:19:35.000Z | train.py | GuoleiSun/Context-Aware_Crowd_Counting-pytorch | d68ddd87b99f2afc512357cb8fcb0ca41ea22865 | [
"MIT"
] | 28 | 2019-05-14T01:32:21.000Z | 2021-07-06T08:39:10.000Z | train.py | GuoleiSun/Context-Aware_Crowd_Counting-pytorch | d68ddd87b99f2afc512357cb8fcb0ca41ea22865 | [
"MIT"
] | 22 | 2019-05-22T09:38:51.000Z | 2022-03-22T23:31:25.000Z | import numpy as np
import time
import torch
import torch.nn as nn
import os
import visdom
import random
from tqdm import tqdm as tqdm
from cannet import CANNet
from my_dataset import CrowdDataset
if __name__=="__main__":
# configuration
train_image_root='./data/Shanghai_part_A/train_data/images'
train_dma... | 32.854839 | 124 | 0.60972 | import numpy as np
import time
import torch
import torch.nn as nn
import os
import visdom
import random
from tqdm import tqdm as tqdm
from cannet import CANNet
from my_dataset import CrowdDataset
if __name__=="__main__":
train_image_root='./data/Shanghai_part_A/train_data/images'
train_dmap_root='./data/... | true | true |
f71c2aa0bf024d0c142df184c4a0782128c38601 | 579 | py | Python | tests/test_ext_indicator_cycles.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 2,298 | 2019-02-20T18:38:18.000Z | 2022-03-31T07:45:50.000Z | tests/test_ext_indicator_cycles.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 451 | 2019-02-26T00:50:02.000Z | 2022-03-31T03:17:39.000Z | tests/test_ext_indicator_cycles.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 579 | 2019-03-19T01:53:03.000Z | 2022-03-31T11:13:50.000Z | from pandas.core.series import Series
from .config import sample_data
from .context import pandas_ta
from unittest import TestCase
from pandas import DataFrame
class TestCylesExtension(TestCase):
@classmethod
def setUpClass(cls):
cls.data = sample_data
@classmethod
def tearDownClass(cls):
... | 22.269231 | 61 | 0.70639 | from pandas.core.series import Series
from .config import sample_data
from .context import pandas_ta
from unittest import TestCase
from pandas import DataFrame
class TestCylesExtension(TestCase):
@classmethod
def setUpClass(cls):
cls.data = sample_data
@classmethod
def tearDownClass(cls):
... | true | true |
f71c2bcacd1a2766209c84a64e9d8e489810169f | 274 | py | Python | buildscripts/condarecipe.hsa/run_test.py | ehsantn/numba | 4749ef7ccc630b7f649ec972497bc5b7fca79303 | [
"BSD-2-Clause",
"MIT"
] | 4 | 2017-06-30T14:22:30.000Z | 2021-01-11T16:47:23.000Z | buildscripts/condarecipe.hsa/run_test.py | ehsantn/numba | 4749ef7ccc630b7f649ec972497bc5b7fca79303 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2018-04-03T22:37:40.000Z | 2018-04-03T23:53:43.000Z | buildscripts/condarecipe.hsa/run_test.py | ehsantn/numba | 4749ef7ccc630b7f649ec972497bc5b7fca79303 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | import sys
import numba
args = []
if sys.platform.startswith('win32'):
args += ['-b']
else:
args += ['-m', '-b']
args += ['numba.tests']
if not numba.runtests.main(*args):
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| 18.266667 | 50 | 0.613139 | import sys
import numba
args = []
if sys.platform.startswith('win32'):
args += ['-b']
else:
args += ['-m', '-b']
args += ['numba.tests']
if not numba.runtests.main(*args):
print("Test failed")
sys.exit(1)
print('numba.__version__: %s' % numba.__version__)
| true | true |
f71c2c1d589bfaed486a8c50f486a53a358a0d09 | 59,359 | py | Python | python/ccxt/async_support/timex.py | sandutsar/ccxt | f27c187fa1626a6c261c6fa5caaae89cb657461d | [
"MIT"
] | null | null | null | python/ccxt/async_support/timex.py | sandutsar/ccxt | f27c187fa1626a6c261c6fa5caaae89cb657461d | [
"MIT"
] | null | null | null | python/ccxt/async_support/timex.py | sandutsar/ccxt | f27c187fa1626a6c261c6fa5caaae89cb657461d | [
"MIT"
] | null | null | null | # -*- 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.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticatio... | 43.904586 | 2,235 | 0.497953 |
rt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.er... | true | true |
f71c2d2de4124b6e764541c80fea3098c5dcf2c2 | 231,565 | py | Python | zerver/tests/test_messages.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_messages.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_messages.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | from django.db import IntegrityError
from django.db.models import Q
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils.timezone import now as timezone_now
from zerver.lib import bugdown
from zerver.decorator import JsonableError
f... | 44.023764 | 145 | 0.613132 | from django.db import IntegrityError
from django.db.models import Q
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils.timezone import now as timezone_now
from zerver.lib import bugdown
from zerver.decorator import JsonableError
f... | true | true |
f71c2d89d64d953f36a10a9d27d38da71f45ea05 | 436 | py | Python | Python/python-practice/chapter7-while/sandwich_orders.py | jiaoqiyuan/Tests | a3595b0e4b430d910f90e428d6b6b4465f67a059 | [
"Apache-2.0"
] | null | null | null | Python/python-practice/chapter7-while/sandwich_orders.py | jiaoqiyuan/Tests | a3595b0e4b430d910f90e428d6b6b4465f67a059 | [
"Apache-2.0"
] | null | null | null | Python/python-practice/chapter7-while/sandwich_orders.py | jiaoqiyuan/Tests | a3595b0e4b430d910f90e428d6b6b4465f67a059 | [
"Apache-2.0"
] | null | null | null | sandwich_orders = ['aaa', 'pastrami', 'bbb', 'pastrami', 'ccc','pastrami']
finished_sandwiches = []
print("\nAll pastrami had been sold!")
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
while sandwich_orders:
sandwich_order = sandwich_orders.pop()
print("\nI made your tuna sanwichi... | 33.538462 | 74 | 0.729358 | sandwich_orders = ['aaa', 'pastrami', 'bbb', 'pastrami', 'ccc','pastrami']
finished_sandwiches = []
print("\nAll pastrami had been sold!")
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
while sandwich_orders:
sandwich_order = sandwich_orders.pop()
print("\nI made your tuna sanwichi... | true | true |
f71c2e710a36a4f82f3feb6e43398072d821ab5d | 219 | py | Python | olc_webportalv2/cowbat/admin.py | OLC-Bioinformatics/olc_genomics_portal | d70ec669a3a49106f8290fff5dee089726259a23 | [
"MIT"
] | 3 | 2019-01-03T21:22:21.000Z | 2019-04-23T15:47:29.000Z | olc_webportalv2/cowbat/admin.py | lowandrew/olc_webportalv2 | e75ba1b7af85bb25b59138d31e268ecde6616208 | [
"MIT"
] | 49 | 2019-01-03T18:15:12.000Z | 2022-03-11T23:37:20.000Z | olc_webportalv2/cowbat/admin.py | OLC-Bioinformatics/olc_webportalv2 | d70ec669a3a49106f8290fff5dee089726259a23 | [
"MIT"
] | 58 | 2019-01-03T21:21:59.000Z | 2021-11-02T18:00:20.000Z | from django.contrib import admin
from .models import DataFile, SequencingRun, InterOpFile
# Register your models here.
admin.site.register(DataFile)
admin.site.register(SequencingRun)
admin.site.register(InterOpFile)
| 24.333333 | 56 | 0.826484 | from django.contrib import admin
from .models import DataFile, SequencingRun, InterOpFile
admin.site.register(DataFile)
admin.site.register(SequencingRun)
admin.site.register(InterOpFile)
| true | true |
f71c3158cd7fa547b538702286ea7c2954416084 | 2,113 | py | Python | nipype/interfaces/afni/tests/test_auto_ROIStats.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_ROIStats.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 2 | 2018-04-26T12:09:32.000Z | 2018-04-27T06:36:49.000Z | nipype/interfaces/afni/tests/test_auto_ROIStats.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 1 | 2019-11-14T14:16:57.000Z | 2019-11-14T14:16:57.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..preprocess import ROIStats
def test_ROIStats_inputs():
input_map = dict(
args=dict(argstr='%s', ),
debug=dict(argstr='-debug', ),
environ=dict(
nohash=True,
usedefault=True,
),
format1D=dic... | 28.945205 | 67 | 0.510648 |
from ..preprocess import ROIStats
def test_ROIStats_inputs():
input_map = dict(
args=dict(argstr='%s', ),
debug=dict(argstr='-debug', ),
environ=dict(
nohash=True,
usedefault=True,
),
format1D=dict(
argstr='-1Dformat',
xor=['... | true | true |
f71c315a2c062c492837c96d407768a4e6981339 | 2,392 | py | Python | libs/cherrypy/tutorial/tut06_default_method.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 674 | 2015-11-06T04:22:47.000Z | 2022-02-26T17:31:43.000Z | libs/cherrypy/tutorial/tut06_default_method.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 713 | 2015-11-06T10:48:58.000Z | 2018-11-27T16:32:18.000Z | libs/cherrypy/tutorial/tut06_default_method.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 115 | 2015-01-08T14:41:00.000Z | 2022-02-13T12:31:17.000Z | """
Tutorial - The default method
Request handler objects can implement a method called "default" that
is called when no other suitable method/object could be found.
Essentially, if CherryPy2 can't find a matching request handler object
for the given request URI, it will use the default method of the object
located de... | 37.375 | 74 | 0.669732 |
import cherrypy
class UsersPage:
def index(self):
# display a list of links to random, made-up users. In a real
# application, this could be generated from a database result set.
return '''
<a href="./remi">Remi Delon</a><br/>
<a href="./hendrik">Hendrik ... | true | true |
f71c31685adf10f4b09b39fca342aeaf980132fc | 9,541 | py | Python | image-classifier/image-classifier.py | subhadip7879/neural-net | 04aacf7cdec89ea0f58f2c7397c72adefa8c2d4e | [
"MIT"
] | null | null | null | image-classifier/image-classifier.py | subhadip7879/neural-net | 04aacf7cdec89ea0f58f2c7397c72adefa8c2d4e | [
"MIT"
] | 3 | 2017-10-29T17:39:20.000Z | 2017-10-29T18:35:08.000Z | image-classifier/image-classifier.py | subhadip7879/neural-net | 04aacf7cdec89ea0f58f2c7397c72adefa8c2d4e | [
"MIT"
] | 6 | 2017-10-29T17:32:46.000Z | 2018-10-05T09:49:31.000Z | from IPython.display import Image
Image('images/02_network_flowchart.png')
Image('images/02_convolution.png')
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import time
from datetime import timedelta
import math
from tensorflow.examples.tutoria... | 30.097792 | 87 | 0.659889 | from IPython.display import Image
Image('images/02_network_flowchart.png')
Image('images/02_convolution.png')
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import time
from datetime import timedelta
import math
from tensorflow.examples.tutoria... | true | true |
f71c319545eacca0285b17d4ce54f5d246ae71d3 | 17,588 | py | Python | twilio/rest/trunking/v1/trunk/phone_number.py | neetaramaswamy/twilio-python | 28472ffab1a170824ba17f12a6c1692a5e849439 | [
"MIT"
] | 30 | 2018-06-12T12:00:53.000Z | 2021-05-02T01:27:16.000Z | venv/lib/python3.6/site-packages/twilio/rest/trunking/v1/trunk/phone_number.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 10 | 2020-06-06T01:10:07.000Z | 2022-03-12T00:12:22.000Z | venv/lib/python3.6/site-packages/twilio/rest/trunking/v1/trunk/phone_number.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 4 | 2018-06-12T14:14:20.000Z | 2018-06-19T16:01:49.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... | 30.641115 | 99 | 0.609108 |
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class PhoneNumberList(ListResource):
def __... | true | true |
f71c31b5f216202481da86a95da2f3bc59155e05 | 20,865 | py | Python | autotest/osr/osr_ct.py | bnordgren/gdal | 8b9bff36d6e2c4eceb56e8f596286be7f3fc9f24 | [
"MIT"
] | 1 | 2018-11-29T10:15:53.000Z | 2018-11-29T10:15:53.000Z | autotest/osr/osr_ct.py | a0x8o/gdal | 54aa47ee60eea48fa4989d6ce41fdae4e02c6458 | [
"MIT"
] | 1 | 2017-12-30T02:12:01.000Z | 2017-12-30T02:12:01.000Z | autotest/osr/osr_ct.py | notcaremath/gdal | 2c1586ffda1e49d170b96f8f0d87bc7516554047 | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test coordinate transformations.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
########################################################... | 36.161179 | 458 | 0.620129 | true | true | |
f71c32e40c090845453a2573a352eecf99ded05c | 2,896 | py | Python | openml/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | openml/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | openml/__init__.py | Rong-Inspur/openml-python | 07d429c843cf589d8096db76d520317acf7a99ab | [
"BSD-3-Clause"
] | null | null | null | """
The OpenML module implements a python interface to
`OpenML <https://www.openml.org>`_, a collaborative platform for machine
learning. OpenML can be used to
* store, download and analyze datasets
* make experiments and their results (e.g. models, predictions)
accesible and reproducible for everybody
* analyze exp... | 23.737705 | 76 | 0.699931 |
from . import _api_calls
from . import config
from .datasets import OpenMLDataset, OpenMLDataFeature
from . import datasets
from . import evaluations
from .evaluations import OpenMLEvaluation
from . import extensions
from . import exceptions
from . import tasks
from .tasks import (
OpenMLTask,
OpenMLSplit,
... | true | true |
f71c33cccf1872a2d06d40b32de68921437e9c87 | 540 | py | Python | src/bos_consensus/middlewares/blockchain/base.py | LuffyEMonkey/isaac-consensus-protocol | 806d967d56ef8862a477b2515c7854af289c10a0 | [
"Apache-2.0"
] | 1 | 2018-04-10T11:00:59.000Z | 2018-04-10T11:00:59.000Z | src/bos_consensus/middlewares/blockchain/base.py | LuffyEMonkey/isaac-consensus-protocol | 806d967d56ef8862a477b2515c7854af289c10a0 | [
"Apache-2.0"
] | null | null | null | src/bos_consensus/middlewares/blockchain/base.py | LuffyEMonkey/isaac-consensus-protocol | 806d967d56ef8862a477b2515c7854af289c10a0 | [
"Apache-2.0"
] | null | null | null | from bos_consensus.util import LoggingMixin
class NoFurtherBlockchainMiddlewares(Exception):
pass
class StopReceiveBallot(Exception):
pass
class BaseBlockchainMiddleware(LoggingMixin):
blockchain = None
def __init__(self, blockchain):
self.blockchain = blockchain
super(BaseBlockc... | 20.769231 | 80 | 0.724074 | from bos_consensus.util import LoggingMixin
class NoFurtherBlockchainMiddlewares(Exception):
pass
class StopReceiveBallot(Exception):
pass
class BaseBlockchainMiddleware(LoggingMixin):
blockchain = None
def __init__(self, blockchain):
self.blockchain = blockchain
super(BaseBlockc... | true | true |
f71c347fa097a89874460ad438e91b290e146610 | 6,795 | py | Python | Materials/views.py | Gguidini/artheart-db-explorer | 8e854248ff799f74f2702f767e5614e154e4a7f8 | [
"MIT"
] | null | null | null | Materials/views.py | Gguidini/artheart-db-explorer | 8e854248ff799f74f2702f767e5614e154e4a7f8 | [
"MIT"
] | null | null | null | Materials/views.py | Gguidini/artheart-db-explorer | 8e854248ff799f74f2702f767e5614e154e4a7f8 | [
"MIT"
] | null | null | null | """
This file defines functions to manipulate user interaction with the web-interface.
Responsible for views related to the models defined in Materials/models.py.
"""
import os
from django.core.paginator import Paginator
from django.http import HttpResponseForbidden
from django.shortcuts import HttpResponse, redirec... | 31.027397 | 98 | 0.607653 |
import os
from django.core.paginator import Paginator
from django.http import HttpResponseForbidden
from django.shortcuts import HttpResponse, redirect, render
from django.urls import reverse_lazy
from ArtHeart.settings import MEDIA_ROOT, MEDIA_URL
from .forms import ApostilaUpload, CategoryUpload, ProjectUpload
fr... | true | true |
f71c352600ea4dd69dce91611e638d4ac22561c3 | 285 | py | Python | utils/__init__.py | 1219521375/bottom-up-attention.pytorch | 4a2e64383f024cc56728dd2a0ee63c8a171663c8 | [
"Apache-2.0"
] | 3 | 2022-02-18T13:38:47.000Z | 2022-03-30T11:30:35.000Z | utils/__init__.py | 1219521375/bottom-up-attention.pytorch | 4a2e64383f024cc56728dd2a0ee63c8a171663c8 | [
"Apache-2.0"
] | null | null | null | utils/__init__.py | 1219521375/bottom-up-attention.pytorch | 4a2e64383f024cc56728dd2a0ee63c8a171663c8 | [
"Apache-2.0"
] | null | null | null | from .utils import save_features
from .extract_features_faster import extract_feat_faster_start
from .extract_features_multigpu import extract_feat_multigpu_start
from .extract_features_singlegpu import extract_feat_singlegpu_start
from .extract_d2features import extract_feat_d2_start | 57 | 68 | 0.915789 | from .utils import save_features
from .extract_features_faster import extract_feat_faster_start
from .extract_features_multigpu import extract_feat_multigpu_start
from .extract_features_singlegpu import extract_feat_singlegpu_start
from .extract_d2features import extract_feat_d2_start | true | true |
f71c359d2395a2f0e5c51625afa87da5d3779d1a | 296,654 | py | Python | tests/test_core.py | Matheus28/emscripten | c1d3ca07227607043a92d55dee65a733851d6813 | [
"MIT"
] | null | null | null | tests/test_core.py | Matheus28/emscripten | c1d3ca07227607043a92d55dee65a733851d6813 | [
"MIT"
] | null | null | null | tests/test_core.py | Matheus28/emscripten | c1d3ca07227607043a92d55dee65a733851d6813 | [
"MIT"
] | null | null | null | # Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import glob
import hashlib
import json
import logging
import os
impor... | 33.856882 | 545 | 0.637918 |
import glob
import hashlib
import json
import logging
import os
import random
import re
import shutil
import sys
import time
import unittest
from pathlib import Path
from functools import wraps
if __name__ == '__main__':
raise Exception('do not run this file directly; do something like: tests/runner')
from too... | true | true |
f71c3617afc853a7653c8b2fa5b96fb74a081eed | 464 | py | Python | python/string-manipulation/alternating_characters.py | anishLearnsToCode/hackerrabk-interview-preparation-kit | 9d31eefe336e6dbef104ae78f06dd46686c28f84 | [
"MIT"
] | 2 | 2020-06-04T09:48:30.000Z | 2021-11-28T15:43:00.000Z | python/string-manipulation/alternating_characters.py | anishLearnsToCode/hackerrabk-interview-preparation-kit | 9d31eefe336e6dbef104ae78f06dd46686c28f84 | [
"MIT"
] | null | null | null | python/string-manipulation/alternating_characters.py | anishLearnsToCode/hackerrabk-interview-preparation-kit | 9d31eefe336e6dbef104ae78f06dd46686c28f84 | [
"MIT"
] | 1 | 2020-11-01T01:03:08.000Z | 2020-11-01T01:03:08.000Z | def minimum_deletions(string: str) -> int:
current_character = string[0]
count = 0
deletions = 0
for character in string:
if character == current_character:
count += 1
else:
current_character = character
deletions += count - 1
count = 1
... | 24.421053 | 42 | 0.594828 | def minimum_deletions(string: str) -> int:
current_character = string[0]
count = 0
deletions = 0
for character in string:
if character == current_character:
count += 1
else:
current_character = character
deletions += count - 1
count = 1
... | true | true |
f71c36d4dffacd0a0f9415f50fd7e32ca1fa2928 | 6,067 | py | Python | oops_fhir/r4/code_system/v3_substance_admin_substitution.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/code_system/v3_substance_admin_substitution.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/code_system/v3_substance_admin_substitution.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3substanceAdminSubstitution"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3substanceAdminSubstitution:
"""
v3 Code System substanceAdminSu... | 63.197917 | 890 | 0.447338 | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3substanceAdminSubstitution"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3substanceAdminSubstitution:
underscore_act_substance_admin_substit... | true | true |
f71c37bb391e2b9895264076e05236334fa0075c | 570 | py | Python | tests/test_poetcli.py | jkerola/poetcli | e307513fa073beaddd7247d944fcef7092ee95dd | [
"MIT"
] | null | null | null | tests/test_poetcli.py | jkerola/poetcli | e307513fa073beaddd7247d944fcef7092ee95dd | [
"MIT"
] | null | null | null | tests/test_poetcli.py | jkerola/poetcli | e307513fa073beaddd7247d944fcef7092ee95dd | [
"MIT"
] | null | null | null | from pytest import raises
from poetcli.main import PoetCLITest
def test_poetcli():
# test poetcli without any subcommands or arguments
with PoetCLITest() as app:
app.run()
assert app.exit_code == 0
def test_poetcli_debug():
# test that debug mode is functional
argv = ['--debug']
... | 21.923077 | 55 | 0.64386 | from pytest import raises
from poetcli.main import PoetCLITest
def test_poetcli():
with PoetCLITest() as app:
app.run()
assert app.exit_code == 0
def test_poetcli_debug():
argv = ['--debug']
with PoetCLITest(argv=argv) as app:
app.run()
assert app.debug is True
... | true | true |
f71c38457ce1146b10dc11311b97086931643887 | 2,269 | py | Python | cengal/hardware_info/cpu.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | 3 | 2018-07-23T18:48:58.000Z | 2021-07-18T14:17:20.000Z | cengal/hardware_info/cpu.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | null | null | null | cengal/hardware_info/cpu.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright © 2017 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>
#
# 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... | 31.082192 | 100 | 0.712649 |
import cpuinfo
__author__ = "ButenkoMS <gtalk@butenkoms.space>"
__copyright__ = "Copyright © 2017 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>"
__credits__ = ["ButenkoMS <gtalk@butenkoms.space>", ]
__license__ = "Apache License, Version 2.0"
__version__ = "0.0.1"
__maintainer__ =... | true | true |
f71c38629e95ab04b4b2bedf6a45506097a47901 | 6,731 | py | Python | glfw/library.py | brpollock/pyGLFW | 1f78383e0b466ad4af83270ef9631d306665e714 | [
"MIT"
] | null | null | null | glfw/library.py | brpollock/pyGLFW | 1f78383e0b466ad4af83270ef9631d306665e714 | [
"MIT"
] | null | null | null | glfw/library.py | brpollock/pyGLFW | 1f78383e0b466ad4af83270ef9631d306665e714 | [
"MIT"
] | null | null | null | """
Python bindings for GLFW.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import ctypes
import os
import glob
import sys
import subprocess
import textwrap
def _find_library_candidates(library_names,
library_file_exten... | 34.695876 | 109 | 0.588323 |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import ctypes
import os
import glob
import sys
import subprocess
import textwrap
def _find_library_candidates(library_names,
library_file_extensions,
... | true | true |
f71c38e7407523eed8a014449cd499676148e894 | 1,456 | py | Python | azure-servicefabric/azure/servicefabric/models/scaling_mechanism_description_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-servicefabric/azure/servicefabric/models/scaling_mechanism_description_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-servicefabric/azure/servicefabric/models/scaling_mechanism_description_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-10-16T13:08:23.000Z | 2018-10-16T13:08:23.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 ... | 33.860465 | 174 | 0.644231 |
from msrest.serialization import Model
class ScalingMechanismDescription(Model):
_validation = {
'kind': {'required': True},
}
_attribute_map = {
'kind': {'key': 'Kind', 'type': 'str'},
}
_subtype_map = {
'kind': {'PartitionInstanceCount': 'PartitionInstanceCo... | true | true |
f71c39ebffaad67624f3ef9efc20843ab2437935 | 4,779 | py | Python | selfdrive/controls/lib/long_mpc.py | DS1SQM/HKG082_SCC_2 | c5b1c7fb593a69b1bc585eaa9947c0a76f381bbc | [
"MIT"
] | null | null | null | selfdrive/controls/lib/long_mpc.py | DS1SQM/HKG082_SCC_2 | c5b1c7fb593a69b1bc585eaa9947c0a76f381bbc | [
"MIT"
] | null | null | null | selfdrive/controls/lib/long_mpc.py | DS1SQM/HKG082_SCC_2 | c5b1c7fb593a69b1bc585eaa9947c0a76f381bbc | [
"MIT"
] | 1 | 2020-10-20T12:26:33.000Z | 2020-10-20T12:26:33.000Z | import os
import math
import cereal.messaging as messaging
from common.numpy_fast import clip, interp
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU
from selfdrive.controls.lib.longitudinal_mpc import libmpc_py
from sel... | 35.139706 | 113 | 0.669178 | import os
import math
import cereal.messaging as messaging
from common.numpy_fast import clip, interp
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU
from selfdrive.controls.lib.longitudinal_mpc import libmpc_py
from sel... | true | true |
f71c39f0319329a2f4f59ab30550497ff4c60f40 | 6,860 | py | Python | script/bfe.py | tiancity-NJU/REID | 125a520a9c0b94440a7757e6f3c3c8bf976906ec | [
"MIT"
] | 1 | 2020-06-15T07:50:05.000Z | 2020-06-15T07:50:05.000Z | script/bfe.py | tiancity-NJU/REID | 125a520a9c0b94440a7757e6f3c3c8bf976906ec | [
"MIT"
] | null | null | null | script/bfe.py | tiancity-NJU/REID | 125a520a9c0b94440a7757e6f3c3c8bf976906ec | [
"MIT"
] | 4 | 2019-04-09T13:10:58.000Z | 2020-03-06T15:22:38.000Z | # encoding: utf-8
import os
import sys
from os import path as osp
from pprint import pprint
import numpy as np
import torch
from tensorboardX import SummaryWriter
from torch import nn
from torch.backends import cudnn
from torch.utils.data import DataLoader
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__)+o... | 34.3 | 115 | 0.655248 |
import os
import sys
from os import path as osp
from pprint import pprint
import numpy as np
import torch
from tensorboardX import SummaryWriter
from torch import nn
from torch.backends import cudnn
from torch.utils.data import DataLoader
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__)+os.sep+'..'))
fro... | true | true |
f71c3aaf6ae1025d594d51ec2a103091d3f8a9c3 | 21,405 | py | Python | pandapower/build_gen.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | 1 | 2020-10-19T06:39:15.000Z | 2020-10-19T06:39:15.000Z | pandapower/build_gen.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | null | null | null | pandapower/build_gen.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import numpy.core.numeric as ncn
from numpy import array, zeros, isnan
from pandas import DataFrame
... | 46.131466 | 120 | 0.608783 |
import numpy as np
import numpy.core.numeric as ncn
from numpy import array, zeros, isnan
from pandas import DataFrame
from pandapower.idx_bus import PV, REF, VA, VM, BUS_TYPE, NONE, VMAX, VMIN, PQ
from pandapower.idx_gen import QMIN, QMAX, PMIN, PMAX, GEN_STATUS, GEN_BUS, PG, VG, QG
def _build_gen_... | true | true |
f71c3ac798ea0aa03af1f53d6228417fc90cca0c | 861 | py | Python | abtools/__init__.py | menis/abtools | bfc7c6c508b174bb3b74d8f152156242ddd2ee77 | [
"MIT"
] | 9 | 2016-06-13T20:00:04.000Z | 2022-03-19T19:07:23.000Z | abtools/__init__.py | menis/abtools | bfc7c6c508b174bb3b74d8f152156242ddd2ee77 | [
"MIT"
] | null | null | null | abtools/__init__.py | menis/abtools | bfc7c6c508b174bb3b74d8f152156242ddd2ee77 | [
"MIT"
] | 4 | 2018-04-10T09:05:21.000Z | 2022-01-27T21:23:06.000Z | import os
if not os.environ.get('READTHEDOCS', None):
from ._compare import run as compare
from ._correct import run as correct
from ._finder import run as finder
from ._phylogeny import run as phylogeny
# import _stats as stats
from pkg_resources import get_distribution, DistributionNotFound... | 33.115385 | 74 | 0.688734 | import os
if not os.environ.get('READTHEDOCS', None):
from ._compare import run as compare
from ._correct import run as correct
from ._finder import run as finder
from ._phylogeny import run as phylogeny
from pkg_resources import get_distribution, DistributionNotFound
import os.path
... | true | true |
f71c3b9ce33e658445e5575868064ec2d77a48fe | 2,312 | py | Python | src/borg/shellpattern.py | russelldavis/borg | 20abc9d68742a8cf5da8503cef96b2e9a5c83213 | [
"BSD-3-Clause"
] | 2 | 2021-08-19T16:25:15.000Z | 2021-11-17T10:54:16.000Z | src/borg/shellpattern.py | tschwinge/borg | 3e2d5b2b220aee2db68f81bbc0108332abc9cda9 | [
"BSD-3-Clause"
] | null | null | null | src/borg/shellpattern.py | tschwinge/borg | 3e2d5b2b220aee2db68f81bbc0108332abc9cda9 | [
"BSD-3-Clause"
] | null | null | null | import os
import re
def translate(pat, match_end=r"\Z"):
"""Translate a shell-style pattern to a regular expression.
The pattern may include ``**<sep>`` (<sep> stands for the platform-specific path separator; "/" on POSIX systems) for
matching zero or more directory levels and "*" for matching zero or mo... | 35.030303 | 121 | 0.493945 | import os
import re
def translate(pat, match_end=r"\Z"):
sep = os.path.sep
n = len(pat)
i = 0
res = ""
while i < n:
c = pat[i]
i += 1
if c == "*":
if i + 1 < n and pat[i] == "*" and pat[i + 1] == sep:
res += r"... | true | true |
f71c3d9f2d35818503ab834cb34b0e0f458291f8 | 1,541 | py | Python | signal_ocean/geo/models.py | ktsitsikas-signal/SignalSDK | 1b125ae963ee2b53a2a3ec5a7ae6bf9511608355 | [
"Apache-2.0"
] | null | null | null | signal_ocean/geo/models.py | ktsitsikas-signal/SignalSDK | 1b125ae963ee2b53a2a3ec5a7ae6bf9511608355 | [
"Apache-2.0"
] | null | null | null | signal_ocean/geo/models.py | ktsitsikas-signal/SignalSDK | 1b125ae963ee2b53a2a3ec5a7ae6bf9511608355 | [
"Apache-2.0"
] | null | null | null | # noqa: D100
from dataclasses import dataclass
from decimal import Decimal
from typing import Optional
@dataclass(frozen=True)
class Country:
"""Represents a country.
Attributes:
id: The ID of the country.
name: The name of the country.
country_code: Alpha-2 codes used by the ISO 316... | 22.333333 | 78 | 0.627515 |
from dataclasses import dataclass
from decimal import Decimal
from typing import Optional
@dataclass(frozen=True)
class Country:
id: int
name: str
country_code: str
country_code_numeric: str
country_code_iso3: str
@dataclass(frozen=True)
class Port:
id: int
country_id: int
area_i... | true | true |
f71c3e06df78623471caeb98f86f952dc33b019f | 671 | py | Python | oocran/django/ns/admin.py | howls90/oocran | 9951f3ff752f9f6517a4d016476c1d1e2bb44a4d | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2018-12-12T10:32:16.000Z | 2022-02-07T19:46:10.000Z | oocran/django/ns/admin.py | howls90/oocran | 9951f3ff752f9f6517a4d016476c1d1e2bb44a4d | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-01-11T06:56:35.000Z | 2017-01-11T06:58:44.000Z | oocran/django/ns/admin.py | howls90/OOCRAN | 9951f3ff752f9f6517a4d016476c1d1e2bb44a4d | [
"Apache-2.0",
"BSD-3-Clause"
] | 6 | 2017-05-29T03:34:23.000Z | 2022-02-07T19:46:11.000Z | from django.contrib import admin
from .models import Ns, Nvf
class NsModelAdmin(admin.ModelAdmin):
list_display = ["name", "update", "timestamp"]
list_display_links = ["update"]
list_filter = ["update", "timestamp"]
list_editable = ["name"]
search_fields = ["name"]
class Meta:
model =... | 21.645161 | 50 | 0.657228 | from django.contrib import admin
from .models import Ns, Nvf
class NsModelAdmin(admin.ModelAdmin):
list_display = ["name", "update", "timestamp"]
list_display_links = ["update"]
list_filter = ["update", "timestamp"]
list_editable = ["name"]
search_fields = ["name"]
class Meta:
model =... | true | true |
f71c3fd4413d254a1be32c01d461ea5d95ef19f5 | 560 | py | Python | Video_Generation_with_Detections.py | ludvikalkhoury/Sperm-Heads-Segmentation-and-Localization-using-Urbano-s-Method | 30580d02d0981d59376fbec6b59f5146eaffef14 | [
"MIT"
] | null | null | null | Video_Generation_with_Detections.py | ludvikalkhoury/Sperm-Heads-Segmentation-and-Localization-using-Urbano-s-Method | 30580d02d0981d59376fbec6b59f5146eaffef14 | [
"MIT"
] | null | null | null | Video_Generation_with_Detections.py | ludvikalkhoury/Sperm-Heads-Segmentation-and-Localization-using-Urbano-s-Method | 30580d02d0981d59376fbec6b59f5146eaffef14 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
Initial_Frame = 900
Final_Frame = 1190
video_name = 'Sample2 with detections.avi'
frame = cv2.imread("image/Seg_frame%d.jpg" % Initial_Frame)
height, width, layers = frame.shape
fps = 15
video = cv2.VideoWriter(video_name, 0, fps, (width,height))
for x in range(I... | 22.4 | 86 | 0.676786 | import cv2
import numpy as np
Initial_Frame = 900
Final_Frame = 1190
video_name = 'Sample2 with detections.avi'
frame = cv2.imread("image/Seg_frame%d.jpg" % Initial_Frame)
height, width, layers = frame.shape
fps = 15
video = cv2.VideoWriter(video_name, 0, fps, (width,height))
for x in range(I... | true | true |
f71c41f8731671ad3e1d3a2df155f7aa93679845 | 5,182 | py | Python | instances/optimization/20210422-1717/pas1/inst-20210422-1717-c30-pas1.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/optimization/20210422-1717/pas1/inst-20210422-1717-c30-pas1.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/optimization/20210422-1717/pas1/inst-20210422-1717-c30-pas1.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PERIODS
"""
numPeriods = 180
"""
STOPS
"""
numStations = 13
station_names = (
"Hamburg Hbf", # 0
"Landwehr", # 1
"Hasselbrook", # 2
"Wansbeker Chaussee*", # 3
"Friedrichsberg*", # 4
"Barmbek*", # 5
"Alte Woehr (Stadtpark)", # 6
"Ruebenkamp (City Nord)", # 7
"Ohlsdorf*", # 8
"Kornweg", # 9
... | 20.563492 | 108 | 0.446353 |
numPeriods = 180
numStations = 13
station_names = (
"Hamburg Hbf",
"Landwehr",
"Hasselbrook",
"Wansbeker Chaussee*",
"Friedrichsberg*",
"Barmbek*",
"Alte Woehr (Stadtpark)",
"Ruebenkamp (City Nord)",
"Ohlsdorf*",
"Kornweg",
"Hoheneichen",
"Wellingsbuettel",
"Poppenbuettel*",
)
numStops ... | true | true |
f71c4289fb96b9b13572b2e0265ec5d04f90d215 | 3,523 | py | Python | nn_interpretability/model/model_repository.py | miquelmn/nn_interpretability | 2b5d2b4102016189743e09f1f3a56f2ecddfde98 | [
"MIT"
] | 41 | 2020-10-13T18:46:32.000Z | 2022-02-21T15:52:50.000Z | nn_interpretability/model/model_repository.py | miquelmn/nn_interpretability | 2b5d2b4102016189743e09f1f3a56f2ecddfde98 | [
"MIT"
] | 4 | 2021-07-11T12:38:03.000Z | 2022-03-08T14:47:38.000Z | nn_interpretability/model/model_repository.py | miquelmn/nn_interpretability | 2b5d2b4102016189743e09f1f3a56f2ecddfde98 | [
"MIT"
] | 7 | 2020-10-21T13:03:16.000Z | 2022-03-07T11:45:00.000Z | import os
import torch
from pathlib import Path
from nn_interpretability.model.definition.am_mnist_classifier import AMCNN
from nn_interpretability.model.definition.mc_dropout_cnn import CNN_Dropout
from nn_interpretability.model.definition.general_mnist_cnn import GeneralCNN
from nn_interpretability.model.definition.... | 32.62037 | 121 | 0.705081 | import os
import torch
from pathlib import Path
from nn_interpretability.model.definition.am_mnist_classifier import AMCNN
from nn_interpretability.model.definition.mc_dropout_cnn import CNN_Dropout
from nn_interpretability.model.definition.general_mnist_cnn import GeneralCNN
from nn_interpretability.model.definition.... | true | true |
f71c4337eebf63c1b6c456cfeb478e85e64e7d70 | 4,660 | py | Python | cherrytree/github_utils.py | preset-io/cherrytree | 647b7acfb8f95c6a874386183860fdf17cace49b | [
"Apache-2.0"
] | 1 | 2021-04-06T18:25:58.000Z | 2021-04-06T18:25:58.000Z | cherrytree/github_utils.py | preset-io/cherrytree | 647b7acfb8f95c6a874386183860fdf17cace49b | [
"Apache-2.0"
] | null | null | null | cherrytree/github_utils.py | preset-io/cherrytree | 647b7acfb8f95c6a874386183860fdf17cace49b | [
"Apache-2.0"
] | null | null | null | import os
import re
from collections import OrderedDict
from typing import Generator, List, Optional, Reversible
import delegator
from git import Commit
from git.exc import InvalidGitRepositoryError
from git.repo import Repo
from github import Github
from github.Label import Label
from github.Issue import Issue
from g... | 29.308176 | 89 | 0.657296 | import os
import re
from collections import OrderedDict
from typing import Generator, List, Optional, Reversible
import delegator
from git import Commit
from git.exc import InvalidGitRepositoryError
from git.repo import Repo
from github import Github
from github.Label import Label
from github.Issue import Issue
from g... | true | true |
f71c439040784630188bbe6360a6d737525bd96e | 7,063 | py | Python | NiaPy/algorithms/basic/gso.py | tuahk/NiaPy | c863d801fda8e1949a3ca716a4de7c7ca3d0ea16 | [
"MIT"
] | null | null | null | NiaPy/algorithms/basic/gso.py | tuahk/NiaPy | c863d801fda8e1949a3ca716a4de7c7ca3d0ea16 | [
"MIT"
] | null | null | null | NiaPy/algorithms/basic/gso.py | tuahk/NiaPy | c863d801fda8e1949a3ca716a4de7c7ca3d0ea16 | [
"MIT"
] | null | null | null | # encoding=utf8
# pylint: disable=mixed-indentation, trailing-whitespace, line-too-long, multiple-statements, attribute-defined-outside-init, logging-not-lazy, no-self-use, redefined-builtin, singleton-comparison, unused-argument, arguments-differ, no-else-return
import logging
from scipy.spatial.distance import euclid... | 33.794258 | 247 | 0.68781 |
import logging
from scipy.spatial.distance import euclidean
from numpy import full, apply_along_axis, argmin, copy, sum, inf, fmax, pi, where
from NiaPy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('NiaPy.algorithms.basic')
logger.setLevel('INFO')
__all__ = ['GlowwormSwarmO... | true | true |
f71c43a114c10204ad2b5ff2693265ff01dc5894 | 64 | py | Python | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 7 | 2019-06-09T13:03:18.000Z | 2022-02-19T08:50:51.000Z | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 1 | 2019-07-12T23:59:46.000Z | 2021-11-21T04:09:09.000Z | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 3 | 2020-05-01T13:18:25.000Z | 2021-03-30T11:52:33.000Z | import dr.dist
import dr.experiment
import dr.gym
import dr.ppo
| 12.8 | 20 | 0.8125 | import dr.dist
import dr.experiment
import dr.gym
import dr.ppo
| true | true |
f71c441128b684fbb0542eeb3decdebe626fc0b9 | 377 | py | Python | plugin_info.py | Attolab/pymodaq_plugins_smaract | 109808255d784bd98b875fb4886c90a1f0e9ff7b | [
"CECILL-B"
] | null | null | null | plugin_info.py | Attolab/pymodaq_plugins_smaract | 109808255d784bd98b875fb4886c90a1f0e9ff7b | [
"CECILL-B"
] | null | null | null | plugin_info.py | Attolab/pymodaq_plugins_smaract | 109808255d784bd98b875fb4886c90a1f0e9ff7b | [
"CECILL-B"
] | null | null | null | SHORT_PLUGIN_NAME = 'smaract'
package_url = 'https://github.com/CEMES-CNRS/pymodaq_plugins_samarct'
description = 'Set of PyMoDAQ plugins for linear actuators from Smaract' \
'(SLC positioners). MCS and MCS2 controllers are supported.'
author = 'David Bresteau'
author_email = 'david.bresteau@cea.fr'
# p... | 34.272727 | 74 | 0.748011 | SHORT_PLUGIN_NAME = 'smaract'
package_url = 'https://github.com/CEMES-CNRS/pymodaq_plugins_samarct'
description = 'Set of PyMoDAQ plugins for linear actuators from Smaract' \
'(SLC positioners). MCS and MCS2 controllers are supported.'
author = 'David Bresteau'
author_email = 'david.bresteau@cea.fr'
pa... | true | true |
f71c454e2944e16b15e7400432d9858fbd2966f8 | 4,678 | py | Python | cuesdk/capi.py | CorsairOfficial/cue-sdk-python | 8385369725be852eac4bd8e4323ea6661c8603e4 | [
"MIT"
] | 34 | 2020-03-25T08:57:23.000Z | 2022-03-26T16:30:06.000Z | cuesdk/capi.py | CorsairOfficial/cue-sdk-python | 8385369725be852eac4bd8e4323ea6661c8603e4 | [
"MIT"
] | 12 | 2020-03-25T08:56:28.000Z | 2022-02-18T15:20:51.000Z | cuesdk/capi.py | CorsairOfficial/cue-sdk-python | 8385369725be852eac4bd8e4323ea6661c8603e4 | [
"MIT"
] | 17 | 2020-07-24T13:29:06.000Z | 2022-02-02T22:13:43.000Z | import os
import platform
import sys
from ctypes import (CDLL, CFUNCTYPE, POINTER, sizeof, c_bool, c_char, c_int32,
c_void_p)
from .enums import (CorsairAccessMode, CorsairError, CorsairLedId,
CorsairEventId, CorsairDevicePropertyId)
from .structs import (CorsairProtocolDetails, ... | 46.316832 | 79 | 0.621633 | import os
import platform
import sys
from ctypes import (CDLL, CFUNCTYPE, POINTER, sizeof, c_bool, c_char, c_int32,
c_void_p)
from .enums import (CorsairAccessMode, CorsairError, CorsairLedId,
CorsairEventId, CorsairDevicePropertyId)
from .structs import (CorsairProtocolDetails, ... | true | true |
f71c45e85feabb8c601d3ee30aa42ca3ae609193 | 20,007 | py | Python | gt_kai.py | d-ks/gym_torcs_kai | b9e1659a18ea8a788d0c6aeb7b1111c0284b23ac | [
"MIT"
] | null | null | null | gt_kai.py | d-ks/gym_torcs_kai | b9e1659a18ea8a788d0c6aeb7b1111c0284b23ac | [
"MIT"
] | null | null | null | gt_kai.py | d-ks/gym_torcs_kai | b9e1659a18ea8a788d0c6aeb7b1111c0284b23ac | [
"MIT"
] | null | null | null | # Gym-TORCS-Kai Environment for Reinforcement Learning in TORCS
# original author : Naoto Yoshida
# (https://github.com/ugo-nama-kun/gym_torcs)
# modified version author : Daiko Kishikawa
#
# This environment is under modification. (2019.12)
#
import gym
from gym import spaces
from gym.utils import seeding
import num... | 35.410619 | 107 | 0.450992 |
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import sys
sys.path.append("./gym_torcs_kai")
import snakeoil3_gym as snakeoil3
import os
import time
class TorcsKaiEnv(gym.Env):
terminal_judge_start = 500
termination_limit_progress = 5
... | true | true |
f71c466cbf91fb905a3d1819ad2004dbe30abd3a | 775 | py | Python | app/mixin/assets.py | swelanauguste/refactored-sniffle | 1c0ea2f4d07a74d694ae3409b8b2ea3d57b9db4f | [
"MIT"
] | null | null | null | app/mixin/assets.py | swelanauguste/refactored-sniffle | 1c0ea2f4d07a74d694ae3409b8b2ea3d57b9db4f | [
"MIT"
] | null | null | null | app/mixin/assets.py | swelanauguste/refactored-sniffle | 1c0ea2f4d07a74d694ae3409b8b2ea3d57b9db4f | [
"MIT"
] | null | null | null | from django.conf import settings
from django.db import models
from django.views.generic import TemplateView
User = settings.AUTH_USER_MODEL
class TimeStampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
created_by = models.Foreign... | 22.794118 | 56 | 0.676129 | from django.conf import settings
from django.db import models
from django.views.generic import TemplateView
User = settings.AUTH_USER_MODEL
class TimeStampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
created_by = models.Foreign... | true | true |
f71c4861f8de557647d8e90f974fff337027d1d9 | 14,233 | py | Python | mnist128.py | samgregoost/self_supervised_large | 9c0c33cf374a1d5112519939012a64bca98c5f8d | [
"MIT"
] | 1 | 2021-08-25T08:32:19.000Z | 2021-08-25T08:32:19.000Z | mnist128.py | samgregoost/self_supervised_large | 9c0c33cf374a1d5112519939012a64bca98c5f8d | [
"MIT"
] | null | null | null | mnist128.py | samgregoost/self_supervised_large | 9c0c33cf374a1d5112519939012a64bca98c5f8d | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
import numpy as np
import random
import TensorflowUtils as utils
import read_MITSceneParsingDataParis as scene_parsing
import datetime
import BatchDatsetReader as dataset
from six.moves import xrange
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_integer("batch_siz... | 42.486567 | 135 | 0.622848 | from __future__ import print_function
import tensorflow as tf
import numpy as np
import random
import TensorflowUtils as utils
import read_MITSceneParsingDataParis as scene_parsing
import datetime
import BatchDatsetReader as dataset
from six.moves import xrange
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_integer("batch_siz... | true | true |
f71c490d7b16466aa2d3b6d909be2ecacb018f6b | 70 | py | Python | hashlib/hashlib/__init__.py | badgeteam/micropython-lib | fca0235c166ebbada489d88c42fc549267832797 | [
"PSF-2.0"
] | null | null | null | hashlib/hashlib/__init__.py | badgeteam/micropython-lib | fca0235c166ebbada489d88c42fc549267832797 | [
"PSF-2.0"
] | null | null | null | hashlib/hashlib/__init__.py | badgeteam/micropython-lib | fca0235c166ebbada489d88c42fc549267832797 | [
"PSF-2.0"
] | 2 | 2017-11-21T16:53:03.000Z | 2021-07-29T08:47:14.000Z | from .sha256 import sha224, sha256
from .sha512 import sha384, sha512
| 23.333333 | 34 | 0.8 | from .sha256 import sha224, sha256
from .sha512 import sha384, sha512
| true | true |
f71c4b2b7c7dee5107676ddd03075e0b5134b81f | 2,488 | py | Python | HDF5Saver.py | sizhky/carla-dataset-runner | a670d981d29de78460cd90b1d4949ee4b71d0ade | [
"MIT"
] | 48 | 2019-12-28T11:08:27.000Z | 2022-03-24T09:22:51.000Z | HDF5Saver.py | sizhky/carla-dataset-runner | a670d981d29de78460cd90b1d4949ee4b71d0ade | [
"MIT"
] | 6 | 2020-02-01T21:47:21.000Z | 2021-12-10T13:19:41.000Z | HDF5Saver.py | sizhky/carla-dataset-runner | a670d981d29de78460cd90b1d4949ee4b71d0ade | [
"MIT"
] | 19 | 2020-01-08T08:19:08.000Z | 2022-03-24T08:39:53.000Z | import h5py
import numpy as np
class HDF5Saver:
def __init__(self, sensor_width, sensor_height, file_path_to_save="data/carla_dataset.hdf5"):
self.sensor_width = sensor_width
self.sensor_height = sensor_height
self.file = h5py.File(file_path_to_save, "w")
# Creating groups to stor... | 54.086957 | 135 | 0.671624 | import h5py
import numpy as np
class HDF5Saver:
def __init__(self, sensor_width, sensor_height, file_path_to_save="data/carla_dataset.hdf5"):
self.sensor_width = sensor_width
self.sensor_height = sensor_height
self.file = h5py.File(file_path_to_save, "w")
self.rgb_group =... | true | true |
f71c4b4a5eb25c7ff024fb30f9b4ce405c736e0b | 544 | py | Python | manage.py | almazkun/PythonDjangoMozilaTut | 39e7c4d1ab9fbfe85abe90d94585fc7315617d1d | [
"MIT"
] | 1 | 2019-01-16T05:39:42.000Z | 2019-01-16T05:39:42.000Z | manage.py | almazkun/PythonDjangoMozilaTut | 39e7c4d1ab9fbfe85abe90d94585fc7315617d1d | [
"MIT"
] | null | null | null | manage.py | almazkun/PythonDjangoMozilaTut | 39e7c4d1ab9fbfe85abe90d94585fc7315617d1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'visitkoreakz.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django.... | 34 | 76 | 0.689338 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'visitkoreakz.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's in... | true | true |
f71c4b6de69a49fef47431af49540a00c27168f7 | 622 | py | Python | src/libs/components/customsmarttile.py | loghinalexandru/blackboard-greenboard | 80332bf7709e602a4d5ada31b3cf95801c06190f | [
"MIT"
] | null | null | null | src/libs/components/customsmarttile.py | loghinalexandru/blackboard-greenboard | 80332bf7709e602a4d5ada31b3cf95801c06190f | [
"MIT"
] | null | null | null | src/libs/components/customsmarttile.py | loghinalexandru/blackboard-greenboard | 80332bf7709e602a4d5ada31b3cf95801c06190f | [
"MIT"
] | null | null | null | import kivy
from functools import partial
kivy.require('2.0.0')
from kivymd.uix.imagelist import SmartTile
from constants import Screen
class CustomSmartTile(SmartTile):
def __init__(self, **kwargs):
super(CustomSmartTile, self).__init__(**kwargs)
self.height = '240dp'
self.size_hint_y = No... | 36.588235 | 93 | 0.709003 | import kivy
from functools import partial
kivy.require('2.0.0')
from kivymd.uix.imagelist import SmartTile
from constants import Screen
class CustomSmartTile(SmartTile):
def __init__(self, **kwargs):
super(CustomSmartTile, self).__init__(**kwargs)
self.height = '240dp'
self.size_hint_y = No... | true | true |
f71c4cb2928d71b7feb87e22f1a85505c3468626 | 1,416 | py | Python | processing/data_collection/gazette/spiders/es_associacao_municipios.py | marlesson/diario-oficial | 6c2b3e41d1d08a1fd47517ed55ac22ae888c88b3 | [
"MIT"
] | 3 | 2018-06-05T02:33:03.000Z | 2018-06-05T14:20:02.000Z | processing/data_collection/gazette/spiders/es_associacao_municipios.py | marlesson/diario-oficial | 6c2b3e41d1d08a1fd47517ed55ac22ae888c88b3 | [
"MIT"
] | 4 | 2018-06-07T14:55:53.000Z | 2018-06-29T12:37:12.000Z | processing/data_collection/gazette/spiders/es_associacao_municipios.py | marlesson/diario-oficial | 6c2b3e41d1d08a1fd47517ed55ac22ae888c88b3 | [
"MIT"
] | 1 | 2018-08-24T22:32:27.000Z | 2018-08-24T22:32:27.000Z | from dateparser import parse
import datetime as dt
import scrapy
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class EsAssociacaoMunicipiosSpider(BaseGazetteSpider):
TERRITORY_ID = '3200000'
name = 'es_associacao_municipios'
allowed_domains = ['diariomunicipales.or... | 35.4 | 83 | 0.633475 | from dateparser import parse
import datetime as dt
import scrapy
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class EsAssociacaoMunicipiosSpider(BaseGazetteSpider):
TERRITORY_ID = '3200000'
name = 'es_associacao_municipios'
allowed_domains = ['diariomunicipales.or... | true | true |
f71c4f6668cb080ef2ce8616c2f028e0b74e850d | 6,404 | py | Python | test/functional/mempool_persist.py | likloadm/arielcoin | bd26479189fbdbea6e6f783c9d898054ae8740b0 | [
"MIT"
] | 3 | 2022-02-24T01:44:26.000Z | 2022-03-04T12:13:08.000Z | test/functional/mempool_persist.py | likloadm/arielcoin | bd26479189fbdbea6e6f783c9d898054ae8740b0 | [
"MIT"
] | 2 | 2022-03-21T05:41:51.000Z | 2022-03-21T17:12:13.000Z | test/functional/mempool_persist.py | likloadm/arielcoin | bd26479189fbdbea6e6f783c9d898054ae8740b0 | [
"MIT"
] | 6 | 2022-02-23T10:54:43.000Z | 2022-03-24T09:05:45.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on sta... | 47.088235 | 207 | 0.698626 |
from decimal import Decimal
import os
import time
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, wait_until
class MempoolPersistTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
self... | true | true |
f71c4fd86e03f9140408817a88d200d10a2703a4 | 345 | py | Python | day07/day7_part1.py | briannamcdonald/advent-of-code-2021 | c67e3c02a84db1a0cceeefef34a8cddba311484e | [
"MIT"
] | 1 | 2021-12-05T15:04:23.000Z | 2021-12-05T15:04:23.000Z | day07/day7_part1.py | briannamcdonald/advent-of-code-2021 | c67e3c02a84db1a0cceeefef34a8cddba311484e | [
"MIT"
] | null | null | null | day07/day7_part1.py | briannamcdonald/advent-of-code-2021 | c67e3c02a84db1a0cceeefef34a8cddba311484e | [
"MIT"
] | null | null | null | def main():
data = open("day07/input.txt", "r")
lines = [line for line in data]
crabs = [int(fish.strip()) for fish in lines[0].split(",")]
median_val = sorted(crabs)[len(crabs) // 2]
fuel_sum = 0
for crab in crabs:
fuel_sum += abs(crab - median_val)
print(fuel_sum)
if __name__ =... | 21.5625 | 63 | 0.582609 | def main():
data = open("day07/input.txt", "r")
lines = [line for line in data]
crabs = [int(fish.strip()) for fish in lines[0].split(",")]
median_val = sorted(crabs)[len(crabs) // 2]
fuel_sum = 0
for crab in crabs:
fuel_sum += abs(crab - median_val)
print(fuel_sum)
if __name__ =... | true | true |
f71c503591cb93ca4d82cc8039bd0f901a19b722 | 578 | py | Python | utils/utility.py | qiyuangong/Relational_Transaction_Anon | 954cca4b073b4d0532814ac7cf77ab1ae8068c9c | [
"MIT"
] | 1 | 2020-04-16T13:40:39.000Z | 2020-04-16T13:40:39.000Z | utils/utility.py | qiyuangong/Relational_Transaction_Anon | 954cca4b073b4d0532814ac7cf77ab1ae8068c9c | [
"MIT"
] | null | null | null | utils/utility.py | qiyuangong/Relational_Transaction_Anon | 954cca4b073b4d0532814ac7cf77ab1ae8068c9c | [
"MIT"
] | 2 | 2015-12-17T01:20:39.000Z | 2019-03-10T13:51:21.000Z | """
shared functions
"""
#!/usr/bin/env python
#coding=utf-8
def cmp_str(element1, element2):
"""
compare number in str format correctley
"""
try:
return cmp(float(element1), float(element2))
except ValueError:
return cmp(element1, element2)
def list_to_str(value_list, cmpfun=cm... | 21.407407 | 67 | 0.650519 |
def cmp_str(element1, element2):
try:
return cmp(float(element1), float(element2))
except ValueError:
return cmp(element1, element2)
def list_to_str(value_list, cmpfun=cmp, sep=';'):
temp = value_list[:]
temp.sort(cmp=cmpfun)
return sep.join(temp)
| true | true |
f71c5062942eba1d7faec207ed2e124ae3fb0e61 | 603 | py | Python | app.py | zachmerrill/pyrdle | 573035cecbe3ee5cae36562a2e3b53ea4f2950a0 | [
"MIT"
] | null | null | null | app.py | zachmerrill/pyrdle | 573035cecbe3ee5cae36562a2e3b53ea4f2950a0 | [
"MIT"
] | null | null | null | app.py | zachmerrill/pyrdle | 573035cecbe3ee5cae36562a2e3b53ea4f2950a0 | [
"MIT"
] | null | null | null | from game import Game
if __name__ == '__main__':
# Initialize the game
game = Game()
# Game loop
while True:
# Get the user's guess
guess = input('Guess a word: ').lower()
# Check the guess
game.check_guess(guess)
# Print the board
game.print_board()
... | 25.125 | 47 | 0.512438 | from game import Game
if __name__ == '__main__':
game = Game()
while True:
guess = input('Guess a word: ').lower()
# Check the guess
game.check_guess(guess)
# Print the board
game.print_board()
# Check if the game is won
if game.is_won(... | true | true |
f71c51f3a090afb75de8ec1e60a2bd9eb1fb35d1 | 935 | py | Python | nnsvs/logger.py | nicolalandro/nnsvs | 45da00218dd0a445c8483f11ac891c6ef00d3925 | [
"MIT"
] | 72 | 2020-04-19T16:14:09.000Z | 2020-05-02T04:02:05.000Z | nnsvs/logger.py | nicolalandro/nnsvs | 45da00218dd0a445c8483f11ac891c6ef00d3925 | [
"MIT"
] | 1 | 2020-04-19T16:28:03.000Z | 2020-05-02T13:49:13.000Z | nnsvs/logger.py | nicolalandro/nnsvs | 45da00218dd0a445c8483f11ac891c6ef00d3925 | [
"MIT"
] | 3 | 2020-04-20T02:34:31.000Z | 2020-04-26T01:04:35.000Z | # coding: utf-8
from __future__ import absolute_import, print_function, with_statement
import logging
import os
from os.path import dirname
format = "%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s"
def getLogger(verbose=0, filename=None, name="nnsvs"):
logger = logging.getLogger(name)
if ver... | 29.21875 | 73 | 0.71123 |
from __future__ import absolute_import, print_function, with_statement
import logging
import os
from os.path import dirname
format = "%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s"
def getLogger(verbose=0, filename=None, name="nnsvs"):
logger = logging.getLogger(name)
if verbose >= 100:
... | true | true |
f71c525adccaf762f27c3b40fe128ecd416463bd | 6,309 | py | Python | dico/base/model.py | dico-api/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 37 | 2021-08-23T00:16:42.000Z | 2022-02-22T23:19:47.000Z | dico/base/model.py | dico-api/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 14 | 2021-08-07T09:01:29.000Z | 2022-02-27T15:19:36.000Z | dico/base/model.py | eunwoo1104/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 9 | 2021-08-25T04:14:05.000Z | 2022-02-27T15:08:49.000Z | import copy
import typing
from ..model.snowflake import Snowflake
if typing.TYPE_CHECKING:
from ..api import APIClient
class CopyableObject:
def copy(self):
return copy.deepcopy(self)
class EventBase:
def __init__(self, client: "APIClient", resp: dict):
self.raw: dict = resp
se... | 31.232673 | 87 | 0.579648 | import copy
import typing
from ..model.snowflake import Snowflake
if typing.TYPE_CHECKING:
from ..api import APIClient
class CopyableObject:
def copy(self):
return copy.deepcopy(self)
class EventBase:
def __init__(self, client: "APIClient", resp: dict):
self.raw: dict = resp
se... | true | true |
f71c526a7dbf0c3e5e4a74e675dd8614cf5c1f83 | 4,367 | py | Python | src/python/gh_api_repo_metrics.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | 32 | 2018-05-14T20:34:08.000Z | 2022-03-22T12:37:19.000Z | src/python/gh_api_repo_metrics.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | null | null | null | src/python/gh_api_repo_metrics.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | 6 | 2018-07-11T17:15:07.000Z | 2021-08-02T19:51:40.000Z | import argparse
from bigquery import get_client
from gh_api import curr_commit_master
from gh_api import repo
from util import create_bq_table, push_bq_records
from util import get_repo_names, curr_time_utc
from util import unique_vals
parser = argparse.ArgumentParser()
parser.add_argument('--proj', action = 'store... | 41.590476 | 96 | 0.654912 | import argparse
from bigquery import get_client
from gh_api import curr_commit_master
from gh_api import repo
from util import create_bq_table, push_bq_records
from util import get_repo_names, curr_time_utc
from util import unique_vals
parser = argparse.ArgumentParser()
parser.add_argument('--proj', action = 'store... | true | true |
f71c529b8ce1931c25f8a957d2a88be00a3047b0 | 551 | py | Python | list/list10.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | list/list10.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | list/list10.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | roadSign=[]
roadSign.append("Johnson's house")
roadSign.append("Fox streetlamp")
roadSign.append("Guang Hualu kindergarten")
roadSign.append("Dog rescue center")
roadSign.append("Samll street park")
roadSign.append("Ri Tan School")
print(roadSign)
nextRoadSign=roadSign.pop()
print(nextRoadSign)
nextRoadSign=roadSign.po... | 26.238095 | 43 | 0.811252 | roadSign=[]
roadSign.append("Johnson's house")
roadSign.append("Fox streetlamp")
roadSign.append("Guang Hualu kindergarten")
roadSign.append("Dog rescue center")
roadSign.append("Samll street park")
roadSign.append("Ri Tan School")
print(roadSign)
nextRoadSign=roadSign.pop()
print(nextRoadSign)
nextRoadSign=roadSign.po... | true | true |
f71c52fff7f80a35b0dd2c37b0c08e7e9f367495 | 2,489 | py | Python | src/pretalx/orga/management/commands/import_schedule.py | lili668668/pretalx | 5ba2185ffd7c5f95254aafe25ad3de340a86eadb | [
"Apache-2.0"
] | null | null | null | src/pretalx/orga/management/commands/import_schedule.py | lili668668/pretalx | 5ba2185ffd7c5f95254aafe25ad3de340a86eadb | [
"Apache-2.0"
] | null | null | null | src/pretalx/orga/management/commands/import_schedule.py | lili668668/pretalx | 5ba2185ffd7c5f95254aafe25ad3de340a86eadb | [
"Apache-2.0"
] | null | null | null | import datetime as dt
from xml.etree import ElementTree as ET
from django.core.management.base import BaseCommand
from django.db import transaction
from django_scopes import scopes_disabled
from pretalx.event.models import Event, Organiser, Team
from pretalx.person.models import User
class Command(BaseCommand):
... | 32.324675 | 72 | 0.599839 | import datetime as dt
from xml.etree import ElementTree as ET
from django.core.management.base import BaseCommand
from django.db import transaction
from django_scopes import scopes_disabled
from pretalx.event.models import Event, Organiser, Team
from pretalx.person.models import User
class Command(BaseCommand):
... | true | true |
f71c54fd629fe7b2eed4f7bb9d796bb0a3a708f2 | 17,077 | py | Python | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | 1 | 2020-11-08T16:27:24.000Z | 2020-11-08T16:27:24.000Z | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
import warnings
import numbers
from collections.abc import Sequence, Mapping
import torch
import torch.distributed as dist
from ignite.engine import Engine, Events
from ignite.metrics import RunningAverage
from ignite.handlers import TerminateOnNan, ModelCheckpoint, EarlyStopping
from i... | 42.061576 | 119 | 0.701997 | from functools import partial
import warnings
import numbers
from collections.abc import Sequence, Mapping
import torch
import torch.distributed as dist
from ignite.engine import Engine, Events
from ignite.metrics import RunningAverage
from ignite.handlers import TerminateOnNan, ModelCheckpoint, EarlyStopping
from i... | true | true |
f71c550e53e9a2417f70c36c35d7b793ff32d391 | 30,900 | py | Python | mindspore/python/mindspore/common/parameter.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/common/parameter.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/common/parameter.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 43.036212 | 120 | 0.631489 |
from copy import copy
import numbers
import numpy as np
from mindspore import log as logger
from .._c_expression import ParamInfo
from . import dtype as mstype
from .. import context
from ..parallel._utils import _get_parallel_mode
from .initializer import initializer
from .tensor import Tensor
from .._c... | true | true |
f71c553ec28422c6f3e48889698abd8e2489bc38 | 6,512 | py | Python | rootpy/logger/__init__.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 146 | 2015-01-04T15:16:44.000Z | 2022-01-27T11:29:31.000Z | rootpy/logger/__init__.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 143 | 2015-01-07T00:20:42.000Z | 2021-11-04T07:48:26.000Z | rootpy/logger/__init__.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 56 | 2015-01-30T11:11:07.000Z | 2022-03-28T09:42:06.000Z | """
:py:mod:`rootpy` overrides the default logging class, inserting a check that
there exists a default logging handler. If there is not, it adds one.
In additon, this can be used to intercept ROOT's log messages and redirect them
through python's logging subsystem
Example use:
.. sourcecode:: python
# Disable ... | 31.157895 | 85 | 0.640971 | from __future__ import absolute_import
import logging
import os
import re
import sys
import threading
from functools import wraps
from time import time
from .utils import check_tty
from .extended_logger import ExtendedLogger
logging.setLoggerClass(ExtendedLogger)
log = logging.getLogger("rootpy")
if not os.environ.g... | true | true |
f71c5653c53151aeb46ae97e28196d989957f8df | 586 | py | Python | data/scripts/templates/object/mobile/shared_swirl_prong_hue.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_swirl_prong_hue.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_swirl_prong_hue.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_swirl_prong_hue.iff"
result.attribute_template_id = 9
result.... | 29.3 | 70 | 0.750853 | true | true | |
f71c568fa66d427f4b77e6e61c5dc1c0fa4fdaf1 | 815 | py | Python | src/lists/tests/test_home_page.py | dmitricus/django-docker | 46e99dc4f3d902e7fda56f85260358f80f505297 | [
"MIT"
] | null | null | null | src/lists/tests/test_home_page.py | dmitricus/django-docker | 46e99dc4f3d902e7fda56f85260358f80f505297 | [
"MIT"
] | null | null | null | src/lists/tests/test_home_page.py | dmitricus/django-docker | 46e99dc4f3d902e7fda56f85260358f80f505297 | [
"MIT"
] | null | null | null | from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
"""Тест домашней страницы"""
def test_root_url_resolve_to_home_page_view(self):
"""Тест: корневой url преобразуется в представление дом... | 33.958333 | 80 | 0.696933 | from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
def test_root_url_resolve_to_home_page_view(self):
found = resolve('/lists/')
self.assertEqual(found.func, home_page)
def test... | true | true |
f71c5890e794a661a56497593ddf0dfcf0ad6fc7 | 9,686 | py | Python | main.py | trueleo/python-teletootbot | d033a79b05a13d10bd2d4f0bd68d4ecaa47f3cb3 | [
"MIT"
] | 4 | 2019-04-19T12:58:51.000Z | 2021-07-27T01:12:41.000Z | main.py | trueleo/python-teletootbot | d033a79b05a13d10bd2d4f0bd68d4ecaa47f3cb3 | [
"MIT"
] | null | null | null | main.py | trueleo/python-teletootbot | d033a79b05a13d10bd2d4f0bd68d4ecaa47f3cb3 | [
"MIT"
] | null | null | null | from telegram.ext import MessageHandler, Filters, CommandHandler, Updater
from mastodon import MastodonIllegalArgumentError, MastodonUnauthorizedError
import DataHandler
import threading
import os
import sys
import logging
import certifi
import urllib3
import re
bot_token = '<your bot token here>'
# secretfile = open... | 40.024793 | 305 | 0.661986 | from telegram.ext import MessageHandler, Filters, CommandHandler, Updater
from mastodon import MastodonIllegalArgumentError, MastodonUnauthorizedError
import DataHandler
import threading
import os
import sys
import logging
import certifi
import urllib3
import re
bot_token = '<your bot token here>'
logging.basicC... | true | true |
f71c58960b4d96b75911c82859c3b22907774f53 | 864 | py | Python | texteditor.py | p10rahulm/python-basics | d8f6172d42c465382d672a6813dccfbe6dff45a7 | [
"MIT"
] | null | null | null | texteditor.py | p10rahulm/python-basics | d8f6172d42c465382d672a6813dccfbe6dff45a7 | [
"MIT"
] | null | null | null | texteditor.py | p10rahulm/python-basics | d8f6172d42c465382d672a6813dccfbe6dff45a7 | [
"MIT"
] | null | null | null |
from tkinter import *
import tkinter.filedialog as tkFileDialog
root = Tk("Text Editor")
text = Text(root)
text.grid()
def saveas():
global text
t = text.get("1.0", "end-1c")
savelocation= tkFileDialog.asksaveasfilename()
file1=open(savelocation, "w+")
file1.write(t)
file1.close()
button=Butto... | 23.351351 | 86 | 0.725694 |
from tkinter import *
import tkinter.filedialog as tkFileDialog
root = Tk("Text Editor")
text = Text(root)
text.grid()
def saveas():
global text
t = text.get("1.0", "end-1c")
savelocation= tkFileDialog.asksaveasfilename()
file1=open(savelocation, "w+")
file1.write(t)
file1.close()
button=Butto... | true | true |
f71c58990649e0b8588522179070c5aec9ae9d99 | 93 | py | Python | moopy/comments/admin.py | qrizan/moopy | 10459351727710c77279f24f224786622abc91b8 | [
"MIT"
] | 1 | 2017-01-15T21:58:06.000Z | 2017-01-15T21:58:06.000Z | moopy/comments/admin.py | qrizan/moopy | 10459351727710c77279f24f224786622abc91b8 | [
"MIT"
] | null | null | null | moopy/comments/admin.py | qrizan/moopy | 10459351727710c77279f24f224786622abc91b8 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Comment
admin.site.register(Comment)
| 13.285714 | 32 | 0.806452 | from django.contrib import admin
from .models import Comment
admin.site.register(Comment)
| true | true |
f71c58e4c78d5b8915f7be9b2f64999c3533da13 | 3,659 | py | Python | Python Data Structure/A1Q1_Letian Xu.py | XULetian/Python_Fundamental | b901014a3257649cf1b3205ee6c17ba35184cad7 | [
"MIT"
] | null | null | null | Python Data Structure/A1Q1_Letian Xu.py | XULetian/Python_Fundamental | b901014a3257649cf1b3205ee6c17ba35184cad7 | [
"MIT"
] | null | null | null | Python Data Structure/A1Q1_Letian Xu.py | XULetian/Python_Fundamental | b901014a3257649cf1b3205ee6c17ba35184cad7 | [
"MIT"
] | null | null | null | # Letian Xu
# 01/10/2019
# I have not given or received any unauthorized assistance on this assignment.
def overlap(s1,s2):
'''
Arguments: s1 and s2 represent two lists, also represent a square.
Return: The area of the overlap of the two squares, if the squares do not overlap, return 0.
'''
# Use ... | 22.447853 | 96 | 0.496037 |
def overlap(s1,s2):
x1 = list(range(s1[0],s1[0]+s1[2]))
x2 = list(range(s2[0],s2[0]+s2[2]))
x = len(set(x1) & set(x2))
# and this is the lenth of two squares' overlap on y-axis
y1 = list(range(s1[1],s1[1]+s1[2]))
y2 = list(range(s2[1],s2[1]+s2[2]))
y = len(set(y1) & set(y... | true | true |
f71c5a07ef97232bc9ba249f594bbcbea596ebe9 | 747 | py | Python | pywhatkit/wwd.py | apoorvthedude/PyWhatKit | edc60ad44c11d4700b531be1bb86639ff3fce270 | [
"MIT"
] | 2 | 2022-01-15T00:53:30.000Z | 2022-01-16T22:56:23.000Z | pywhatkit/wwd.py | apoorvthedude/PyWhatKit | edc60ad44c11d4700b531be1bb86639ff3fce270 | [
"MIT"
] | null | null | null | pywhatkit/wwd.py | apoorvthedude/PyWhatKit | edc60ad44c11d4700b531be1bb86639ff3fce270 | [
"MIT"
] | null | null | null | import webbrowser as web
def tutorial_hindi() -> None:
"""Watch tutorial on how to use this library on YouTube in Hindi"""
web.open("https://youtu.be/o6WV9zFJg1o")
def tutorial_english() -> None:
"""Watch tutorial on how to use this library on YouTube in English"""
web.open("https://yo... | 27.666667 | 108 | 0.670683 | import webbrowser as web
def tutorial_hindi() -> None:
web.open("https://youtu.be/o6WV9zFJg1o")
def tutorial_english() -> None:
web.open("https://youtu.be/vpfrwpO_HKY")
def developer_contact() -> None:
link = "https://github.com/Ankit404butfound/PyWhatKit"
print(f"You can reach ... | true | true |
f71c5aa86d59a64428303d427cd50c450b530ad6 | 6,559 | py | Python | tilde/parsers/__init__.py | fossabot/tilde-1 | 143810a711f00dc1c64a6eb10573986dddadfcef | [
"MIT"
] | null | null | null | tilde/parsers/__init__.py | fossabot/tilde-1 | 143810a711f00dc1c64a6eb10573986dddadfcef | [
"MIT"
] | null | null | null | tilde/parsers/__init__.py | fossabot/tilde-1 | 143810a711f00dc1c64a6eb10573986dddadfcef | [
"MIT"
] | null | null | null |
# Generic parser schema
# with the default values
# Author: Evgeny Blokhin
import os, sys
import re
import time
import math
import random
import hashlib
import base64
from ase.data import chemical_symbols
class Output:
def __init__(self, filename='', calcset=False):
self._filename = filename # for qui... | 35.646739 | 318 | 0.479646 |
import os, sys
import re
import time
import math
import random
import hashlib
import base64
from ase.data import chemical_symbols
class Output:
def __init__(self, filename='', calcset=False):
self._filename = filename
self.data = ''
self._checksum = None
se... | true | true |
f71c5c0fa48035e54718849c2b4a1ba58fa91295 | 4,789 | py | Python | Models/opt_torch.py | tarkantemizoz/Cost-Sensitive-Learning | 083f8dfd2950b7e3874df34bf61c2ca1e4a91fbb | [
"Apache-2.0"
] | 2 | 2021-03-05T08:06:17.000Z | 2021-04-13T21:03:12.000Z | Models/opt_torch.py | tarkantemizoz/Cost-Sensitive-Learning | 083f8dfd2950b7e3874df34bf61c2ca1e4a91fbb | [
"Apache-2.0"
] | null | null | null | Models/opt_torch.py | tarkantemizoz/Cost-Sensitive-Learning | 083f8dfd2950b7e3874df34bf61c2ca1e4a91fbb | [
"Apache-2.0"
] | 1 | 2021-03-10T18:10:30.000Z | 2021-03-10T18:10:30.000Z | # coding: utf-8
# Copyright 2020 Tarkan Temizoz
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 35.738806 | 91 | 0.554187 |
import time
import torch
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from Models.linearnet import LinearNet
class Optimization:
def __init__(self, model, optimizer, config):
self.model = model
self.optimizer = optimizer
self.train_return =... | true | true |
f71c5d5f8d7d8019ce24e7f8738fe2a3db585bd9 | 12,026 | py | Python | grabcut.py | nong-fu/grabcut | 19a43eed7597ffae456349e4f0568da2f8f1f25c | [
"Apache-2.0"
] | null | null | null | grabcut.py | nong-fu/grabcut | 19a43eed7597ffae456349e4f0568da2f8f1f25c | [
"Apache-2.0"
] | null | null | null | grabcut.py | nong-fu/grabcut | 19a43eed7597ffae456349e4f0568da2f8f1f25c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import sys
from pathlib import Path
import webbrowser
import numpy as np
import cv2
from PIL import Image
from PyQt5.QtCore import QDir, Qt, pyqtSlot, pyqtSignal
from PyQt5.QtGui import QImage, QPixmap, QColor
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QWidget,
QMessageBox, QFile... | 31.564304 | 80 | 0.606187 |
import sys
from pathlib import Path
import webbrowser
import numpy as np
import cv2
from PIL import Image
from PyQt5.QtCore import QDir, Qt, pyqtSlot, pyqtSignal
from PyQt5.QtGui import QImage, QPixmap, QColor
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QWidget,
QMessageBox, QFileDialog, QLabel... | true | true |
f71c5d93e6fff0721c0bfffe7881cdff8bdc9c08 | 952 | py | Python | scripts/runAll.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | scripts/runAll.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | scripts/runAll.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | #! /usr/bin/env python
from __future__ import print_function
import sys
import os
import glob
pFiles = glob.glob('*_p.py')
caseDict = {}
for pf in pFiles:
caseDict[pf] = set(glob.glob(pf[:-5]+'*_n.py'))
#fix cases were problem name is a subset of some other problem name
for pf1 in pFiles:
for pf2 in pFiles:
... | 31.733333 | 96 | 0.553571 |
from __future__ import print_function
import sys
import os
import glob
pFiles = glob.glob('*_p.py')
caseDict = {}
for pf in pFiles:
caseDict[pf] = set(glob.glob(pf[:-5]+'*_n.py'))
for pf1 in pFiles:
for pf2 in pFiles:
if pf2.find(pf1[:-4]):
nf1Set=set(glob.glob(pf1[:-5]+'*_n.py'))
... | true | true |
f71c5df90825c721c8d73769c1b51879fc9c7df2 | 2,706 | py | Python | runloop/adminx.py | luqin/firefly | 2e5ab17f2d20deb3c68c927f6208ea89db7c639d | [
"MIT"
] | null | null | null | runloop/adminx.py | luqin/firefly | 2e5ab17f2d20deb3c68c927f6208ea89db7c639d | [
"MIT"
] | 9 | 2020-03-24T16:45:25.000Z | 2022-03-11T23:40:51.000Z | runloop/adminx.py | luqin/firefly | 2e5ab17f2d20deb3c68c927f6208ea89db7c639d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from django.forms import ModelMultipleChoiceField
from django.utils.translation import ugettext as _
import xadmin
from .xadmin_action import RunloopAction
from .models import RunLoopGroup, Orders
ACTION_NAME = {
'add': _('Can add %s'),
'change': _('Can change %s'),
... | 30.404494 | 117 | 0.64745 | from __future__ import absolute_import
from django.forms import ModelMultipleChoiceField
from django.utils.translation import ugettext as _
import xadmin
from .xadmin_action import RunloopAction
from .models import RunLoopGroup, Orders
ACTION_NAME = {
'add': _('Can add %s'),
'change': _('Can change %s'),
... | true | true |
f71c5ef0b1d632892fa3fd528d707dc54828ea6e | 16,431 | py | Python | pychron/mv/focus/autofocus_manager.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/mv/focus/autofocus_manager.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/mv/focus/autofocus_manager.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | 33.261134 | 93 | 0.559369 |
from __future__ import absolute_import
from __future__ import print_function
import six.moves.cPickle as pickle
from traits.api import Bool, Any, Instance, Button, Property, Event, on_trait_change
from traitsui.api import View, Item, Handler, HGroup
from threading import Event as TEvent
from numpy ... | true | true |
f71c5f4fe3f324377d2b741bc0a1bb84b3949735 | 602 | py | Python | gdrive_sync/migrations/0002_drivefile_video.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | 2 | 2020-08-07T15:55:41.000Z | 2021-08-16T18:28:09.000Z | gdrive_sync/migrations/0002_drivefile_video.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | 924 | 2020-08-10T17:54:19.000Z | 2022-03-31T21:15:17.000Z | gdrive_sync/migrations/0002_drivefile_video.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.12 on 2021-08-09 17:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("videos", "0001_initial"),
("gdrive_sync", "0001_initial"),
]
operations = [
migrations.AddField(
... | 23.153846 | 61 | 0.546512 |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("videos", "0001_initial"),
("gdrive_sync", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="drivefile",
n... | true | true |
f71c5f5935f04be92603bb1df6e9e04ca6fbc926 | 9,829 | py | Python | main.py | GautamGunecha/KBC-Quiz | 9e78435aaf2a88c6dc2bd38324d9e0b807ac909d | [
"MIT"
] | null | null | null | main.py | GautamGunecha/KBC-Quiz | 9e78435aaf2a88c6dc2bd38324d9e0b807ac909d | [
"MIT"
] | null | null | null | main.py | GautamGunecha/KBC-Quiz | 9e78435aaf2a88c6dc2bd38324d9e0b807ac909d | [
"MIT"
] | null | null | null | # Python Quiz Game
import time
from pygame import mixer
mixer.init()
mixer.music.load("Audio/KBCMAIN.mp3")
mixer.music.set_volume(0.2)
mixer.music.play()
print("Let's Play Kaun Banega Crorepati")
name = input("Please Enter your Name: ")
print("Welcome", name)
decision = input("Do you want to play KBC(Yes/No): ")
deci... | 29.428144 | 126 | 0.630786 |
import time
from pygame import mixer
mixer.init()
mixer.music.load("Audio/KBCMAIN.mp3")
mixer.music.set_volume(0.2)
mixer.music.play()
print("Let's Play Kaun Banega Crorepati")
name = input("Please Enter your Name: ")
print("Welcome", name)
decision = input("Do you want to play KBC(Yes/No): ")
decision = decision.lo... | true | true |
f71c608e5b1cc741cd572c1921ad56281e09b9eb | 2,400 | py | Python | contrib/python/Jinja2/tests/test_utils.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2019-01-26T02:58:50.000Z | 2019-01-26T02:58:50.000Z | contrib/python/Jinja2/tests/test_utils.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2019-07-29T12:25:53.000Z | 2019-07-29T12:25:53.000Z | contrib/python/Jinja2/tests/test_utils.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2020-11-11T16:56:19.000Z | 2020-11-11T16:56:19.000Z | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import pytest
import pickle
from jinja2.utils import LRUCache, escape, object_type_repr, urliz... | 27.586207 | 76 | 0.558333 |
import gc
import pytest
import pickle
from jinja2.utils import LRUCache, escape, object_type_repr, urlize, \
select_autoescape
@pytest.mark.utils
@pytest.mark.lrucache
class TestLRUCache(object):
def test_simple(self):
d = LRUCache(3)
d["a"] = 1
d["b"] = 2
d["c"] = 3
... | true | true |
f71c6158b5131e8416bc7f571ce69e11b023703b | 52,287 | py | Python | dendropy/test/test_datamodel_tree_list.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | dendropy/test/test_datamodel_tree_list.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | dendropy/test/test_datamodel_tree_list.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # !/usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... | 44.499574 | 129 | 0.613785 |
ls))
for t1, tlabel in zip(tlist, expected_tree_labels):
self.assertIn(t1, tlist)
if tlabel in source_tree_labels:
self.assertIn(t1, source_trees)
else:
self.assertNotIn(t1, source_trees)
self.assertIs(t1.taxon_namespace, tlist.ta... | true | true |
f71c6192795695fce398b118465ead2235f638d3 | 263 | py | Python | services/movies_billing/subscription_service/src/models/customer.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | null | null | null | services/movies_billing/subscription_service/src/models/customer.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | null | null | null | services/movies_billing/subscription_service/src/models/customer.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | 1 | 2021-09-30T09:49:40.000Z | 2021-09-30T09:49:40.000Z | from sqlalchemy import String, ForeignKey, Integer, Enum
from .base import AbstractModel, RequiredColumn
class Customer(AbstractModel):
__tablename__ = "customer"
user_id = RequiredColumn(String(50))
stripe_customer_id = RequiredColumn(String(50))
| 26.3 | 56 | 0.775665 | from sqlalchemy import String, ForeignKey, Integer, Enum
from .base import AbstractModel, RequiredColumn
class Customer(AbstractModel):
__tablename__ = "customer"
user_id = RequiredColumn(String(50))
stripe_customer_id = RequiredColumn(String(50))
| true | true |
f71c61dd6a6ae22677f0c87104c88f4220333ae8 | 234 | py | Python | physionet-django/project/fileviews/image.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 36 | 2019-02-14T18:10:39.000Z | 2022-01-21T12:48:52.000Z | physionet-django/project/fileviews/image.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 1,051 | 2019-01-31T18:03:14.000Z | 2022-03-31T20:53:04.000Z | physionet-django/project/fileviews/image.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 13 | 2019-03-26T11:02:32.000Z | 2022-03-17T11:39:49.000Z | from project.fileviews.base import FileView
class ImageFileView(FileView):
"""
Class for displaying image files.
"""
def render(self, request):
return super().render(request, 'project/file_view_image.html')
| 21.272727 | 70 | 0.692308 | from project.fileviews.base import FileView
class ImageFileView(FileView):
def render(self, request):
return super().render(request, 'project/file_view_image.html')
| true | true |
f71c63d30ec047c7337fa37ae62317af4f4cdf92 | 2,398 | py | Python | model_zoo/official/cv/alexnet/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 2 | 2020-11-23T13:46:37.000Z | 2020-12-20T02:02:38.000Z | model_zoo/official/cv/alexnet/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/cv/alexnet/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 1 | 2021-01-01T08:35:01.000Z | 2021-01-01T08:35:01.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 42.821429 | 111 | 0.685988 |
import argparse
import numpy as np
import mindspore as ms
from mindspore import Tensor
from mindspore import context
from mindspore.train.serialization import load_checkpoint, load_param_into_net, export
from src.config import alexnet_cifar10_cfg, alexnet_imagenet_cfg
from src.alexnet import AlexNet
if... | true | true |
f71c6605bc3c94744764c205c3291d67c5416f2f | 624 | py | Python | setup.py | tianjianjiang/bigscience-metadata | 3460c8d2bca2c818646feb3b49c50b351b51ad70 | [
"Apache-2.0"
] | null | null | null | setup.py | tianjianjiang/bigscience-metadata | 3460c8d2bca2c818646feb3b49c50b351b51ad70 | [
"Apache-2.0"
] | null | null | null | setup.py | tianjianjiang/bigscience-metadata | 3460c8d2bca2c818646feb3b49c50b351b51ad70 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
def req_file(filename):
with open(filename) as f:
content = f.readlines()
return [x.strip() for x in content]
install_requires = req_file("requirements.txt")
setup(
name="bsmetadata",
python_requires=">=3.7.11, <3.10",
version="0.1.0",
url... | 27.130435 | 121 | 0.698718 | from setuptools import find_packages, setup
def req_file(filename):
with open(filename) as f:
content = f.readlines()
return [x.strip() for x in content]
install_requires = req_file("requirements.txt")
setup(
name="bsmetadata",
python_requires=">=3.7.11, <3.10",
version="0.1.0",
url... | true | true |
f71c66238339944e28e835fcee02bfdd0f475eda | 1,171 | py | Python | setup.py | judoscale/judoscale-python | 3a2c82921ec5feb81d2691037b9bf13e94f7e5c9 | [
"MIT"
] | null | null | null | setup.py | judoscale/judoscale-python | 3a2c82921ec5feb81d2691037b9bf13e94f7e5c9 | [
"MIT"
] | null | null | null | setup.py | judoscale/judoscale-python | 3a2c82921ec5feb81d2691037b9bf13e94f7e5c9 | [
"MIT"
] | null | null | null | import setuptools
# To publish:
#
# - Update VERSION constant below
# - python3 -m pip install --upgrade build twine
# - rm -rf dist && python3 -m build
# - python3 -m twine upload dist/*
# - Username is __token__, password is token value
VERSION = "1.0.0rc1"
INSTALL_REQUIRES = ["requests<3.0.0"]
with ... | 30.815789 | 91 | 0.674637 | import setuptools
VERSION = "1.0.0rc1"
INSTALL_REQUIRES = ["requests<3.0.0"]
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="judoscale-python",
version=VERSION,
author="Adam McCrea",
author_email="adam@adamlogic.com",
descripti... | true | true |
f71c68260a4ae6f5fd97179a6c4e00a92144ea7f | 36,156 | py | Python | zerver/migrations/0001_initial.py | N-Shar-ma/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/migrations/0001_initial.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | zerver/migrations/0001_initial.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 1.11.2 on 2017-06-22 10:22
import bitfield.models
import django.contrib.auth.models
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search ... | 38.545842 | 126 | 0.491841 |
import bitfield.models
import django.contrib.auth.models
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchVectorField
from django.db import m... | true | true |
f71c69a2524bdf3501491590fb98b0dba43692e4 | 3,863 | py | Python | img_filter/img_advanced_filter.py | Gretacyh/images-downloader-fliter | ffe070026a45c741013a575a6a985d97e28d6fd7 | [
"ICU",
"MIT"
] | null | null | null | img_filter/img_advanced_filter.py | Gretacyh/images-downloader-fliter | ffe070026a45c741013a575a6a985d97e28d6fd7 | [
"ICU",
"MIT"
] | null | null | null | img_filter/img_advanced_filter.py | Gretacyh/images-downloader-fliter | ffe070026a45c741013a575a6a985d97e28d6fd7 | [
"ICU",
"MIT"
] | null | null | null | import os
import re
import cv2
import umap
import torch
import torch.nn as nn
from torchvision import models
import torch.nn.functional as F
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
def global_std_pool2d(x):
"""2D global standard variation pooling"""
return torch.st... | 30.904 | 102 | 0.619467 | import os
import re
import cv2
import umap
import torch
import torch.nn as nn
from torchvision import models
import torch.nn.functional as F
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
def global_std_pool2d(x):
return torch.std(x.view(x.size()[0], x.size()[1], -1, 1), dim=... | true | true |
f71c6a899f50afd65c97f6d10559da3bf89ef5b8 | 162 | py | Python | querybuilder_rules/compat.py | Apkawa/django-querybuilder-rules | 430488f6e50be7ac74b5b757c9bef0d09e49301b | [
"MIT"
] | null | null | null | querybuilder_rules/compat.py | Apkawa/django-querybuilder-rules | 430488f6e50be7ac74b5b757c9bef0d09e49301b | [
"MIT"
] | null | null | null | querybuilder_rules/compat.py | Apkawa/django-querybuilder-rules | 430488f6e50be7ac74b5b757c9bef0d09e49301b | [
"MIT"
] | null | null | null | try:
from django.utils.encoding import smart_text, smart_str
except ImportError:
from django.utils.encoding import smart_unicode as smart_text, smart_str
| 32.4 | 76 | 0.808642 | try:
from django.utils.encoding import smart_text, smart_str
except ImportError:
from django.utils.encoding import smart_unicode as smart_text, smart_str
| true | true |
f71c6b46358edba34d7bcd2375000838bace4301 | 2,623 | py | Python | acme/tf/networks/__init__.py | RaoulDrake/acme | 16ad2f284ad7c038081454a9b820d8f424b3ad1f | [
"Apache-2.0"
] | 1 | 2021-06-17T16:11:43.000Z | 2021-06-17T16:11:43.000Z | acme/tf/networks/__init__.py | RaoulDrake/acme | 16ad2f284ad7c038081454a9b820d8f424b3ad1f | [
"Apache-2.0"
] | null | null | null | acme/tf/networks/__init__.py | RaoulDrake/acme | 16ad2f284ad7c038081454a9b820d8f424b3ad1f | [
"Apache-2.0"
] | null | null | null | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | 48.574074 | 74 | 0.847884 |
from acme.tf.networks.atari import AtariTorso
from acme.tf.networks.atari import DeepIMPALAAtariNetwork
from acme.tf.networks.atari import DQNAtariNetwork
from acme.tf.networks.atari import IMPALAAtariNetwork
from acme.tf.networks.atari import R2D2AtariNetwork
from acme.tf.networks.base import Distribut... | true | true |
f71c6bd2042d817dbc78da43dc684306860b7f69 | 1,029 | py | Python | pyquilted/pdf_printer.py | cocoroutine/pyquilted | dd8644043deec17608e00f46e3ac4562b8879603 | [
"MIT"
] | 1 | 2019-02-21T20:10:37.000Z | 2019-02-21T20:10:37.000Z | pyquilted/pdf_printer.py | cocoroutine/pyquilted | dd8644043deec17608e00f46e3ac4562b8879603 | [
"MIT"
] | null | null | null | pyquilted/pdf_printer.py | cocoroutine/pyquilted | dd8644043deec17608e00f46e3ac4562b8879603 | [
"MIT"
] | null | null | null | import pdfkit
class PdfPrinter:
"""A wrapper class around pdfkit functionality to print html to pdfs"""
@staticmethod
def from_file(infile, outfile):
options = {
"page-size": "Letter",
"dpi": "96",
"margin-top": "1in",
"margin-right":... | 31.181818 | 75 | 0.462585 | import pdfkit
class PdfPrinter:
@staticmethod
def from_file(infile, outfile):
options = {
"page-size": "Letter",
"dpi": "96",
"margin-top": "1in",
"margin-right": "1.25in",
"margin-bottom": "1in",
"margin-l... | true | true |
f71c6bda42c3ee94832851be22cdd754e1af0b13 | 1,164 | py | Python | example_app/app.py | quanpower/flask_jsondash | 274c41bcbc754fd217b7dc4679c377bac912b88d | [
"MIT"
] | 1 | 2017-09-01T16:08:49.000Z | 2017-09-01T16:08:49.000Z | example_app/app.py | quanpower/flask_jsondash | 274c41bcbc754fd217b7dc4679c377bac912b88d | [
"MIT"
] | null | null | null | example_app/app.py | quanpower/flask_jsondash | 274c41bcbc754fd217b7dc4679c377bac912b88d | [
"MIT"
] | null | null | null | """This is an example app, demonstrating usage."""
import os
from flask import Flask
from flask_jsondash.charts_builder import charts
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.config.update(
JSONDASH_FILTERUSERS=False,
JSONDASH_GLOBALDASH=True,
JSONDASH_GLOBAL_USER='global',
)
... | 18.1875 | 62 | 0.652921 |
import os
from flask import Flask
from flask_jsondash.charts_builder import charts
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.config.update(
JSONDASH_FILTERUSERS=False,
JSONDASH_GLOBALDASH=True,
JSONDASH_GLOBAL_USER='global',
)
app.debug = True
app.register_blueprint(charts)
d... | true | true |
f71c6d6149e0b6acd0b94e3af246e4aa23a4b08d | 10,495 | py | Python | grr/client/grr_response_client/client_actions/admin.py | tsehori/grr | 048506f22f74642bfe61749069a45ddf496fdab3 | [
"Apache-2.0"
] | 1 | 2021-07-01T01:43:06.000Z | 2021-07-01T01:43:06.000Z | grr/client/grr_response_client/client_actions/admin.py | tsehori/grr | 048506f22f74642bfe61749069a45ddf496fdab3 | [
"Apache-2.0"
] | 44 | 2021-05-14T22:49:24.000Z | 2022-03-13T21:54:02.000Z | grr/client/grr_response_client/client_actions/admin.py | tsehori/grr | 048506f22f74642bfe61749069a45ddf496fdab3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Lint as: python3
"""Client actions related to administrating the client and its configuration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import socket
import traceback
import crypto... | 32.292308 | 80 | 0.723106 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import socket
import traceback
import cryptography
from cryptography.hazmat.backends import openssl
import pkg_resources
import psutil
import pytsk3
import yara
fr... | true | true |
f71c6da0c8beda1979477eff278dde12b8d91849 | 1,317 | py | Python | social_fabric/network_template_processor.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | social_fabric/network_template_processor.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | social_fabric/network_template_processor.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 - Neptunium Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from social_fabric.config_repo import ConfigRepo
class NetworkTemplateProcessor:
def __init__(self):
self.file_loader = FileSystemLoader(ConfigRepo.TEMPLAT... | 38.735294 | 103 | 0.593014 |
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from social_fabric.config_repo import ConfigRepo
class NetworkTemplateProcessor:
def __init__(self):
self.file_loader = FileSystemLoader(ConfigRepo.TEMPLATE_SRC_DIR)
self.env = Environment(loader=self.file_loader, undefined=St... | true | true |
f71c6e32018acdc987579657fa46ba5d3cf922de | 6,231 | py | Python | crabageprediction/venv/Lib/site-packages/matplotlib/tests/test_sphinxext.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | crabageprediction/venv/Lib/site-packages/matplotlib/tests/test_sphinxext.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 5 | 2022-01-16T10:08:41.000Z | 2022-01-20T05:34:09.000Z | crabageprediction/venv/Lib/site-packages/matplotlib/tests/test_sphinxext.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 4 | 2022-02-04T22:58:27.000Z | 2022-02-14T19:29:18.000Z | """Tests for tinypages build using sphinx extensions."""
import filecmp
import os
from pathlib import Path
import shutil
from subprocess import Popen, PIPE
import sys
import pytest
pytest.importorskip('sphinx',
minversion=None if sys.version_info < (3, 10) else '4.1.3')
def test_tinypages(tmpd... | 44.507143 | 79 | 0.69074 |
import filecmp
import os
from pathlib import Path
import shutil
from subprocess import Popen, PIPE
import sys
import pytest
pytest.importorskip('sphinx',
minversion=None if sys.version_info < (3, 10) else '4.1.3')
def test_tinypages(tmpdir):
source_dir = Path(tmpdir) / 'src'
shutil.cop... | true | true |
f71c6f7492e390d017ea6f6fa7414b737b27c660 | 7,147 | py | Python | distributed/tests/test_as_completed.py | abduhbm/distributed | d99752e030e2534c1f064865e2241289fedfe5a9 | [
"BSD-3-Clause"
] | null | null | null | distributed/tests/test_as_completed.py | abduhbm/distributed | d99752e030e2534c1f064865e2241289fedfe5a9 | [
"BSD-3-Clause"
] | null | null | null | distributed/tests/test_as_completed.py | abduhbm/distributed | d99752e030e2534c1f064865e2241289fedfe5a9 | [
"BSD-3-Clause"
] | null | null | null | import asyncio
from collections.abc import Iterator
from operator import add
import queue
import random
from time import sleep
import pytest
from tornado import gen
from distributed.client import _as_completed, as_completed, _first_completed, wait
from distributed.metrics import time
from distributed.utils import Can... | 24.644828 | 82 | 0.622219 | import asyncio
from collections.abc import Iterator
from operator import add
import queue
import random
from time import sleep
import pytest
from tornado import gen
from distributed.client import _as_completed, as_completed, _first_completed, wait
from distributed.metrics import time
from distributed.utils import Can... | true | true |
f71c6fe7ef5eb499ee506fe71c00dd30ce728f85 | 14,768 | py | Python | pdf2image/pdf2image.py | ldevandiere/pdf2image | ba11f6a931337c889ac739f6b41a7e78690d6d32 | [
"MIT"
] | null | null | null | pdf2image/pdf2image.py | ldevandiere/pdf2image | ba11f6a931337c889ac739f6b41a7e78690d6d32 | [
"MIT"
] | null | null | null | pdf2image/pdf2image.py | ldevandiere/pdf2image | ba11f6a931337c889ac739f6b41a7e78690d6d32 | [
"MIT"
] | null | null | null | """
pdf2image is a light wrapper for the poppler-utils tools that can convert your
PDFs into Pillow images.
"""
import os
import platform
import tempfile
import types
import shutil
import pathlib
from subprocess import Popen, PIPE
from PIL import Image
from .generators import uuid_generator, counter_generato... | 31.090526 | 101 | 0.609223 |
import os
import platform
import tempfile
import types
import shutil
import pathlib
from subprocess import Popen, PIPE
from PIL import Image
from .generators import uuid_generator, counter_generator, ThreadSafeGenerator
from .parsers import (
parse_buffer_to_pgm,
parse_buffer_to_ppm,
parse_buffer_to_jpe... | true | true |
f71c70ebaffb4cb67ea8865b24dfc0fdb55a9000 | 2,986 | py | Python | resources/test_data/honeycomb/pbb/pbb.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/test_data/honeycomb/pbb/pbb.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/test_data/honeycomb/pbb/pbb.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 28.711538 | 74 | 0.598794 |
cfg_pbb_sub_if_1 = {
"pbb-rewrite": {
"source-address": "aa:aa:aa:aa:aa:ab",
"destination-address": "bb:bb:bb:bb:bb:bc",
"b-vlan-tag-vlan-id": "2223",
"outer-tag": "16",
"i-tag-isid": "12",
"interface-operation": "translate-2-1"
}
}
cfg_pbb_su... | true | true |
f71c717d6fee0d1489bbe83962abdd173aae3304 | 668 | py | Python | setup.py | ishine/fastHan | 09550a750bb06b89b81769b8786a7eb3f8ca5713 | [
"Apache-2.0"
] | 635 | 2020-06-11T12:32:53.000Z | 2022-03-31T09:31:32.000Z | setup.py | ishine/fastHan | 09550a750bb06b89b81769b8786a7eb3f8ca5713 | [
"Apache-2.0"
] | 37 | 2020-06-12T10:07:47.000Z | 2022-03-10T02:46:52.000Z | setup.py | ishine/fastHan | 09550a750bb06b89b81769b8786a7eb3f8ca5713 | [
"Apache-2.0"
] | 77 | 2020-06-11T17:08:17.000Z | 2022-03-30T05:40:10.000Z | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('requirements.txt', encoding='utf-8') as f:
reqs = f.read()
pkgs = [p for p in find_packages()]
print(pkgs)
setup(
name='fastHan',
version='1.7... | 21.548387 | 53 | 0.652695 |
from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('requirements.txt', encoding='utf-8') as f:
reqs = f.read()
pkgs = [p for p in find_packages()]
print(pkgs)
setup(
name='fastHan',
version='1.7',
url='https://github.com/fast... | true | true |
f71c719a80b561157aaf6bc9411436cc6e44d60f | 3,425 | py | Python | minemeld/ft/vt.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 147 | 2016-07-22T18:15:49.000Z | 2022-03-26T23:32:44.000Z | minemeld/ft/vt.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 167 | 2016-07-27T07:02:25.000Z | 2021-12-16T16:26:52.000Z | minemeld/ft/vt.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 112 | 2016-07-22T07:14:29.000Z | 2022-03-24T18:43:12.000Z | # Copyright 2016 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 30.580357 | 94 | 0.616058 |
import logging
import os
import yaml
from . import json
LOG = logging.getLogger(__name__)
_VT_NOTIFICATIONS = 'https://www.virustotal.com/intelligence/hunting/notifications-feed/?key='
class Notifications(json.SimpleJSON):
def __init__(self, name, chassis, config):
super(Notifications, s... | true | true |
f71c722935297413c44452739b1c5efe80dcce1c | 5,736 | py | Python | tests/test_ac.py | knovichikhin/pyemv | 4a07cb550f27618822b530c6aa954e0820020ae7 | [
"MIT"
] | 14 | 2020-11-01T11:44:41.000Z | 2022-03-24T15:53:23.000Z | tests/test_ac.py | manoutoftime/pyemv | 4a07cb550f27618822b530c6aa954e0820020ae7 | [
"MIT"
] | 3 | 2021-06-18T01:36:00.000Z | 2021-10-17T02:09:50.000Z | tests/test_ac.py | manoutoftime/pyemv | 4a07cb550f27618822b530c6aa954e0820020ae7 | [
"MIT"
] | 8 | 2020-10-09T20:23:39.000Z | 2022-03-31T00:56:47.000Z | import pytest
from pyemv import ac
def test_generate_ac_exception() -> None:
# SK < 16 bytes
with pytest.raises(
ValueError,
match="Session Key must be a double length DES key",
):
ac.generate_ac(
sk_ac=bytes.fromhex("AAAAAAAAAAAAAAAA"),
data=bytes.fromhex(... | 30.031414 | 84 | 0.591702 | import pytest
from pyemv import ac
def test_generate_ac_exception() -> None:
with pytest.raises(
ValueError,
match="Session Key must be a double length DES key",
):
ac.generate_ac(
sk_ac=bytes.fromhex("AAAAAAAAAAAAAAAA"),
data=bytes.fromhex("12345678901214... | true | true |
f71c735f5bbe363994606cb49a6742b243a951ed | 2,203 | py | Python | DeepJIT/train.py | ZZR0/ISSTA21-JIT-DP | c2916f7c3b1d235ff2858220886d6a7da068bf8a | [
"MIT"
] | 14 | 2021-07-12T07:29:57.000Z | 2022-01-18T07:01:46.000Z | DeepJIT/train.py | ZZR0/ISSTA21-JIT-DP | c2916f7c3b1d235ff2858220886d6a7da068bf8a | [
"MIT"
] | null | null | null | DeepJIT/train.py | ZZR0/ISSTA21-JIT-DP | c2916f7c3b1d235ff2858220886d6a7da068bf8a | [
"MIT"
] | 7 | 2021-05-19T21:51:36.000Z | 2022-03-29T13:57:54.000Z | from model import DeepJIT
import torch
from tqdm import tqdm
from utils import mini_batches_train, save
import torch.nn as nn
import os, datetime
def train_model(data, params):
data_pad_msg, data_pad_code, data_labels, dict_msg, dict_code = data
# set up parameters
params.cuda = (not params.no_cuda) ... | 40.054545 | 128 | 0.635951 | from model import DeepJIT
import torch
from tqdm import tqdm
from utils import mini_batches_train, save
import torch.nn as nn
import os, datetime
def train_model(data, params):
data_pad_msg, data_pad_code, data_labels, dict_msg, dict_code = data
params.cuda = (not params.no_cuda) and torch.cuda.is_a... | true | true |
f71c73b92c22513c6d322953955170aa4fd2838a | 524 | py | Python | BackEnd/testModel/mymodel/migrations/0012_auto_20180603_2214.py | WindyMen/BackEnd | d3e33b1b57734fcefda494793ed940e5b079c36b | [
"Apache-2.0"
] | 1 | 2018-06-28T02:35:15.000Z | 2018-06-28T02:35:15.000Z | BackEnd/testModel/mymodel/migrations/0012_auto_20180603_2214.py | WindyMen/BackEnd | d3e33b1b57734fcefda494793ed940e5b079c36b | [
"Apache-2.0"
] | null | null | null | BackEnd/testModel/mymodel/migrations/0012_auto_20180603_2214.py | WindyMen/BackEnd | d3e33b1b57734fcefda494793ed940e5b079c36b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.3 on 2018-06-03 14:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mymodel', '0011_auto_20180603_2208'),
]
operations = [
migrations.AlterField(
mod... | 26.2 | 140 | 0.624046 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mymodel', '0011_auto_20180603_2208'),
]
operations = [
migrations.AlterField(
model_name='room',
name='owner',
... | true | true |
f71c73d0a50c3eaf71f966a8af555fc36e37ec03 | 1,026 | py | Python | sortosm.py | TimSC/osm-to-gps-map | cedae6752b16e6f3e02a75f0a0ef784fd70298bf | [
"Unlicense"
] | 1 | 2020-06-15T02:22:08.000Z | 2020-06-15T02:22:08.000Z | sortosm.py | TimSC/osm-to-gps-map | cedae6752b16e6f3e02a75f0a0ef784fd70298bf | [
"Unlicense"
] | null | null | null | sortosm.py | TimSC/osm-to-gps-map | cedae6752b16e6f3e02a75f0a0ef784fd70298bf | [
"Unlicense"
] | null | null | null | import xml.etree.ElementTree as ET
import bz2, sys
def SortOsm(inFina, outFina):
fi = bz2.BZ2File(inFina)
root = ET.fromstring(fi.read())
fi.close()
objDict = {}
for obj in root:
if 'id' in obj.attrib:
i = int(obj.attrib['id'])
#print obj.tag, i
if obj.tag not in objDict:
objDict[obj.tag] = {}
... | 20.52 | 49 | 0.645224 | import xml.etree.ElementTree as ET
import bz2, sys
def SortOsm(inFina, outFina):
fi = bz2.BZ2File(inFina)
root = ET.fromstring(fi.read())
fi.close()
objDict = {}
for obj in root:
if 'id' in obj.attrib:
i = int(obj.attrib['id'])
if obj.tag not in objDict:
objDict[obj.tag] = {}
objDict[obj.tag]... | true | true |
f71c7496c320b6938b1d6b9ee7d678add526adf7 | 4,780 | py | Python | salt/pillar/libvirt.py | hvnsweeting/salt | abc9d3a0b51e6f5c4738cf71c221daf8b46fddcf | [
"Apache-2.0"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | salt/pillar/libvirt.py | hvnsweeting/salt | abc9d3a0b51e6f5c4738cf71c221daf8b46fddcf | [
"Apache-2.0"
] | null | null | null | salt/pillar/libvirt.py | hvnsweeting/salt | abc9d3a0b51e6f5c4738cf71c221daf8b46fddcf | [
"Apache-2.0"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
Load up the libvirt keys into Pillar for a given minion if said keys have been generated using the libvirt key runner
'''
from __future__ import absolute_import
# Don't "fix" the above docstring to put it on two lines, as the sphinx
# autosummary pulls only the first line for its descriptio... | 37.637795 | 117 | 0.561715 |
from __future__ import absolute_import
# autosummary pulls only the first line for its description.
# Import python libs
import os
import subprocess
# Import salt libs
import salt.utils
def __virtual__():
return salt.utils.which('certtool') is not None
def ext_pillar(minion_id,
pillar, # py... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.