hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
794dd64e84dcbe00dc7ecff4251e7f009f045d9e | 3,506 | py | Python | demo/GridLabelRenderer.py | ferren/pyXterm | b4444cf90893089423295b8792173f0c08b73b52 | [
"Apache-2.0"
] | 3 | 2018-03-19T07:57:10.000Z | 2021-07-05T08:55:14.000Z | demo/GridLabelRenderer.py | ferren/pyXterm | b4444cf90893089423295b8792173f0c08b73b52 | [
"Apache-2.0"
] | 6 | 2020-03-24T15:40:18.000Z | 2021-12-13T19:46:09.000Z | demo/GridLabelRenderer.py | ferren/pyXterm | b4444cf90893089423295b8792173f0c08b73b52 | [
"Apache-2.0"
] | 4 | 2018-03-29T21:59:55.000Z | 2019-12-16T14:56:38.000Z | #!/usr/bin/env python
import wx
import wx.grid as grid
import wx.lib.mixins.gridlabelrenderer as glr
#----------------------------------------------------------------------
class MyGrid(grid.Grid, glr.GridWithLabelRenderersMixin):
def __init__(self, *args, **kw):
grid.Grid.__init__(self, *args, **kw)
... | 30.754386 | 71 | 0.62065 |
794dd6ed81a137cae34ae23fc45a6b24d618c83c | 366 | py | Python | experiments/jacobi-2d/tmp_files/7161.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/jacobi-2d/tmp_files/7161.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/jacobi-2d/tmp_files/7161.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/jacobi-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/jacobi-2d/tmp_files/7161.c')
procedure('kernel_jacobi_2d')
loop(0)
known(' n > 2 ')
tile(0,2,64,2)... | 28.153846 | 118 | 0.751366 |
794dd89781cf82c742bf2d8fef7c3186339c8ccd | 8,027 | py | Python | train/bert.py | benywon/ComQA | 6731d63d16b731d6c3654b2dc7d2503cf333127f | [
"Apache-2.0"
] | 15 | 2021-01-16T09:48:56.000Z | 2022-03-12T07:22:40.000Z | train/bert.py | benywon/ComQA | 6731d63d16b731d6c3654b2dc7d2503cf333127f | [
"Apache-2.0"
] | null | null | null | train/bert.py | benywon/ComQA | 6731d63d16b731d6c3654b2dc7d2503cf333127f | [
"Apache-2.0"
] | 5 | 2021-01-16T10:15:56.000Z | 2021-11-19T06:30:25.000Z | # -*- coding: utf-8 -*-
"""
@Time : 2021/1/14 下午5:34
@FileName: bert.py
@author: 王炳宁
@contact: wangbingning@sogou-inc.com
"""
import sys
import time
import apex
import torch
import torch.distributed as dist
from apex import amp
sys.path.append('..')
from modules.BERT import Bert
from train.parser import get_ar... | 34.303419 | 145 | 0.572817 |
794dd8fe041edced5cc7397a91312f47fed7167e | 3,723 | py | Python | lib/galaxy/webapps/galaxy/api/roles.py | Nerdinacan/galaxy | 4b07545d251622dde24d34b62d3d9a857e232780 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/api/roles.py | Nerdinacan/galaxy | 4b07545d251622dde24d34b62d3d9a857e232780 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/api/roles.py | Nerdinacan/galaxy | 4b07545d251622dde24d34b62d3d9a857e232780 | [
"CC-BY-3.0"
] | null | null | null | """
API operations on Role objects.
"""
import logging
from sqlalchemy import false
from galaxy import web
from galaxy.webapps.base.controller import BaseAPIController, url_for
log = logging.getLogger(__name__)
class RoleAPIController(BaseAPIController):
@web.legacy_expose_api
def index(self, trans, **kwd... | 39.189474 | 121 | 0.6296 |
794dd9575af46b084a69857ec2db88fc21819ff2 | 6,856 | py | Python | lecluvindex.py | cganterh/lecluvindex | b2cd082d460ddb0ca4d7d582fead9babcd457516 | [
"MIT"
] | null | null | null | lecluvindex.py | cganterh/lecluvindex | b2cd082d460ddb0ca4d7d582fead9babcd457516 | [
"MIT"
] | 2 | 2019-10-18T15:59:38.000Z | 2021-06-01T22:10:19.000Z | lecluvindex.py | cganterh/lecluvindex | b2cd082d460ddb0ca4d7d582fead9babcd457516 | [
"MIT"
] | null | null | null | """Provide UV index reporting capabilities to Le bot."""
from contextlib import contextmanager
from datetime import time
from logging import getLogger
import requests
from telegram.ext import CommandHandler
from telegram.ext.jobqueue import Days
logger = getLogger()
places = {
'antartica': 'ANTÁRTICA',... | 30.744395 | 79 | 0.596849 |
794dd982dd7bf0c9f21bab506fcca95965de6d27 | 8,021 | py | Python | tests/secret_links/test_sharing.py | wgresshoff/invenio-rdm-records | 91945829884ea4e46b05be26c97f11ffd045bcec | [
"MIT"
] | null | null | null | tests/secret_links/test_sharing.py | wgresshoff/invenio-rdm-records | 91945829884ea4e46b05be26c97f11ffd045bcec | [
"MIT"
] | null | null | null | tests/secret_links/test_sharing.py | wgresshoff/invenio-rdm-records | 91945829884ea4e46b05be26c97f11ffd045bcec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021 TU Wien.
# Copyright (C) 2021 Northwestern University.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test sharing of restricted records via secr... | 35.49115 | 77 | 0.705772 |
794dd9c4b37030dd9336cd310a69b2b5b684ac82 | 6,661 | py | Python | plenum/test/view_change/test_view_change_timeout.py | andkononykhin/plenum | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | [
"Apache-2.0"
] | null | null | null | plenum/test/view_change/test_view_change_timeout.py | andkononykhin/plenum | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | [
"Apache-2.0"
] | 1 | 2019-03-20T14:57:22.000Z | 2019-03-20T15:01:55.000Z | plenum/test/view_change/test_view_change_timeout.py | andkononykhin/plenum | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | [
"Apache-2.0"
] | null | null | null | import pytest
from plenum.test.delayers import vcd_delay
from plenum.test.stasher import delay_rules
from plenum.test.helper import waitForViewChange, perf_monitor_disabled, view_change_timeout
from plenum.test.node_request.helper import sdk_ensure_pool_functional
from plenum.test.node_catchup.helper import ensure_all... | 37.846591 | 113 | 0.720462 |
794dda10140bcdca45194e5023f970414f5f58ba | 1,396 | py | Python | changes/models/bazeltarget.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 443 | 2015-01-03T16:28:39.000Z | 2021-04-26T16:39:46.000Z | changes/models/bazeltarget.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 12 | 2015-07-30T19:07:16.000Z | 2016-11-07T23:11:21.000Z | changes/models/bazeltarget.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 47 | 2015-01-09T10:04:00.000Z | 2020-11-18T17:58:19.000Z | from __future__ import absolute_import, division
import uuid
from datetime import datetime
from sqlalchemy import Column, DateTime, ForeignKey, Text, Integer
from changes.config import db
from changes.constants import Result, ResultSource, Status
from changes.db.types.enum import Enum
from changes.db.types.guid impo... | 38.777778 | 83 | 0.712751 |
794dda564e4d1989129ebc4546d74e723cb3ab87 | 7,092 | py | Python | python/Kaos/ktime.py | D34D9001/R4ND0M_73571NG | d198c67b728f55cc39c6aab4f418a53483e3487b | [
"MIT"
] | 1 | 2022-01-05T06:53:39.000Z | 2022-01-05T06:53:39.000Z | python/Kaos/ktime.py | D34D9001/R4ND0M_73571NG | d198c67b728f55cc39c6aab4f418a53483e3487b | [
"MIT"
] | 5 | 2022-01-05T08:06:34.000Z | 2022-01-11T05:31:08.000Z | python/Kaos/ktime.py | D34D9001/R4ND0M_73571NG | d198c67b728f55cc39c6aab4f418a53483e3487b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created: Aug 2017
@author: D34D9001@9R0GR4M13
"""
import kerri
import time
from datetime import datetime
###################
# TIME MANAGEMENT #
###################
class Time(object):
""" This class controls the flow of time in your program """
def... | 26.762264 | 109 | 0.47335 |
794dda947fac8e50fd855b98da37bf99b3f2fb10 | 344 | py | Python | dojo/github_issue_link/urls.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,772 | 2018-01-22T23:32:15.000Z | 2022-03-31T14:49:33.000Z | dojo/github_issue_link/urls.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 3,461 | 2018-01-20T19:12:28.000Z | 2022-03-31T17:14:39.000Z | dojo/github_issue_link/urls.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,173 | 2018-01-23T07:10:23.000Z | 2022-03-31T14:40:43.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^github-webhook', views.webhook, name='github_web_hook'),
url(r'^github/add', views.new_github, name='add_github'),
url(r'^github/(?P<tid>\d+)/delete$', views.delete_github,
name='delete_github'),
url(r'^github$', views.... | 34.4 | 67 | 0.668605 |
794ddb0e90f69ec2e32158175344ab71424663e8 | 1,187 | py | Python | kevin/tests/leet/test_restore_the_array.py | kalyons11/kevin | 4e222fcd8ee7f2a275390f532c2fa5fef39060e8 | [
"MIT"
] | 1 | 2017-08-03T04:21:14.000Z | 2017-08-03T04:21:14.000Z | kevin/tests/leet/test_restore_the_array.py | kalyons11/kevin | 4e222fcd8ee7f2a275390f532c2fa5fef39060e8 | [
"MIT"
] | null | null | null | kevin/tests/leet/test_restore_the_array.py | kalyons11/kevin | 4e222fcd8ee7f2a275390f532c2fa5fef39060e8 | [
"MIT"
] | null | null | null | """
https://leetcode.com/problems/restore-the-array/
"""
from unittest import TestCase
from kevin.leet.restore_the_array import Solution
class TestRestoreTheArray(TestCase):
def _base_test_restore_the_array(self, s: str, k: int, expected: int):
sol = Solution()
actual = sol.number_of_arrays(s, k... | 23.74 | 74 | 0.634372 |
794ddb20968ee6a04991592b2b833a00d6e1c73a | 4,259 | py | Python | services/snet_grpc_wrapper.py | TENSAE21/network-analytics-services | 72c5dbe93e11e98f003758e646acf453073c43aa | [
"MIT"
] | null | null | null | services/snet_grpc_wrapper.py | TENSAE21/network-analytics-services | 72c5dbe93e11e98f003758e646acf453073c43aa | [
"MIT"
] | null | null | null | services/snet_grpc_wrapper.py | TENSAE21/network-analytics-services | 72c5dbe93e11e98f003758e646acf453073c43aa | [
"MIT"
] | null | null | null | # Tested on python3.6
import grpc
from concurrent import futures
import time
import logging
import network_analytics_pb2
import network_analytics_pb2_grpc
import bipartite_graphs
SLEEP_TIME = 86400 # One day
class NetworkAnalytics(network_analytics_pb2_grpc.NetowrkAnalyticsServicer):
def BipartiteGraph(self... | 24.477011 | 151 | 0.625264 |
794ddb3b3ae984b8b94aedaf22a470aaf6098a63 | 1,512 | py | Python | appengine_module/gae_ts_mon/instrument_endpoint.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 74 | 2015-04-01T02:35:15.000Z | 2021-12-17T22:10:56.000Z | appengine_module/gae_ts_mon/instrument_endpoint.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 123 | 2015-04-01T04:02:57.000Z | 2022-03-02T12:49:55.000Z | appengine_module/gae_ts_mon/instrument_endpoint.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 32 | 2015-04-03T01:40:47.000Z | 2021-11-13T15:20:13.000Z | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import functools
# Not all apps enable endpoints. If the import fails, the app will not
# use @instrument_endpoint() decorator, so it is safe to... | 28.528302 | 79 | 0.671958 |
794ddc06c43a2e0280eb014c60a8503fa7e76c27 | 4,413 | py | Python | PaddleSeg/paddleseg/datasets/ade.py | Pd-RegSea/pdrs-4-7 | 7b75690d30346a9ac13f730a20c52c327d7123ad | [
"Apache-2.0"
] | 2 | 2021-08-19T08:06:22.000Z | 2021-11-09T10:42:17.000Z | PaddleSeg/paddleseg/datasets/ade.py | Pd-RegSea/pdrs-4-7 | 7b75690d30346a9ac13f730a20c52c327d7123ad | [
"Apache-2.0"
] | null | null | null | PaddleSeg/paddleseg/datasets/ade.py | Pd-RegSea/pdrs-4-7 | 7b75690d30346a9ac13f730a20c52c327d7123ad | [
"Apache-2.0"
] | 1 | 2021-07-14T08:43:31.000Z | 2021-07-14T08:43:31.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.118182 | 117 | 0.629957 |
794ddc5c4b55c6bb4f7b989c798443cbc172661a | 2,414 | py | Python | resources/stat.py | world3/focusplus-api | 4d9211983095689f6f0f72c676d1d95edfe14819 | [
"Apache-2.0"
] | null | null | null | resources/stat.py | world3/focusplus-api | 4d9211983095689f6f0f72c676d1d95edfe14819 | [
"Apache-2.0"
] | null | null | null | resources/stat.py | world3/focusplus-api | 4d9211983095689f6f0f72c676d1d95edfe14819 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta, date
from flask_restful import Resource
from flask_jwt_extended import get_jwt_identity, jwt_required
from http import HTTPStatus
import json
from models.stat import Stat
from schemas.stat import StatSchema
from models.history import History
stat_list_schema = StatSchema(many... | 36.575758 | 115 | 0.623447 |
794ddc940eb10d51cc790806ff78236f3b2fb644 | 7,697 | py | Python | guardian/testapp/tests/test_core.py | wlanslovenija/django-guardian | 501695a190ff20aff13715311fd05062e67401c6 | [
"MIT"
] | null | null | null | guardian/testapp/tests/test_core.py | wlanslovenija/django-guardian | 501695a190ff20aff13715311fd05062e67401c6 | [
"MIT"
] | null | null | null | guardian/testapp/tests/test_core.py | wlanslovenija/django-guardian | 501695a190ff20aff13715311fd05062e67401c6 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from itertools import chain
from django.conf import settings
# Try the new app settings (Django 1.7) and fall back to the old system
try:
from django.apps import apps as django_apps
auth_app = django_apps.get_app_config("auth")
except ImportError:
from django.contrib... | 42.291209 | 79 | 0.664804 |
794ddd70b9faf7b5287a0f8716bb6791ffe5afee | 191 | py | Python | hadoop-examples/reducer.py | inpefess/AIUDSA18 | 443a9b3fe62f5dc1208db750642dd3bb94ad6fdd | [
"MIT"
] | null | null | null | hadoop-examples/reducer.py | inpefess/AIUDSA18 | 443a9b3fe62f5dc1208db750642dd3bb94ad6fdd | [
"MIT"
] | null | null | null | hadoop-examples/reducer.py | inpefess/AIUDSA18 | 443a9b3fe62f5dc1208db750642dd3bb94ad6fdd | [
"MIT"
] | null | null | null | #!/usr/bin/python
counter = 0
while True:
try:
# use `raw_input()` for Python 2
line = input()
except EOFError:
break
counter += int(line)
print(counter)
| 15.916667 | 40 | 0.565445 |
794dde43cb5e78f5fe69b764ec21acf66a02c39c | 10,204 | py | Python | InplusTrader/backtestEngine/mod/analyser/mod.py | zhengwsh/InplusTrader_Linux | 5f7eb17004da0b76ceafb93cb314de7a6009cd04 | [
"MIT"
] | 17 | 2017-04-20T05:17:25.000Z | 2020-09-30T08:58:03.000Z | InplusTrader/backtestEngine/mod/analyser/mod.py | vladhj38/InplusTrader_Linux | 5f7eb17004da0b76ceafb93cb314de7a6009cd04 | [
"MIT"
] | 1 | 2017-11-12T01:24:06.000Z | 2019-09-19T08:50:38.000Z | InplusTrader/backtestEngine/mod/analyser/mod.py | vladhj38/InplusTrader_Linux | 5f7eb17004da0b76ceafb93cb314de7a6009cd04 | [
"MIT"
] | 17 | 2017-04-17T08:17:00.000Z | 2020-10-25T01:56:49.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | 41.819672 | 116 | 0.650529 |
794ddec6c094ff04a82af0d77f3021e8ddb26cf1 | 930 | py | Python | tests/test_preprocess/test_tte_list.py | HughPaynter/PyGRB | 2eaf834cf3c62a639a056285ca9518456daa4b7c | [
"BSD-3-Clause"
] | 14 | 2020-05-29T02:43:18.000Z | 2022-03-12T13:27:36.000Z | tests/test_preprocess/test_tte_list.py | HughPaynter/PyGRB | 2eaf834cf3c62a639a056285ca9518456daa4b7c | [
"BSD-3-Clause"
] | 8 | 2020-08-03T02:41:52.000Z | 2021-06-22T05:41:52.000Z | tests/test_preprocess/test_tte_list.py | HughPaynter/PyGRB | 2eaf834cf3c62a639a056285ca9518456daa4b7c | [
"BSD-3-Clause"
] | 14 | 2020-06-30T07:10:47.000Z | 2022-03-12T13:27:39.000Z | import os
import unittest
from PyGRB.preprocess.GRB_class import BATSEGRB
class TestBATSEGRB(unittest.TestCase):
def setUp(self):
self.burst = 3770
self.datatype = 'tte_list'
def tearDown(self):
del self.burst
del self.datatype
def test_burst_assignment_tte_list(sel... | 21.627907 | 66 | 0.564516 |
794de12e12bb716c29742a754aaa612808350907 | 6,345 | py | Python | Coins_history.py | jacobbaruch/Coin_market_cap | c8eab8622b3b5d808f7530c036463c2544f8779e | [
"MIT"
] | 6 | 2018-03-19T10:18:18.000Z | 2020-02-13T15:49:30.000Z | Coins_history.py | jacobbaruch/Coin_market_cap | c8eab8622b3b5d808f7530c036463c2544f8779e | [
"MIT"
] | null | null | null | Coins_history.py | jacobbaruch/Coin_market_cap | c8eab8622b3b5d808f7530c036463c2544f8779e | [
"MIT"
] | 3 | 2018-09-13T03:18:00.000Z | 2021-08-30T17:58:03.000Z | import json
import sys
import requests
from bs4 import BeautifulSoup
import pandas as pd
from _datetime import datetime, date, timedelta
def save_crypto_coins_history(i_rank_start=1, i_rank_end=10, i_coin_file_path='crypto_coins',
i_from_date=None, i_to_date=None, i_min_volume=10... | 32.538462 | 112 | 0.696139 |
794de6c3bfccf0ae717e872d9e59096332d06a90 | 89 | py | Python | tests/integration/hogwarts/potions/apps.py | ducdetronquito/polyjuice | 6a55a6b2eb1ce3fd9d3614b0e788167a976e89c4 | [
"Unlicense"
] | 1 | 2020-07-16T06:29:58.000Z | 2020-07-16T06:29:58.000Z | tests/integration/hogwarts/potions/apps.py | ducdetronquito/polyjuice | 6a55a6b2eb1ce3fd9d3614b0e788167a976e89c4 | [
"Unlicense"
] | 3 | 2020-07-31T12:26:54.000Z | 2020-08-01T10:11:20.000Z | tests/integration/hogwarts/potions/apps.py | ducdetronquito/polyjuice | 6a55a6b2eb1ce3fd9d3614b0e788167a976e89c4 | [
"Unlicense"
] | null | null | null | from django.apps import AppConfig
class PotionsConfig(AppConfig):
name = "potions"
| 14.833333 | 33 | 0.752809 |
794de6f33bc9ffd78e9aed15908d5a550430302f | 2,791 | py | Python | sql_queries.py | WisnuMulya/Data-Modeling-Postgres | d83f1505d398bba05280c571c4cf5782a3d139a9 | [
"MIT"
] | null | null | null | sql_queries.py | WisnuMulya/Data-Modeling-Postgres | d83f1505d398bba05280c571c4cf5782a3d139a9 | [
"MIT"
] | null | null | null | sql_queries.py | WisnuMulya/Data-Modeling-Postgres | d83f1505d398bba05280c571c4cf5782a3d139a9 | [
"MIT"
] | null | null | null | # DROP TABLES
songplay_table_drop = "DROP TABLE IF EXISTS songplays"
user_table_drop = "DROP TABLE IF EXISTS users"
song_table_drop = "DROP TABLE IF EXISTS songs"
artist_table_drop = "DROP TABLE IF EXISTS artists"
time_table_drop = "DROP TABLE IF EXISTS time"
# CREATE TABLES
songplay_table_create = ("""
CREATE TABLE... | 24.060345 | 71 | 0.683626 |
794de72b1ad8f5a36e72fa7276df5c2165b4f10e | 8,649 | py | Python | dl_code/pcode/distributed_running_nlp.py | ZhicongLiang/ChocoSGD | a127f32e0629d32dc6ca4c4f2837c3980fa3f76c | [
"Apache-2.0"
] | 39 | 2019-06-16T15:28:49.000Z | 2022-03-15T09:20:35.000Z | dl_code/pcode/distributed_running_nlp.py | Distributed-Deep-Learning/ChocoSGD | c7715b368cc9f66674720ea9c823032c8058bdf6 | [
"Apache-2.0"
] | 6 | 2020-04-15T21:02:49.000Z | 2021-05-24T23:24:03.000Z | dl_code/pcode/distributed_running_nlp.py | Distributed-Deep-Learning/ChocoSGD | c7715b368cc9f66674720ea9c823032c8058bdf6 | [
"Apache-2.0"
] | 18 | 2019-07-24T22:19:10.000Z | 2022-02-09T08:20:10.000Z | # -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
import torch
from pcode.utils.checkpoint import save_to_checkpoint
from pcode.utils.logging import (
display_training_stat,
display_test_stat,
dispaly_best_test_stat,
)
from pcode.utils.stat_tracker import RuntimeTracker
from pcode.utils... | 35.592593 | 131 | 0.582033 |
794de83463e105565b14d3a027712fe844da1910 | 5,184 | py | Python | utils/align_custom.py | darpan-jain/registration-master | 0b7f894bf6d0cee496e846d4bff56a07f545e544 | [
"MIT"
] | 2 | 2021-09-03T18:14:57.000Z | 2021-09-19T17:54:27.000Z | utils/align_custom.py | darpan-jain/registration-master | 0b7f894bf6d0cee496e846d4bff56a07f545e544 | [
"MIT"
] | 4 | 2021-08-25T15:19:49.000Z | 2022-03-11T23:31:11.000Z | utils/align_custom.py | darpan-jain/registration-master | 0b7f894bf6d0cee496e846d4bff56a07f545e544 | [
"MIT"
] | null | null | null | '''
Implement Dlib Face alignment strategy
However, this method/approach doesn't deform the original image like Dlib does.
This also categorizes the face in 3 types: Center, Left, Right
Align face based on facial landmarks
'''
import math
import cv2
import numpy as np
class AlignCustom(object):
def __init__(... | 31.803681 | 110 | 0.552662 |
794de87d8ecbc5cdbeca2b68f90654aaf31cf396 | 22,046 | py | Python | examples/hybrid_parallelism/model/transformer_encoder.py | Melon-Zhou/FleetX | ad055d27f3f77184f73430f31ece81aa88c51906 | [
"Apache-2.0"
] | 1 | 2021-06-08T12:03:38.000Z | 2021-06-08T12:03:38.000Z | examples/hybrid_parallelism/model/transformer_encoder.py | Melon-Zhou/FleetX | ad055d27f3f77184f73430f31ece81aa88c51906 | [
"Apache-2.0"
] | null | null | null | examples/hybrid_parallelism/model/transformer_encoder.py | Melon-Zhou/FleetX | ad055d27f3f77184f73430f31ece81aa88c51906 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.969183 | 142 | 0.539962 |
794de8ad8a3c2ff40d677cdef364c6c0fab6cc9d | 3,060 | py | Python | tests/functional/test_positive_float.py | AutumnalDream/tartiflette-plugin-scalars | 2c73b20eac93b364a97b2192956e5fd4034ec35a | [
"MIT"
] | 8 | 2019-10-02T12:47:15.000Z | 2021-12-15T14:29:37.000Z | tests/functional/test_positive_float.py | AutumnalDream/tartiflette-plugin-scalars | 2c73b20eac93b364a97b2192956e5fd4034ec35a | [
"MIT"
] | 109 | 2019-09-19T13:37:43.000Z | 2022-03-28T07:08:50.000Z | tests/functional/test_positive_float.py | AutumnalDream/tartiflette-plugin-scalars | 2c73b20eac93b364a97b2192956e5fd4034ec35a | [
"MIT"
] | 4 | 2019-10-26T19:57:20.000Z | 2021-06-24T14:32:37.000Z | import pytest
from tartiflette import Resolver, create_engine
@pytest.mark.asyncio
async def test_positive_float_ok():
@Resolver("Query.positiveFloat", schema_name="test_positive_float_ok")
async def positive_float_resolver(*_args, **_kwargs):
return 999.99
sdl = """
type Query {
pos... | 25.714286 | 79 | 0.636601 |
794de8ec57ff317d026c6af28893c94aa4ee94ce | 5,559 | py | Python | cvat/apps/dashboard/parseToJsTree.py | ItayHoresh/improvedCvat | b0fc79a574d74643b93955a4fc6a1969f49685d1 | [
"MIT"
] | null | null | null | cvat/apps/dashboard/parseToJsTree.py | ItayHoresh/improvedCvat | b0fc79a574d74643b93955a4fc6a1969f49685d1 | [
"MIT"
] | 6 | 2020-03-25T11:49:12.000Z | 2020-06-06T01:35:38.000Z | cvat/apps/dashboard/parseToJsTree.py | OperationalBina/Cvat | b0fc79a574d74643b93955a4fc6a1969f49685d1 | [
"MIT"
] | 1 | 2020-12-02T12:27:33.000Z | 2020-12-02T12:27:33.000Z | from oswrapper import *
from cvat.apps.engine.models import *
from django.db.models import Q
import requests
import json
import os
global generator_id
generator_id = 0
global generator_id_sorted
generator_id_sorted = 0
def getObjectStoragesPerProject(user_id, project_id, isAdmin):
# if the user au... | 34.104294 | 245 | 0.595791 |
794dea1cd9655b2a7b32f322140aba90bb0be164 | 96 | py | Python | Codewars/8kyu/find-multiples-of-a-number/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codewars/8kyu/find-multiples-of-a-number/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codewars/8kyu/find-multiples-of-a-number/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python - 3.6.0
find_multiples = lambda integer, limit: [*range(integer, limit + 1, integer)]
| 24 | 77 | 0.6875 |
794dea3b3b9100d6fda895cfd9c6ace1527c1c1e | 746 | py | Python | web/nouns/migrations/0015_auto_20151104_2059.py | mehrdad-shokri/arguman.org | b02e5f50f85964180c02f353c1d0aa84ee6d20dd | [
"MIT"
] | 1 | 2021-07-07T11:01:04.000Z | 2021-07-07T11:01:04.000Z | web/nouns/migrations/0015_auto_20151104_2059.py | mehrdad-shokri/arguman.org | b02e5f50f85964180c02f353c1d0aa84ee6d20dd | [
"MIT"
] | null | null | null | web/nouns/migrations/0015_auto_20151104_2059.py | mehrdad-shokri/arguman.org | b02e5f50f85964180c02f353c1d0aa84ee6d20dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nouns', '0014_auto_20151104_0127'),
]
operations = [
migrations.AddField(
model_name='noun',
name='l... | 24.866667 | 66 | 0.567024 |
794ded2bb76d1127021745cda8541dc883cf3386 | 10,770 | py | Python | zppy/templates/coupled_global.py | xylar/zppy | 8f1c80cfc4eae36731a759be74b3d6f5998cf7f6 | [
"BSD-3-Clause"
] | null | null | null | zppy/templates/coupled_global.py | xylar/zppy | 8f1c80cfc4eae36731a759be74b3d6f5998cf7f6 | [
"BSD-3-Clause"
] | null | null | null | zppy/templates/coupled_global.py | xylar/zppy | 8f1c80cfc4eae36731a759be74b3d6f5998cf7f6 | [
"BSD-3-Clause"
] | null | null | null | # Script to plot some global atmosphere and ocean time series
import math
import numpy as np
import matplotlib.pyplot as plt
from readTS import TS
import matplotlib as mpl
mpl.use('Agg')
import shutil
import glob
from netCDF4 import Dataset
import sys
##---additional function to get moc time series
def getmoc(dir_in):... | 32.245509 | 150 | 0.576602 |
794dedb615644350ee02dda07e17ff8e896d2c2a | 210 | py | Python | mcache/datadog_checks/mcache/__init__.py | glasser/integrations-core | 1dd515d49b1690a1369ee5195713605b1b072b1f | [
"BSD-3-Clause"
] | 2 | 2019-05-28T03:48:29.000Z | 2019-07-05T07:05:58.000Z | mcache/datadog_checks/mcache/__init__.py | glasser/integrations-core | 1dd515d49b1690a1369ee5195713605b1b072b1f | [
"BSD-3-Clause"
] | 4 | 2019-07-03T02:53:19.000Z | 2019-07-10T14:52:14.000Z | mcache/datadog_checks/mcache/__init__.py | glasser/integrations-core | 1dd515d49b1690a1369ee5195713605b1b072b1f | [
"BSD-3-Clause"
] | 1 | 2019-12-23T13:35:17.000Z | 2019-12-23T13:35:17.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
from .mcache import Memcache
__all__ = ['__version__', 'Memcache']
| 26.25 | 59 | 0.752381 |
794dedba40b40b476e8d63ea141f220d3753504e | 1,679 | py | Python | homeassistant/components/multimatic/entities.py | thomasgermain/home-assistant | 69a8ba678e0276bc1bfde0f3d9e9d3682209f962 | [
"Apache-2.0"
] | 7 | 2019-08-15T13:36:58.000Z | 2020-03-18T10:46:29.000Z | homeassistant/components/multimatic/entities.py | thomasgermain/home-assistant | 69a8ba678e0276bc1bfde0f3d9e9d3682209f962 | [
"Apache-2.0"
] | 73 | 2020-10-01T06:39:39.000Z | 2022-03-31T06:16:15.000Z | homeassistant/components/multimatic/entities.py | thomasgermain/home-assistant | 69a8ba678e0276bc1bfde0f3d9e9d3682209f962 | [
"Apache-2.0"
] | 4 | 2019-10-26T14:25:13.000Z | 2020-11-10T11:00:18.000Z | """Common entities."""
from __future__ import annotations
from abc import ABC
import logging
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util import slugify
from .const import DOMAIN as MULTIMATIC
from .coordinator import MultimaticCoordinator
_LOGGER = logging.getLogge... | 31.092593 | 87 | 0.691483 |
794dedff7de40d3059d8aaca01a7149e012da0bd | 3,473 | py | Python | app/models.py | azanegin/miptcommuna | 97ad8cbe161cbbd86494ef7530588492571024b7 | [
"MIT"
] | null | null | null | app/models.py | azanegin/miptcommuna | 97ad8cbe161cbbd86494ef7530588492571024b7 | [
"MIT"
] | null | null | null | app/models.py | azanegin/miptcommuna | 97ad8cbe161cbbd86494ef7530588492571024b7 | [
"MIT"
] | null | null | null | """
Definition of models.
"""
from django.db import models
from django.contrib.auth.models import User
class Person(models.Model):
user = models.OneToOneField(User)
department = models.TextField(default='') # факультет
group = models.TextField(default='') # группа
vkLink = models.TextField(defaul... | 36.177083 | 77 | 0.700835 |
794def6324eefcff7db3e56879f3d4273ff422b1 | 2,482 | py | Python | docs/conf.py | mrob95/pycom-VirtualDesktopAccessor | fbd45f821c34f5961ec7b33a7e3045cc652dd862 | [
"MIT"
] | null | null | null | docs/conf.py | mrob95/pycom-VirtualDesktopAccessor | fbd45f821c34f5961ec7b33a7e3045cc652dd862 | [
"MIT"
] | null | null | null | docs/conf.py | mrob95/pycom-VirtualDesktopAccessor | fbd45f821c34f5961ec7b33a7e3045cc652dd862 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 31.820513 | 79 | 0.656728 |
794def8bb79b695924270a9cf2b0aee42c7bf220 | 4,184 | py | Python | src/Report/Report.py | kuefmz/software_classification | 0dee3a046e59052ab272e4029195fb21f3d58c04 | [
"Apache-2.0"
] | null | null | null | src/Report/Report.py | kuefmz/software_classification | 0dee3a046e59052ab272e4029195fb21f3d58c04 | [
"Apache-2.0"
] | null | null | null | src/Report/Report.py | kuefmz/software_classification | 0dee3a046e59052ab272e4029195fb21f3d58c04 | [
"Apache-2.0"
] | null | null | null | from sklearn.metrics import make_scorer
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score,precision_recall_fscore_support
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import cr... | 40.230769 | 126 | 0.708174 |
794defa26f562e3224f4b44ef77744ce7bd5fd39 | 2,174 | py | Python | optimus/outliers/mad.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | 1,045 | 2017-07-17T17:59:46.000Z | 2021-06-15T07:06:48.000Z | optimus/outliers/mad.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | 955 | 2017-07-14T15:47:58.000Z | 2021-05-27T14:16:24.000Z | optimus/outliers/mad.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | 226 | 2017-08-04T20:41:33.000Z | 2021-05-21T08:28:33.000Z | from optimus.helpers.constants import RELATIVE_ERROR
from optimus.helpers.filters import dict_filter
from optimus.helpers.json import dump_json
from optimus.outliers.abstract_outliers_bounds import AbstractOutlierBounds
class MAD(AbstractOutlierBounds):
"""
Handle outliers using mad http://eurekastatistics.co... | 38.821429 | 111 | 0.649954 |
794defe6025092790d7da33d724c0e26fe35caf6 | 64,512 | py | Python | sympy/plotting/plot.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 319 | 2016-09-22T15:54:48.000Z | 2022-03-18T02:36:58.000Z | sympy/plotting/plot.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 9 | 2016-11-03T21:56:41.000Z | 2020-08-09T19:27:37.000Z | sympy/plotting/plot.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 27 | 2016-10-06T16:05:32.000Z | 2022-03-18T02:37:00.000Z | """Plotting module for Sympy.
A plot is represented by the ``Plot`` class that contains a reference to the
backend and a list of the data series to be plotted. The data series are
instances of classes meant to simplify getting points and meshes from sympy
expressions. ``plot_backends`` is a dictionary with all the bac... | 35.543802 | 132 | 0.592448 |
794df05c2792f68168f217f9c84708db640b884d | 5,474 | py | Python | test/test_od.py | mlederhi/canopen | dd2d1a73f75844b66b5fa4a26b01cb8cebe72beb | [
"MIT"
] | 301 | 2016-10-19T03:21:10.000Z | 2022-03-31T11:00:26.000Z | test/test_od.py | mlederhi/canopen | dd2d1a73f75844b66b5fa4a26b01cb8cebe72beb | [
"MIT"
] | 236 | 2016-10-27T15:33:51.000Z | 2022-03-22T19:57:58.000Z | test/test_od.py | mlederhi/canopen | dd2d1a73f75844b66b5fa4a26b01cb8cebe72beb | [
"MIT"
] | 143 | 2016-10-22T06:48:33.000Z | 2022-03-22T09:49:20.000Z | import unittest
from canopen import objectdictionary as od
class TestDataConversions(unittest.TestCase):
def test_boolean(self):
var = od.Variable("Test BOOLEAN", 0x1000)
var.data_type = od.BOOLEAN
self.assertEqual(var.decode_raw(b"\x01"), True)
self.assertEqual(var.decode_raw(b"\... | 39.381295 | 83 | 0.648703 |
794df136f39b9e2cfa450f252b3c4e9dff9be930 | 1,139 | py | Python | scripts/fp_quan/run_fixedp_quan.py | deep-fry/mayo | 7211a11fdb9bb0a036d496a3eba16c96db122f89 | [
"MIT"
] | 110 | 2018-06-07T17:52:29.000Z | 2022-03-28T08:04:02.000Z | scripts/fp_quan/run_fixedp_quan.py | kypomon/mayo | 7211a11fdb9bb0a036d496a3eba16c96db122f89 | [
"MIT"
] | 6 | 2019-10-17T12:00:29.000Z | 2021-10-21T13:41:22.000Z | scripts/fp_quan/run_fixedp_quan.py | kypomon/mayo | 7211a11fdb9bb0a036d496a3eba16c96db122f89 | [
"MIT"
] | 22 | 2018-07-05T01:30:49.000Z | 2021-10-19T06:15:40.000Z | import yaml
import os
import subprocess
mayo_dir = "../../"
gpus = [0, 1]
model='mobilenet_v1'
cmd_formatter = './my datasets/imagenet.yaml models/override/{}.yaml models/override/quantize/fixed_incremental.yaml trainers/cifarnet.yaml system.checkpoint.load=pretrained train.learning_rate._initial=0.01 train.learning_r... | 81.357143 | 442 | 0.808604 |
794df13dbe715c7dd455dee29df378ded8d6cde0 | 462 | py | Python | seimas/migrations/0007_auto_20180813_1328.py | zinaukarenku/zkr-platform | 8daf7d1206c482f1f8e0bcd54d4fde783e568774 | [
"Apache-2.0"
] | 2 | 2018-11-16T21:45:17.000Z | 2019-02-03T19:55:46.000Z | seimas/migrations/0007_auto_20180813_1328.py | zinaukarenku/zkr-platform | 8daf7d1206c482f1f8e0bcd54d4fde783e568774 | [
"Apache-2.0"
] | 13 | 2018-08-17T19:12:11.000Z | 2022-03-11T23:27:41.000Z | seimas/migrations/0007_auto_20180813_1328.py | zinaukarenku/zkr-platform | 8daf7d1206c482f1f8e0bcd54d4fde783e568774 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1 on 2018-08-13 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seimas', '0006_auto_20180813_1327'),
]
operations = [
migrations.AlterField(
model_name='politicianparliamentgroup',
n... | 24.315789 | 108 | 0.649351 |
794df26f790dfdf227ae70b59882f486b92822bb | 37,448 | py | Python | eraserbenchmark/rationale_benchmark/metrics.py | go2chayan/HateXplain | c5f173d39dca348ec6481fca08a17bc80616651a | [
"MIT"
] | 69 | 2021-03-05T20:50:39.000Z | 2022-03-29T17:45:55.000Z | eraserbenchmark/rationale_benchmark/metrics.py | go2chayan/HateXplain | c5f173d39dca348ec6481fca08a17bc80616651a | [
"MIT"
] | 10 | 2021-03-05T07:38:06.000Z | 2022-03-31T22:27:39.000Z | eraserbenchmark/rationale_benchmark/metrics.py | go2chayan/HateXplain | c5f173d39dca348ec6481fca08a17bc80616651a | [
"MIT"
] | 28 | 2021-03-22T03:46:43.000Z | 2022-03-08T18:34:38.000Z | import argparse
import json
import logging
import os
import pprint
from collections import Counter, defaultdict, namedtuple
from dataclasses import dataclass
from itertools import chain
from typing import Any, Callable, Dict, List, Set, Tuple
import numpy as np
import torch
from scipy.stats import entropy
from sklea... | 55.80924 | 219 | 0.679636 |
794df327324d9342d659f77fb9d087e5e364f0df | 8,848 | py | Python | peepo/autopoiesis/particle.py | hayoc/peepo | b15fd18d0f618e1e24eadc97c72fde62039ddafb | [
"MIT"
] | 2 | 2019-03-04T21:12:21.000Z | 2021-03-30T00:35:50.000Z | peepo/autopoiesis/particle.py | hayoc/peepo | b15fd18d0f618e1e24eadc97c72fde62039ddafb | [
"MIT"
] | null | null | null | peepo/autopoiesis/particle.py | hayoc/peepo | b15fd18d0f618e1e24eadc97c72fde62039ddafb | [
"MIT"
] | null | null | null | import pygame as pg
import math
import random
vec = pg.math.Vector2
SCREEN_SIZE = (800, 800)
class Particle:
SIZE = (4, 4)
SPEED = 2
KIND_COLOR = {
"S": "yellow",
"K": "green",
"L": "blue"
}
KIND_SIZE = {
"S": (4, 4),
"K": (6, 6),
"L": (6, 6)
... | 38.469565 | 121 | 0.539331 |
794df3604fe86f5abe00916172d46b23cc76faf0 | 9,606 | py | Python | test/integration/test_case_management_v1.py | zachsirotto/platform-services-python-sdk | 32a080b7a93567f9528867a31bd0b47423297bab | [
"Apache-2.0"
] | null | null | null | test/integration/test_case_management_v1.py | zachsirotto/platform-services-python-sdk | 32a080b7a93567f9528867a31bd0b47423297bab | [
"Apache-2.0"
] | null | null | null | test/integration/test_case_management_v1.py | zachsirotto/platform-services-python-sdk | 32a080b7a93567f9528867a31bd0b47423297bab | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Copyright 2020 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 30.987097 | 94 | 0.622423 |
794df5a0f81828572b9168a65ac6ee07e507721a | 28,678 | py | Python | podium/datasets/iterator.py | TakeLab/podium | 11ef32d889e483d4d77a44b61e0b5da956ee3a54 | [
"BSD-3-Clause"
] | 51 | 2021-03-19T14:14:31.000Z | 2022-02-18T00:42:51.000Z | podium/datasets/iterator.py | TakeLab/podium | 11ef32d889e483d4d77a44b61e0b5da956ee3a54 | [
"BSD-3-Clause"
] | 9 | 2021-03-31T15:39:28.000Z | 2021-04-16T13:28:15.000Z | podium/datasets/iterator.py | TakeLab/podium | 11ef32d889e483d4d77a44b61e0b5da956ee3a54 | [
"BSD-3-Clause"
] | 1 | 2021-07-26T04:54:18.000Z | 2021-07-26T04:54:18.000Z | """
Module contains classes for iterating over datasets.
"""
import math
import warnings
from abc import ABC, abstractmethod
from collections import defaultdict
from random import Random
from typing import Callable
from typing import Iterator as PythonIterator
from typing import List, NamedTuple, Tuple
import numpy as... | 33.19213 | 89 | 0.593974 |
794df662e3e9087dd9fdc5e2156151f3b512d201 | 9,627 | py | Python | doc/source/conf.py | RobbiNespu/scikit-image | a65b8af4bf0f5f71624a91ea5ce7812e80cae4cb | [
"BSD-3-Clause"
] | 8 | 2016-03-11T13:23:51.000Z | 2021-12-19T10:43:26.000Z | doc/source/conf.py | RobbiNespu/scikit-image | a65b8af4bf0f5f71624a91ea5ce7812e80cae4cb | [
"BSD-3-Clause"
] | null | null | null | doc/source/conf.py | RobbiNespu/scikit-image | a65b8af4bf0f5f71624a91ea5ce7812e80cae4cb | [
"BSD-3-Clause"
] | 4 | 2020-06-19T00:04:34.000Z | 2021-02-23T07:24:00.000Z | # -*- coding: utf-8 -*-
#
# skimage documentation build configuration file, created by
# sphinx-quickstart on Sat Aug 22 13:00:30 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 32.197324 | 80 | 0.68069 |
794df6b8422d9b046381612add9644760a6c97b9 | 1,529 | py | Python | runtime/pylibs/normpatch.py | bingusware/client | c822e49ec2f1f8eaa8963194f562afa6d4cff594 | [
"MIT"
] | 5 | 2021-06-01T14:25:01.000Z | 2022-02-11T10:15:10.000Z | runtime/pylibs/normpatch.py | bingusware/client | c822e49ec2f1f8eaa8963194f562afa6d4cff594 | [
"MIT"
] | 3 | 2021-02-23T08:47:27.000Z | 2021-02-26T11:58:18.000Z | runtime/pylibs/normpatch.py | bingusware/client | c822e49ec2f1f8eaa8963194f562afa6d4cff594 | [
"MIT"
] | null | null | null | import sys
import os
import shutil
from optparse import OptionParser
def normalisepatch(in_filename, out_filename=None):
in_filename = os.path.normpath(in_filename)
if out_filename is None:
tmp_filename = in_filename + '.tmp'
else:
out_filename = os.path.normpath(out_filename)
... | 31.204082 | 97 | 0.568999 |
794df72d630acfdfb201ad1b487ef4d0a99599a6 | 1,021 | py | Python | wargame/designpatterns/pythonic_woodelf.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | 1 | 2020-12-01T20:30:27.000Z | 2020-12-01T20:30:27.000Z | wargame/designpatterns/pythonic_woodelf.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | wargame/designpatterns/pythonic_woodelf.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | """pythonic_woodelf
This is one of the different GameUnits that are used in the desing patterns
examples. But, differently than the others, this unit represents a
third-party class that has an incompatible interface.
:copyright: 2020, Jean Tardelli
:license: The MIT license (MIT). See LICENSE file for further detai... | 30.939394 | 76 | 0.669931 |
794df73ed992ef7e37f6266a267b1ced3601a859 | 7,159 | py | Python | test_conebound.py | VictorDavis/conebound | 2f0600d946d27abfec10d19a840044c2ec9c18f1 | [
"MIT"
] | 2 | 2021-04-24T22:35:51.000Z | 2021-11-15T09:45:17.000Z | test_conebound.py | VictorDavis/conebound | 2f0600d946d27abfec10d19a840044c2ec9c18f1 | [
"MIT"
] | null | null | null | test_conebound.py | VictorDavis/conebound | 2f0600d946d27abfec10d19a840044c2ec9c18f1 | [
"MIT"
] | 1 | 2021-04-24T22:35:56.000Z | 2021-04-24T22:35:56.000Z | # bloody dependencies
import numpy as np
from numpy.linalg import norm
import unittest
# things to test
from conebound import bounding_cone
# unit tests
class ConeBoundTest(unittest.TestCase):
# bounding cone aperture < 90
def test_2d_acute(self):
# hyperparameters
ndim = 2
axis = n... | 31.399123 | 81 | 0.600084 |
794df7907637cffc6bbd5bb1a4a1e94864577757 | 2,667 | py | Python | envs/voxel_env/voxel_env_utils.py | magicly/sample-factory | 32cd44a907653fdad40c026ba0a4fa4cca68554b | [
"MIT"
] | 1 | 2020-11-30T23:32:04.000Z | 2020-11-30T23:32:04.000Z | envs/voxel_env/voxel_env_utils.py | magicly/sample-factory | 32cd44a907653fdad40c026ba0a4fa4cca68554b | [
"MIT"
] | null | null | null | envs/voxel_env/voxel_env_utils.py | magicly/sample-factory | 32cd44a907653fdad40c026ba0a4fa4cca68554b | [
"MIT"
] | 1 | 2021-12-13T01:45:11.000Z | 2021-12-13T01:45:11.000Z | import gym
from voxel_env.voxel_env_gym import VoxelEnv
from envs.env_utils import RewardShapingInterface
from utils.utils import str2bool
class RewardShapingWrapper(gym.Wrapper, RewardShapingInterface):
def __init__(self, env):
gym.Wrapper.__init__(self, env)
RewardShapingInterface.__init__(self... | 39.220588 | 223 | 0.735283 |
794df7aca28de4d3ea300a7092a04d218c24cad1 | 8,217 | py | Python | test/enhanced_FEM_test.py | sychan/ExpressionAPI | a86b07d033158cb8beeaf267dc489a8ca11aec67 | [
"MIT"
] | null | null | null | test/enhanced_FEM_test.py | sychan/ExpressionAPI | a86b07d033158cb8beeaf267dc489a8ca11aec67 | [
"MIT"
] | null | null | null | test/enhanced_FEM_test.py | sychan/ExpressionAPI | a86b07d033158cb8beeaf267dc489a8ca11aec67 | [
"MIT"
] | 3 | 2017-08-09T22:24:48.000Z | 2018-06-13T16:19:38.000Z | # -*- coding: utf-8 -*-
import unittest
import os # noqa: F401
import time
import inspect
import shutil
import json
from os import environ
try:
from ConfigParser import ConfigParser # py2
except BaseException:
from configparser import ConfigParser # py3
from pprint import pprint, pformat # noqa: F401
fr... | 43.707447 | 122 | 0.527808 |
794df82dd3aeaf3b0328c12ff1c62a20dc57517a | 1,118 | py | Python | aerolyzer/wavelength.py | Aerolyzer/Aerolyzer | f6152d79569c8d061b167a72c2f51860dcb605b6 | [
"Apache-2.0"
] | 9 | 2016-10-21T22:19:20.000Z | 2017-12-04T05:05:36.000Z | aerolyzer/wavelength.py | liusop/Aerolyze | f6152d79569c8d061b167a72c2f51860dcb605b6 | [
"Apache-2.0"
] | 102 | 2016-10-21T11:01:35.000Z | 2018-05-24T00:58:08.000Z | aerolyzer/wavelength.py | liusop/Aerolyze | f6152d79569c8d061b167a72c2f51860dcb605b6 | [
"Apache-2.0"
] | 14 | 2016-10-21T11:03:16.000Z | 2017-11-24T21:32:02.000Z | import math
import cv2
def comparisonArray(mode):
img = cv2.imread('./images/Spectrum1pixel.png')
bgr = []
hsv = []
i = 0
if mode == 0:
while i < (img.shape[1]):
bgr.append(img[0, i])
i += 1
return bgr
else:
hsvimg = cv2.cvtColor(img, cv2.COLOR_B... | 24.844444 | 73 | 0.521467 |
794df84bfad1b34391903c579d151c9cbdf238df | 261 | py | Python | manage.py | varmarakesh/service-management | e448e60873dc4502edc39eb51e0e8d9d1832adf4 | [
"BSD-3-Clause"
] | null | null | null | manage.py | varmarakesh/service-management | e448e60873dc4502edc39eb51e0e8d9d1832adf4 | [
"BSD-3-Clause"
] | null | null | null | manage.py | varmarakesh/service-management | e448e60873dc4502edc39eb51e0e8d9d1832adf4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "service-management.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.727273 | 82 | 0.777778 |
794df8b5a0f2e64e5105c0b26d58bee0895cbc5b | 4,050 | py | Python | scripts/generate_song_data_beam.py | gmittal/symbolic-music-diffusion | 84128ca038fb8757cc6ce15af04b445299f60f99 | [
"Apache-2.0"
] | 45 | 2021-03-05T22:29:31.000Z | 2022-03-26T18:11:58.000Z | scripts/generate_song_data_beam.py | gmittal/symbolic-music-diffusion | 84128ca038fb8757cc6ce15af04b445299f60f99 | [
"Apache-2.0"
] | 1 | 2021-12-07T01:37:30.000Z | 2021-12-07T01:37:30.000Z | scripts/generate_song_data_beam.py | gmittal/symbolic-music-diffusion | 84128ca038fb8757cc6ce15af04b445299f60f99 | [
"Apache-2.0"
] | 7 | 2021-04-03T12:09:36.000Z | 2022-02-11T17:07:31.000Z | # Copyright 2021 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.615385 | 77 | 0.676296 |
794dfa0ae6d7a645dc9c59750690f6c76d749ad8 | 642 | py | Python | ext/flask_dapr/flask_dapr/__init__.py | willtsai/python-sdk | 7de59720cd30e02a5fa2a90fb43eb5bb93c0f63e | [
"Apache-2.0"
] | 125 | 2019-10-16T17:57:22.000Z | 2022-03-08T09:16:01.000Z | ext/flask_dapr/flask_dapr/__init__.py | willtsai/python-sdk | 7de59720cd30e02a5fa2a90fb43eb5bb93c0f63e | [
"Apache-2.0"
] | 319 | 2019-10-17T13:49:23.000Z | 2022-03-31T19:32:53.000Z | ext/flask_dapr/flask_dapr/__init__.py | willtsai/python-sdk | 7de59720cd30e02a5fa2a90fb43eb5bb93c0f63e | [
"Apache-2.0"
] | 69 | 2019-10-23T23:22:56.000Z | 2022-03-16T13:27:17.000Z | # -*- coding: utf-8 -*-
"""
Copyright 2021 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | 33.789474 | 72 | 0.767913 |
794dfa19273e7d19aacc49c6dc4f158cf986389a | 6,132 | py | Python | tictactoe/ConnectN.py | piotrbazan/deep-reinforcement-learning | 165ab29a1d85630b7baa7ccb31a1ab91cd0c6413 | [
"MIT"
] | null | null | null | tictactoe/ConnectN.py | piotrbazan/deep-reinforcement-learning | 165ab29a1d85630b7baa7ccb31a1ab91cd0c6413 | [
"MIT"
] | null | null | null | tictactoe/ConnectN.py | piotrbazan/deep-reinforcement-learning | 165ab29a1d85630b7baa7ccb31a1ab91cd0c6413 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.animation as animation
from copy import copy
# output the index of when v has a continuous string of i
# get_runs([0,0,1,1,1,0,0],1) gives [2],[5],[3]
def get_runs(v, i):
bounded... | 28.924528 | 147 | 0.540607 |
794dfad980eb872c97a98fad475a601e299996c1 | 5,735 | py | Python | animations/weightless-morning.py | TristanCacqueray/demo-render | 4c8403e684165e5e75c046ee023c1f794a6650a8 | [
"Apache-2.0"
] | 9 | 2018-02-19T14:17:12.000Z | 2021-03-27T14:46:28.000Z | animations/weightless-morning.py | TristanCacqueray/demo-render | 4c8403e684165e5e75c046ee023c1f794a6650a8 | [
"Apache-2.0"
] | null | null | null | animations/weightless-morning.py | TristanCacqueray/demo-render | 4c8403e684165e5e75c046ee023c1f794a6650a8 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 35.621118 | 78 | 0.587097 |
794dfd480d3c2dd684a0f8be99bd43b790e8aa49 | 19,141 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/rsvpp2pegresslsps_1581d5bc15266f4f3d71f22c869262cd.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/rsvpp2pegresslsps_1581d5bc15266f4f3d71f22c869262cd.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/rsvpp2pegresslsps_1581d5bc15266f4f3d71f22c869262cd.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 41.884026 | 417 | 0.650227 |
794dfd861362919b04138dabc98bd56ba5f8e611 | 4,439 | py | Python | pyleecan/Generator/ClassGenerator/copy_method_generator.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 4 | 2017-11-27T10:14:34.000Z | 2018-09-20T11:30:32.000Z | pyleecan/Generator/ClassGenerator/copy_method_generator.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | null | null | null | pyleecan/Generator/ClassGenerator/copy_method_generator.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | null | null | null | from ...Generator import PYTHON_TYPE, TAB, TAB2, TAB3, TAB4, TAB5, TAB6, TAB7
from ...Generator.read_fct import is_list_pyleecan_type, is_dict_pyleecan_type
from ...Generator.ClassGenerator.init_method_generator import get_mother_attr
T1 = "\n" + TAB
T2 = "\n" + TAB2
T3 = "\n" + TAB3
T4 = "\n" + TAB4
T5 = "\n" + TAB5
... | 42.682692 | 97 | 0.54269 |
794dfe460a8651ddbc409f6842f828dc1eb2785c | 18,151 | py | Python | saleor/settings.py | dkramskoj/saleor | 5be092eeee4ead8d697863adae8911d3c2c4e52d | [
"CC-BY-4.0"
] | null | null | null | saleor/settings.py | dkramskoj/saleor | 5be092eeee4ead8d697863adae8911d3c2c4e52d | [
"CC-BY-4.0"
] | 9 | 2021-03-19T03:41:18.000Z | 2022-03-12T00:43:39.000Z | saleor/settings.py | dkramskoj/saleor | 5be092eeee4ead8d697863adae8911d3c2c4e52d | [
"CC-BY-4.0"
] | null | null | null | import ast
import os.path
import warnings
from datetime import timedelta
import dj_database_url
import dj_email_url
import django_cache_url
import jaeger_client
import jaeger_client.config
import sentry_sdk
from django.core.exceptions import ImproperlyConfigured
from django.core.management.utils import get_random_secr... | 32.470483 | 88 | 0.694011 |
794dff7685669e943e66ddf0620e18ff1da0b59b | 11,690 | py | Python | src_v2/interactive_conditional_samples.py | praise2112/gpt-2-tensorflow2.0 | c3e09c8c8e96eaa74b94efa4cb1acf796a2b0cea | [
"MIT"
] | null | null | null | src_v2/interactive_conditional_samples.py | praise2112/gpt-2-tensorflow2.0 | c3e09c8c8e96eaa74b94efa4cb1acf796a2b0cea | [
"MIT"
] | null | null | null | src_v2/interactive_conditional_samples.py | praise2112/gpt-2-tensorflow2.0 | c3e09c8c8e96eaa74b94efa4cb1acf796a2b0cea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fire
import json
import os
import numpy as np
import tensorflow as tf
import model, sample, encoder
# config = tf.compat.v1.ConfigProto(gpu_options =
# tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.8)
# device_count = {'GPU': 1}
# )
# config.gpu_opti... | 37.588424 | 325 | 0.668777 |
794dff8c4c338198d147eeac82d26fc10a35fad8 | 776 | py | Python | CNN/SVM.py | Hsveh/CS420_final_hw | 5798ca227889ae47b91e189368f04a1fbe6ebb0d | [
"Apache-2.0"
] | 1 | 2020-06-22T00:53:41.000Z | 2020-06-22T00:53:41.000Z | CNN/SVM.py | Hsveh/CS420_final_hw | 5798ca227889ae47b91e189368f04a1fbe6ebb0d | [
"Apache-2.0"
] | null | null | null | CNN/SVM.py | Hsveh/CS420_final_hw | 5798ca227889ae47b91e189368f04a1fbe6ebb0d | [
"Apache-2.0"
] | null | null | null | """
Read data from CNN_SVM
"""
import common
import numpy as np
from sklearn.preprocessing import scale
from sklearn.svm import SVC
from sklearn.metrics import classification_report
from sklearn.metrics import accuracy_score
data = common.Data("../mnist/mnist_train/train_data.npy", "../mnist/mnist_train/mnist_train_la... | 31.04 | 102 | 0.756443 |
794dff8de7a4fbc20a1e949189b6d6bded30267e | 993 | py | Python | infobip/api/model/sms/mt/logs/SMSLogsResponse.py | bahiamartins/infobip-api-python-client | 88f044901af5690d01fcb7bce90d0ed2ab1ba4d1 | [
"Apache-2.0"
] | null | null | null | infobip/api/model/sms/mt/logs/SMSLogsResponse.py | bahiamartins/infobip-api-python-client | 88f044901af5690d01fcb7bce90d0ed2ab1ba4d1 | [
"Apache-2.0"
] | null | null | null | infobip/api/model/sms/mt/logs/SMSLogsResponse.py | bahiamartins/infobip-api-python-client | 88f044901af5690d01fcb7bce90d0ed2ab1ba4d1 | [
"Apache-2.0"
] | 1 | 2020-04-08T19:03:26.000Z | 2020-04-08T19:03:26.000Z | # -*- coding: utf-8 -*-
"""This is a generated class and is not intended for modification!
TODO: Point to Github contribution instructions
"""
from datetime import datetime
from infobip.util.models import DefaultObject, serializable
from infobip.api.model.sms.mt.logs.SMSLog import SMSLog
class SMSLogsResponse(Defaul... | 25.461538 | 66 | 0.660624 |
794dffda37d2356af1f7b3ae85ab383eb9710fdf | 399 | py | Python | article/admin.py | Atom1c/home | 98a00724119a8ba75a917b8e3b7b3cbc9594ad3b | [
"Unlicense"
] | null | null | null | article/admin.py | Atom1c/home | 98a00724119a8ba75a917b8e3b7b3cbc9594ad3b | [
"Unlicense"
] | null | null | null | article/admin.py | Atom1c/home | 98a00724119a8ba75a917b8e3b7b3cbc9594ad3b | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from article.models import Article, Comments
# Register your models here.
class ArticleInline(admin.StackedInline):
model = Comments
extra = 2
class ArticleAdmin(admin.ModelAdmin):
fields = ['article_title', 'article_text', 'article_date']
inlines = [ArticleInline]
... | 22.166667 | 62 | 0.744361 |
794e00045e262644cb4c85020015b0eaa39f5619 | 22,284 | py | Python | ppdet/engine/tracker.py | ghostxsl/PaddleDetection | e62c687486c0881759ffd49b736afb5ccaa3d717 | [
"Apache-2.0"
] | null | null | null | ppdet/engine/tracker.py | ghostxsl/PaddleDetection | e62c687486c0881759ffd49b736afb5ccaa3d717 | [
"Apache-2.0"
] | null | null | null | ppdet/engine/tracker.py | ghostxsl/PaddleDetection | e62c687486c0881759ffd49b736afb5ccaa3d717 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 41.343228 | 100 | 0.530381 |
794e011b18dda1256d202660548a01b3cf161f27 | 3,293 | py | Python | src/pytti/rotoscoper.py | pytti-tools/pytti-core | ec001ad08d2eda4ba3dbc110f800b44c5f5072d6 | [
"MIT"
] | 35 | 2022-01-27T22:00:51.000Z | 2022-03-30T23:18:07.000Z | src/pytti/rotoscoper.py | pytti-tools/pytti-core | ec001ad08d2eda4ba3dbc110f800b44c5f5072d6 | [
"MIT"
] | 83 | 2022-01-26T21:04:41.000Z | 2022-03-31T02:12:54.000Z | src/pytti/rotoscoper.py | pytti-tools/pytti-core | ec001ad08d2eda4ba3dbc110f800b44c5f5072d6 | [
"MIT"
] | 13 | 2022-01-27T22:00:53.000Z | 2022-03-31T12:41:26.000Z | import imageio, subprocess
from os.path import exists as path_exists
from loguru import logger
from PIL import Image
class RotoscopingOrchestrator:
def __init__(self):
self.rotoscopers = []
def add(self, other):
self.rotoscopers.append(other)
def clear_rotoscopers(self):
self.ro... | 32.284314 | 127 | 0.61403 |
794e01f6cb50ce2e2f6e2459f5ca67cb7be137a0 | 1,990 | py | Python | main.py | vmedina1014/flask-todo | 4844182366a2efd5a623689ce31223c6e27247dc | [
"bzip2-1.0.6"
] | null | null | null | main.py | vmedina1014/flask-todo | 4844182366a2efd5a623689ce31223c6e27247dc | [
"bzip2-1.0.6"
] | null | null | null | main.py | vmedina1014/flask-todo | 4844182366a2efd5a623689ce31223c6e27247dc | [
"bzip2-1.0.6"
] | null | null | null | from datetime import datetime
import os
from flask import Flask, render_template, request, redirect, url_for, session
from passlib.hash import pbkdf2_sha256
from model import Task, User
app = Flask(__name__)
app.secret_key = b'\x9d\xb1u\x08%\xe0\xd0p\x9bEL\xf8JC\xa3\xf4J(hAh\xa4\xcdw\x12S*,u\xec\xb8\xb8'
a... | 32.096774 | 101 | 0.635678 |
794e02502732278ba761164e8089ccfa3b681577 | 7,361 | py | Python | apps/filebrowser/src/filebrowser/lib/archives.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | apps/filebrowser/src/filebrowser/lib/archives.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 4 | 2021-03-11T04:02:00.000Z | 2022-03-27T08:31:56.000Z | apps/filebrowser/src/filebrowser/lib/archives.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 30.799163 | 110 | 0.675452 |
794e02a9abb8bfa43732422f20b7e7e3ffdaefeb | 10,950 | py | Python | bambinocampones/src/bambinocampones/website/migrations/0002_auto__add_field_galeria_foi_importante.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | bambinocampones/src/bambinocampones/website/migrations/0002_auto__add_field_galeria_foi_importante.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | 1 | 2015-11-08T11:49:35.000Z | 2015-11-08T11:49:43.000Z | bambinocampones/src/bambinocampones/website/migrations/0002_auto__add_field_galeria_foi_importante.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Galeria.foi_importante'
db.add_column(u'websit... | 69.303797 | 172 | 0.541918 |
794e03aee17866a752e9abc32ac7dbbfd3b4962e | 26,232 | py | Python | src/sagemaker/automl/automl.py | aws-patlin/sagemaker-python-sdk | 18af12beffed82aaf263e9cfec8832f39b6bc63f | [
"Apache-2.0"
] | null | null | null | src/sagemaker/automl/automl.py | aws-patlin/sagemaker-python-sdk | 18af12beffed82aaf263e9cfec8832f39b6bc63f | [
"Apache-2.0"
] | null | null | null | src/sagemaker/automl/automl.py | aws-patlin/sagemaker-python-sdk | 18af12beffed82aaf263e9cfec8832f39b6bc63f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 42.515397 | 100 | 0.64063 |
794e047086377a4da70f76d706112f93faaaf873 | 1,006 | py | Python | metodi/zeri/bisezione.py | alemazzo/metodi_numerici | 0d7d02aa392dde51abe1a4ee8ac5412f8f27736a | [
"MIT"
] | 9 | 2021-07-08T10:55:58.000Z | 2021-12-03T09:56:37.000Z | metodi/zeri/bisezione.py | alemazzo/metodi_numerici | 0d7d02aa392dde51abe1a4ee8ac5412f8f27736a | [
"MIT"
] | null | null | null | metodi/zeri/bisezione.py | alemazzo/metodi_numerici | 0d7d02aa392dde51abe1a4ee8ac5412f8f27736a | [
"MIT"
] | null | null | null | import math
import numpy as np
def bisezione(f, a, b, tol):
"""
Algoritmo di Bisezione per il calcolo dello zero di una funzione.
:param f: la funzione di cui calcolare lo zero
:param a: il valore minimo dell'intervallo
:param b: il valore massimo dell'intervallo
:param tol: la tollerenza
... | 26.473684 | 90 | 0.55169 |
794e04f1f75888cc2ddd1dbfe357cb76ba29c591 | 696 | py | Python | labfunctions/security/utils.py | dymaxionlabs/nb_workflows | 336e4d83dd5f8a7edfbaacfa426b23a42c0a68a9 | [
"Apache-2.0"
] | 4 | 2022-02-17T19:47:52.000Z | 2022-02-17T20:11:06.000Z | labfunctions/security/utils.py | dymaxionlabs/nb_workflows | 336e4d83dd5f8a7edfbaacfa426b23a42c0a68a9 | [
"Apache-2.0"
] | 2 | 2022-03-26T00:07:05.000Z | 2022-03-30T21:20:00.000Z | labfunctions/security/utils.py | dymaxionlabs/nb_workflows | 336e4d83dd5f8a7edfbaacfa426b23a42c0a68a9 | [
"Apache-2.0"
] | 1 | 2022-02-18T13:33:00.000Z | 2022-02-18T13:33:00.000Z | import binascii
import importlib
import os
from datetime import datetime, timedelta
from labfunctions.types.security import KeyPairs
def open_keys(pub, priv) -> KeyPairs:
with open(pub, "r") as f:
pub = f.read()
pub = pub.strip()
with open(priv, "r") as f:
priv = f.read()
priv... | 25.777778 | 76 | 0.666667 |
794e0507326723f09ca15ca16f6803cf81ead02f | 115 | py | Python | bigquery/job/ems_job_state.py | emartech/ems-gcp-toolkit | 74da9af2e5af262ef10613b5a91b8841fb3c2691 | [
"MIT"
] | 1 | 2020-02-14T18:08:58.000Z | 2020-02-14T18:08:58.000Z | bigquery/job/ems_job_state.py | emartech/ems-gcp-toolkit | 74da9af2e5af262ef10613b5a91b8841fb3c2691 | [
"MIT"
] | null | null | null | bigquery/job/ems_job_state.py | emartech/ems-gcp-toolkit | 74da9af2e5af262ef10613b5a91b8841fb3c2691 | [
"MIT"
] | 1 | 2022-02-17T19:50:17.000Z | 2022-02-17T19:50:17.000Z | from enum import Enum
class EmsJobState(Enum):
PENDING = "PENDING"
RUNNING = "RUNNING"
DONE = "DONE"
| 14.375 | 24 | 0.643478 |
794e05e2dc9c494da9d6695a9ad1c551f30b6e8d | 11,370 | py | Python | tensorflow/contrib/keras/python/keras/applications/resnet50.py | ralic/tensorflow | 1209491913def44650d6457c60a6e41d56de3306 | [
"Apache-2.0"
] | 1 | 2017-09-05T02:22:07.000Z | 2017-09-05T02:22:07.000Z | tensorflow/contrib/keras/python/keras/applications/resnet50.py | ralic/tensorflow | 1209491913def44650d6457c60a6e41d56de3306 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/keras/python/keras/applications/resnet50.py | ralic/tensorflow | 1209491913def44650d6457c60a6e41d56de3306 | [
"Apache-2.0"
] | 1 | 2021-01-25T14:18:12.000Z | 2021-01-25T14:18:12.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.616725 | 148 | 0.681882 |
794e06c837be402cc9540e19c72cee08296ceda1 | 1,284 | py | Python | features/steps/block.py | netsyno/python-docx | f181a89f1c1651baba6a37399e6bba09769459ae | [
"MIT"
] | 3 | 2015-04-12T11:18:40.000Z | 2021-04-28T09:17:38.000Z | features/steps/block.py | netsyno/python-docx | f181a89f1c1651baba6a37399e6bba09769459ae | [
"MIT"
] | null | null | null | features/steps/block.py | netsyno/python-docx | f181a89f1c1651baba6a37399e6bba09769459ae | [
"MIT"
] | 2 | 2016-02-28T03:20:32.000Z | 2019-10-05T12:01:28.000Z | # encoding: utf-8
"""
Step implementations for block content containers
"""
from behave import given, then, when
from docx import Document
from docx.table import Table
from helpers import test_docx
# given ===================================================
@given('a document containing a table')
def given_a_doc... | 23.345455 | 60 | 0.646417 |
794e06e153f378c5d0228164d6396c6c2fa38c9d | 1,550 | py | Python | patterns/exas.py | stspbu/code-change-miner | a9aceb92a3484f0c3c8140bbb986bfec1e2d7562 | [
"Apache-2.0"
] | 1 | 2020-09-06T16:32:17.000Z | 2020-09-06T16:32:17.000Z | patterns/exas.py | neomatrix369/code-change-miner | 4fe24d03c8512202bc80a77bf1ebee456d8400d7 | [
"Apache-2.0"
] | null | null | null | patterns/exas.py | neomatrix369/code-change-miner | 4fe24d03c8512202bc80a77bf1ebee456d8400d7 | [
"Apache-2.0"
] | null | null | null | from pyflowgraph.models import LinkType
import sys
HALF_N = sys.maxsize // 2
N = HALF_N * 2
def normalize(value):
return (value + HALF_N) % N - HALF_N
class ExasFeature:
"""
Features characterize code fragments
Read more: "Accurate and Efficient Structural Characteristic Feature Extraction"
""... | 27.192982 | 90 | 0.592258 |
794e075cdcbbb2b8a7a7a6a591352a9bdc0687fb | 48,416 | py | Python | sympy/physics/tests/test_secondquant.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/tests/test_secondquant.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | sympy/physics/tests/test_secondquant.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | from sympy.physics.secondquant import (
Dagger, Bd, VarBosonicBasis, BBra, B, BKet, FixedBosonicBasis,
matrix_rep, apply_operators, InnerProduct, Commutator, KroneckerDelta,
AnnihilateBoson, CreateBoson, BosonicOperator,
F, Fd, FKet, BosonState, CreateFermion, AnnihilateFermion,
evaluate_deltas, Ant... | 37.736555 | 111 | 0.559319 |
794e083870b7f3ce7ca36dfdc022c176f3d4d05d | 1,424 | py | Python | main2.py | rivinduchamath/Open_CV-IM | 4082d24de659d672d9f90a6a3a2dbd942d183781 | [
"MIT"
] | null | null | null | main2.py | rivinduchamath/Open_CV-IM | 4082d24de659d672d9f90a6a3a2dbd942d183781 | [
"MIT"
] | 1 | 2022-03-24T07:07:25.000Z | 2022-03-24T07:07:25.000Z | main2.py | rivinduchamath/Python_Open_CV | 4082d24de659d672d9f90a6a3a2dbd942d183781 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
# Image negative
img = cv2.imread('"C:/Users/wogza/Downloads/New folder (2)/A/rectangle.png"', 0)
m, n = img.shape
# To find the maximum grey level
# value in the image
L = img.max()
# Maximum grey level value minus
# the original image gives the
# negative image
img_neg = L - img
# c... | 21.575758 | 89 | 0.650281 |
794e08731eb41ea2ae1268ed0382c9cf0d06977f | 3,908 | py | Python | multiagent/scenarios/simple_spread_v2.py | beipeng/multiagent-particle-envs | 68d605ee3d649e1b1d6d8564ab1ff89cb1ad68d6 | [
"MIT"
] | null | null | null | multiagent/scenarios/simple_spread_v2.py | beipeng/multiagent-particle-envs | 68d605ee3d649e1b1d6d8564ab1ff89cb1ad68d6 | [
"MIT"
] | null | null | null | multiagent/scenarios/simple_spread_v2.py | beipeng/multiagent-particle-envs | 68d605ee3d649e1b1d6d8564ab1ff89cb1ad68d6 | [
"MIT"
] | 1 | 2019-07-23T08:44:49.000Z | 2019-07-23T08:44:49.000Z | import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.scenario import BaseScenario
class Scenario(BaseScenario):
def make_world(self):
world = World()
# set any world properties first
world.dim_c = 2
num_agents = 4
num_landmarks = 4
w... | 38.693069 | 104 | 0.587001 |
794e08d77d7616a1cc0ab5b2c04fa46cca659450 | 37 | py | Python | hyperpoints/ppo/__init__.py | yngtodd/hyperpoints | 7e444fa547db55114314bd481373b5f4a5dbca71 | [
"MIT"
] | 1 | 2020-05-11T00:53:53.000Z | 2020-05-11T00:53:53.000Z | hyperpoints/ppo/__init__.py | yngtodd/hyperpoints | 7e444fa547db55114314bd481373b5f4a5dbca71 | [
"MIT"
] | null | null | null | hyperpoints/ppo/__init__.py | yngtodd/hyperpoints | 7e444fa547db55114314bd481373b5f4a5dbca71 | [
"MIT"
] | null | null | null | from .objective import ppo_objective
| 18.5 | 36 | 0.864865 |
794e09060340ca9169c3390375d652995d9ebf9a | 68,971 | py | Python | numba/parfors/parfor_lowering.py | amosbird/numba | f9f4c88c3e5967c3316f9298ac21f795d3f40b96 | [
"BSD-2-Clause"
] | null | null | null | numba/parfors/parfor_lowering.py | amosbird/numba | f9f4c88c3e5967c3316f9298ac21f795d3f40b96 | [
"BSD-2-Clause"
] | null | null | null | numba/parfors/parfor_lowering.py | amosbird/numba | f9f4c88c3e5967c3316f9298ac21f795d3f40b96 | [
"BSD-2-Clause"
] | null | null | null | import ast
import copy
from collections import OrderedDict
import linecache
import os
import sys
import operator
import numpy as np
import types as pytypes
import operator
import warnings
import llvmlite.llvmpy.core as lc
import llvmlite.ir.values as liv
import numba
from numba.parfors import parfor
from numba.core ... | 43.597345 | 309 | 0.594583 |
794e090caa2cab0073b8095b13a811d3eb13d036 | 1,418 | py | Python | examples/plot-layer-types.py | lukasz-migas/napari-1d | b0f081a8711ae941b3e4b5c58c3aea56bd0e3277 | [
"BSD-3-Clause"
] | 13 | 2021-08-27T23:01:09.000Z | 2022-03-22T13:51:35.000Z | examples/plot-layer-types.py | lukasz-migas/napari-1d | b0f081a8711ae941b3e4b5c58c3aea56bd0e3277 | [
"BSD-3-Clause"
] | 71 | 2021-08-28T13:29:17.000Z | 2022-03-28T21:22:12.000Z | examples/plot-layer-types.py | lukasz-migas/napari-1d | b0f081a8711ae941b3e4b5c58c3aea56bd0e3277 | [
"BSD-3-Clause"
] | null | null | null | """Display image and 1d plot."""
import numpy as np
import napari_plot
N_POINTS = 1000
N_MIN = 0
N_MAX = 300
def add_line():
"""Line plot"""
x = np.arange(N_POINTS)
y = np.random.randint(N_MIN, N_MAX, N_POINTS)
viewer1d.add_line(np.c_[x, y], name="Line", visible=True)
def add_centroids():
"""C... | 22.507937 | 110 | 0.609309 |
794e0a2e88ffb415c67a84465a0d63dbb175f543 | 32,375 | py | Python | aragwas_server/gwasdb/elastic.py | grimmlab/AraGWAS | 447db9bff377085a65aea05c0f09545e9405cc6c | [
"MIT"
] | 1 | 2020-04-07T12:46:17.000Z | 2020-04-07T12:46:17.000Z | aragwas_server/gwasdb/elastic.py | grimmlab/AraGWAS | 447db9bff377085a65aea05c0f09545e9405cc6c | [
"MIT"
] | null | null | null | aragwas_server/gwasdb/elastic.py | grimmlab/AraGWAS | 447db9bff377085a65aea05c0f09545e9405cc6c | [
"MIT"
] | null | null | null | from elasticsearch import Elasticsearch, helpers
from elasticsearch_dsl import Search, Q, A
from aragwas.settings import ES_HOST
from gwasdb import serializers
from .parsers import parse_snpeff, parse_lastel
import logging
import json
import os
import numpy as np
import re
import operator
import datetime
from collect... | 47.962963 | 267 | 0.639598 |
794e0b0904bd622ca3d3d71fd2a337d01502688a | 2,115 | py | Python | mixbox/dates.py | 6un9-h0-Dan/mixbox | cbdfc6afab6a9bcb8306686d2c4c34ac496c9271 | [
"BSD-3-Clause"
] | 8 | 2015-02-24T21:44:45.000Z | 2020-09-23T14:18:14.000Z | mixbox/dates.py | 6un9-h0-Dan/mixbox | cbdfc6afab6a9bcb8306686d2c4c34ac496c9271 | [
"BSD-3-Clause"
] | 43 | 2015-02-21T00:37:48.000Z | 2022-03-31T12:35:09.000Z | mixbox/dates.py | 6un9-h0-Dan/mixbox | cbdfc6afab6a9bcb8306686d2c4c34ac496c9271 | [
"BSD-3-Clause"
] | 15 | 2015-07-31T20:26:49.000Z | 2021-07-23T17:01:48.000Z | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
# stdlib
import datetime
# external
import dateutil
import dateutil.parser
import dateutil.tz
def parse_datetime(value):
"""Attempts to parse `value` into an instance of ``datetime.datetime``. If
`value` ... | 24.310345 | 78 | 0.645863 |
794e0b7d9f38f9748d9838e9e67ec21c3bfd6373 | 8,499 | py | Python | scripts/emod3d_scripts/check_emod3d_subdomains.py | ucgmsim/slurm_gm_workflow | 6fd7e11f3c3163dbd219b6783c32fa8085db5d35 | [
"MIT"
] | null | null | null | scripts/emod3d_scripts/check_emod3d_subdomains.py | ucgmsim/slurm_gm_workflow | 6fd7e11f3c3163dbd219b6783c32fa8085db5d35 | [
"MIT"
] | 114 | 2018-10-11T02:49:32.000Z | 2022-03-30T01:28:21.000Z | scripts/emod3d_scripts/check_emod3d_subdomains.py | ucgmsim/slurm_gm_workflow | 6fd7e11f3c3163dbd219b6783c32fa8085db5d35 | [
"MIT"
] | 2 | 2021-10-05T07:10:20.000Z | 2022-03-16T23:26:51.000Z | """
Contains functions related to the calculation of emod3d subdomain boundaries.
Functions ported from C contain a number of calls to np.int32 and np.float32 calls to emulate single precision integer and floating point behaviour.
Code ported from emod3d v3.0.8 misc.c. This is consistent with v3.0.7.
While v3.0.4 uses... | 39.714953 | 148 | 0.661019 |
794e0b91c7d4e89e92ab1c32d213aca185c2f386 | 142 | py | Python | zeus/api/schemas/token.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | zeus/api/schemas/token.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | zeus/api/schemas/token.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | from marshmallow import Schema, fields
class TokenSchema(Schema):
id = fields.UUID(dump_only=True)
key = fields.Str(dump_only=True)
| 20.285714 | 38 | 0.739437 |
794e0bcfa8aa7f3ba98a1ffab018817125a89e55 | 4,494 | py | Python | built-in/ACL_TensorFlow/Official/cv/YOLOv2_for_ACL/scripts/yolov2_postprocess/script/Main.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/ACL_TensorFlow/Official/cv/YOLOv2_for_ACL/scripts/yolov2_postprocess/script/Main.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/ACL_TensorFlow/Official/cv/YOLOv2_for_ACL/scripts/yolov2_postprocess/script/Main.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # Copyright 2021 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 agree... | 56.886076 | 222 | 0.650868 |
794e0c3c779d4934b68b718e8aafb84432f2eea0 | 485 | py | Python | get_target_ip.py | indigo-dc/dodas-docker-img_sshtunnel | 29326c7673b47079a776d78fe03be628391f13d6 | [
"Apache-2.0"
] | 2 | 2018-07-17T14:53:35.000Z | 2018-07-19T09:53:36.000Z | get_target_ip.py | DODAS-TS/docker-img_sshtunnel | 29326c7673b47079a776d78fe03be628391f13d6 | [
"Apache-2.0"
] | null | null | null | get_target_ip.py | DODAS-TS/docker-img_sshtunnel | 29326c7673b47079a776d78fe03be628391f13d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
from sys import argv, exit
def get_target_host(string):
"""Print and return the first address of the target.
Example:
"10.10.42.197 10.10.42.203 10.10.42.204" -> "10.10.42.197"
"10.10.42.203" -> "10.10.42.203"... | 22.045455 | 66 | 0.606186 |
794e0ce7e1db1d3f9bd3a40ed9d3e49242ebb873 | 7,788 | py | Python | src/pallas/proxies.py | tomasbedrich/pallas | cd414f0ed0c4b5a39da21061b08f9e7a5b674c8b | [
"Apache-2.0"
] | null | null | null | src/pallas/proxies.py | tomasbedrich/pallas | cd414f0ed0c4b5a39da21061b08f9e7a5b674c8b | [
"Apache-2.0"
] | null | null | null | src/pallas/proxies.py | tomasbedrich/pallas | cd414f0ed0c4b5a39da21061b08f9e7a5b674c8b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Akamai Technologies, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.561644 | 85 | 0.673986 |
794e0d28a1303bad42132ea0116c960a95b98724 | 1,964 | py | Python | patrole_tempest_plugin/tests/api/compute/test_config_drive_rbac.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | patrole_tempest_plugin/tests/api/compute/test_config_drive_rbac.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | patrole_tempest_plugin/tests/api/compute/test_config_drive_rbac.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 AT&T Corporation.
# 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 r... | 40.081633 | 78 | 0.717923 |
794e0d4504b8b81638ca4fffa8f5630e42bc53a9 | 5,042 | py | Python | python/hostconfig/machines/alberto.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-04-05T12:11:54.000Z | 2020-04-05T12:11:54.000Z | python/hostconfig/machines/alberto.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/hostconfig/machines/alberto.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-05T14:26:13.000Z | 2021-03-09T08:18:17.000Z | # Configuration
"""Copyright (c) 2005-2019, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source ... | 37.909774 | 101 | 0.692781 |
794e0d6859301cd169654a327d1cf6f080803eaf | 1,029 | py | Python | pointnet2/models/pvd/modules/functional/backend.py | ZhaoyangLyu/Point_Diffusion_Refinement | 857fcd176dcc9c1a93a9fec27390502fa6c9e29d | [
"Apache-2.0"
] | 24 | 2021-12-29T11:28:34.000Z | 2022-03-27T15:20:46.000Z | pointnet2/models/pvd/modules/functional/backend.py | ZhaoyangLyu/Point_Diffusion_Refinement | 857fcd176dcc9c1a93a9fec27390502fa6c9e29d | [
"Apache-2.0"
] | 1 | 2021-11-03T08:53:26.000Z | 2021-11-03T08:53:26.000Z | modules/functional/backend.py | alexzhou907/PVD | 9747265a5f141e5546fd4f862bfa66aa59f1bd33 | [
"MIT"
] | 4 | 2021-11-02T02:17:29.000Z | 2022-03-20T11:58:29.000Z | import os
from torch.utils.cpp_extension import load
_src_path = os.path.dirname(os.path.abspath(__file__))
_backend = load(name='_pvcnn_backend',
extra_cflags=['-O3', '-std=c++17'],
extra_cuda_cflags=['--compiler-bindir=/usr/bin/gcc-8'],
sources=[os.path.join(_src_path... | 38.111111 | 71 | 0.504373 |
794e0dc338ab6f223907301e4ce95b9d1befda6c | 821 | py | Python | gui/helpers.py | tfrere/music-to-led-server | 55f64269ce012833508d574ad29e42b0486884f0 | [
"MIT"
] | 1 | 2021-05-12T23:52:02.000Z | 2021-05-12T23:52:02.000Z | gui/helpers.py | tfrere/music-to-led-server | 55f64269ce012833508d574ad29e42b0486884f0 | [
"MIT"
] | null | null | null | gui/helpers.py | tfrere/music-to-led-server | 55f64269ce012833508d574ad29e42b0486884f0 | [
"MIT"
] | null | null | null | import os, psutil, math
def clearTerminal():
os.system('cls' if os.name == 'nt' else 'clear')
def rgbToAnsi256(r, g, b):
if (r == g and g == b):
if (r < 8):
return 16
if (r > 248):
return 231
return round(((r - 8) / 247) * 24) + 232
ansi = 16 + (36 * round(r... | 24.878788 | 89 | 0.504263 |
794e0e04efc61201f27f5cb5188839358329d0d1 | 2,979 | py | Python | tools/dummymaker/dummymaker/__main__.py | yamanalab/SecureSideEffectSearch | e223ad0f8cc5b5097af5a6da841f128e4783bd26 | [
"Apache-2.0"
] | null | null | null | tools/dummymaker/dummymaker/__main__.py | yamanalab/SecureSideEffectSearch | e223ad0f8cc5b5097af5a6da841f128e4783bd26 | [
"Apache-2.0"
] | 3 | 2021-11-02T11:56:25.000Z | 2021-11-03T10:06:39.000Z | tools/dummymaker/dummymaker/__main__.py | yamanalab/SecureSideEffectSearch | e223ad0f8cc5b5097af5a6da841f128e4783bd26 | [
"Apache-2.0"
] | null | null | null | from dummymaker import config
from dummymaker import population_stats
import json
import csv
from datetime import datetime
import numpy as np
class DummyMaker(object):
def __init__(self):
self.config = config.Config()
self.popstats = population_stats.PopulationStats()
def _run_impl(self):
... | 39.72 | 133 | 0.461564 |
794e0faae7afe5e5491f6f0f3f25d4508817db69 | 81,116 | py | Python | django/db/models/query.py | louiseGrandjonc/django | 54ea290e5bbd19d87bd8dba807738eeeaf01a362 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-22T07:10:33.000Z | 2019-11-22T07:10:33.000Z | django/db/models/query.py | louiseGrandjonc/django | 54ea290e5bbd19d87bd8dba807738eeeaf01a362 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/query.py | louiseGrandjonc/django | 54ea290e5bbd19d87bd8dba807738eeeaf01a362 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-09T18:53:01.000Z | 2019-11-09T18:53:01.000Z | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import operator
import warnings
from collections import namedtuple
from functools import lru_cache
from itertools import chain
from django.conf import settings
from django.core import exceptions
from django.db import (
... | 42.182007 | 119 | 0.616044 |
794e0fe4ec5e7f4a6bedb1c91c1b82416ea0e764 | 7,556 | py | Python | sdk/python/pulumi_azure_nextgen/relay/latest/hybrid_connection.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/relay/latest/hybrid_connection.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/relay/latest/hybrid_connection.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 46.641975 | 318 | 0.669534 |
794e1012d346d21f58a1eb5c10a60d2220a5451e | 1,990 | py | Python | grow/performance/profile.py | akashkalal/grow | e4813efecb270e00c52c4bb1cb317766a8c92e29 | [
"MIT"
] | 335 | 2016-04-02T20:12:21.000Z | 2022-03-28T18:55:26.000Z | grow/performance/profile.py | kmcnellis/grow | 4787f5a01681ef0800e9b4388a56cdbc48209368 | [
"MIT"
] | 784 | 2016-04-01T16:56:41.000Z | 2022-03-05T01:25:34.000Z | grow/performance/profile.py | kmcnellis/grow | 4787f5a01681ef0800e9b4388a56cdbc48209368 | [
"MIT"
] | 54 | 2016-05-03T13:06:15.000Z | 2021-09-24T04:46:23.000Z | """Code timing for profiling."""
import time
class Timer(object):
"""Times code to see how long it takes using a context manager."""
def __init__(self, key, label=None, meta=None):
self._time = time
self.key = key
self.label = label or key
self.meta = meta
self.start ... | 23.975904 | 83 | 0.541709 |
794e106bbee42cb5c23641ec7958bcfcb073fbec | 6,808 | py | Python | kolter_wong/models.py | anonymous2398384/provable_robustness_max_linear_regions | 529165d9047261813bc068997415f668c9675119 | [
"BSD-3-Clause"
] | 34 | 2019-03-10T22:16:24.000Z | 2021-09-23T22:22:27.000Z | kolter_wong/models.py | anonymous2398384/provable_robustness_max_linear_regions | 529165d9047261813bc068997415f668c9675119 | [
"BSD-3-Clause"
] | 2 | 2019-09-24T16:18:55.000Z | 2021-03-06T20:57:33.000Z | kolter_wong/models.py | anonymous2398384/provable_robustness_max_linear_regions | 529165d9047261813bc068997415f668c9675119 | [
"BSD-3-Clause"
] | 9 | 2019-03-13T17:35:36.000Z | 2021-01-15T02:37:23.000Z | import numpy as np
import scipy.io
import torch
import torch.nn as nn
import math
import data
from kolter_wong.convex_adversarial import Dense, DenseSequential
from kolter_wong.custom_layers import Conv2dUntiedBias
def select_model(model_type, n_in, n_out):
h_in, w_in, c_in = (28, 28, 1) if n_in == 28*28*1 else... | 32.113208 | 95 | 0.555964 |
794e11a8f09ccd2a2bf95ae23a2c5231bb528c72 | 4,391 | py | Python | src/modules/Permissions/Permissions.py | dfirestorm/Discord-Robot | 5ad6bdf7a9704d73794b688127172a7ed69919f5 | [
"MIT"
] | null | null | null | src/modules/Permissions/Permissions.py | dfirestorm/Discord-Robot | 5ad6bdf7a9704d73794b688127172a7ed69919f5 | [
"MIT"
] | null | null | null | src/modules/Permissions/Permissions.py | dfirestorm/Discord-Robot | 5ad6bdf7a9704d73794b688127172a7ed69919f5 | [
"MIT"
] | 1 | 2020-09-27T00:24:32.000Z | 2020-09-27T00:24:32.000Z | import sqlite3
import discord
from discord.ext import commands
from discord.ext.commands.errors import *
DB = 'permissions.db'
class Permissions(commands.Cog):
def __init__(self, client):
client.permission_authority = self
self.client = client
self.cwd = client.config['Bot']['modules_dir'... | 47.215054 | 132 | 0.64154 |
794e11d52cfee297752c20bb5d126d4c954e18e5 | 2,446 | py | Python | api/views/explanation_views.py | tiveritz/how-tos-api | 5dd73fd72ea1f07123ce8d15d2935d9d9e473c8e | [
"MIT"
] | null | null | null | api/views/explanation_views.py | tiveritz/how-tos-api | 5dd73fd72ea1f07123ce8d15d2935d9d9e473c8e | [
"MIT"
] | 3 | 2021-05-23T07:57:15.000Z | 2021-05-28T05:38:17.000Z | api/views/explanation_views.py | tiveritz/how-tos-api | 5dd73fd72ea1f07123ce8d15d2935d9d9e473c8e | [
"MIT"
] | null | null | null | from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from ..models import Explanation
from ..serializers.explanation_serializers import (ExplanationSerializer,
ExplanationDetailSerializer)
class Expla... | 40.766667 | 79 | 0.575634 |
794e1273e3b7622199661f7a5ca2ead5c125bbe5 | 1,168 | py | Python | lib/galaxy/model/migrate/versions/0113_update_migrate_tools_table.py | innovate-invent/galaxy | 10aa953a40e171246bdd1804c74e8019da8e8200 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | lib/galaxy/model/migrate/versions/0113_update_migrate_tools_table.py | innovate-invent/galaxy | 10aa953a40e171246bdd1804c74e8019da8e8200 | [
"CC-BY-3.0"
] | 30 | 2016-10-20T15:35:12.000Z | 2018-10-02T15:59:54.000Z | lib/galaxy/model/migrate/versions/0113_update_migrate_tools_table.py | innovate-invent/galaxy | 10aa953a40e171246bdd1804c74e8019da8e8200 | [
"CC-BY-3.0"
] | 7 | 2016-11-03T19:11:01.000Z | 2020-05-11T14:23:52.000Z | """
Migration script to update the migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate.
"""
from __future__ import print_function
import logging
import sys
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
forma... | 34.352941 | 144 | 0.760274 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.