hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c094079c9c6b163067951cca25388c45cda78e53 | 584 | py | Python | Part_2/ch09_FileOprt/9_8_delBigFile.py | hyperpc/AutoStuffWithPython | e05f5e0acb5818d634e4ab84d640848cd4ae7e70 | [
"MIT"
] | null | null | null | Part_2/ch09_FileOprt/9_8_delBigFile.py | hyperpc/AutoStuffWithPython | e05f5e0acb5818d634e4ab84d640848cd4ae7e70 | [
"MIT"
] | null | null | null | Part_2/ch09_FileOprt/9_8_delBigFile.py | hyperpc/AutoStuffWithPython | e05f5e0acb5818d634e4ab84d640848cd4ae7e70 | [
"MIT"
] | null | null | null |
import os, re
def delBigFile(src):
filelist = os.listdir(src)
zipfileRegex = re.compile('^(.*)+\.(zip)$')
for filename in filelist:
srcfilepath = os.path.join(src, filename)
if os.path.isdir(srcfilepath):
delBigFile(srcfilepath)
else:
#zipMatches = zipfileRe... | 32.444444 | 69 | 0.583904 |
0423b7e42c10604e645a202c26ff5817c3f0f76c | 1,370 | py | Python | awacs/states.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | awacs/states.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | awacs/states.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'AWS Step Functions'
prefix = 'states'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Act... | 31.860465 | 70 | 0.754745 |
e5c1289876bedc1492ce6b103c10866e937cdaf5 | 718 | py | Python | setup.py | jolespin/genopype | 68c8fa044a85bc9b22d219bdc2d2a88a22be11c0 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | setup.py | jolespin/genopype | 68c8fa044a85bc9b22d219bdc2d2a88a22be11c0 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | setup.py | jolespin/genopype | 68c8fa044a85bc9b22d219bdc2d2a88a22be11c0 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
# Version
version = None
with open("./genopype/__init__.py", "r") as f:
for line in f.readlines():
line = line.strip()
if line.startswith("__version__"):
version = line.split("=")[-1].strip().strip('"')
assert version is not None, "Check version in genopype/... | 27.615385 | 67 | 0.623955 |
7e2a061f8a0a2de677ae7a2da347e7019074bd08 | 1,578 | py | Python | func/user.py | liaojason2/foodmeow | aa48976d5c830034a327910144f36a7eb69ff86a | [
"MIT"
] | null | null | null | func/user.py | liaojason2/foodmeow | aa48976d5c830034a327910144f36a7eb69ff86a | [
"MIT"
] | null | null | null | func/user.py | liaojason2/foodmeow | aa48976d5c830034a327910144f36a7eb69ff86a | [
"MIT"
] | null | null | null | import os
from datetime import datetime
from dotenv import load_dotenv
from pymongo import MongoClient
#from bson.objectid import ObjectId
load_dotenv()
conn = MongoClient(os.getenv("MONGODB_CONNECTION"))
db = conn.foodmeow
users = db.users
def checkUserExist(profile):
userId = profile.user_id
displayName = p... | 20.493506 | 51 | 0.555133 |
3d259e0bc9510b0a86e1282821b3db3953210ed5 | 4,967 | py | Python | letterboxed.py | pmclaugh/LetterBoxedNYT | fc8f10a7bc18484e4aa4a3112204b1f4354c7090 | [
"MIT"
] | null | null | null | letterboxed.py | pmclaugh/LetterBoxedNYT | fc8f10a7bc18484e4aa4a3112204b1f4354c7090 | [
"MIT"
] | null | null | null | letterboxed.py | pmclaugh/LetterBoxedNYT | fc8f10a7bc18484e4aa4a3112204b1f4354c7090 | [
"MIT"
] | null | null | null | import argparse
from typing import List, Set, Union
from collections import defaultdict
from utils import timed
class WordTrieNode:
def __init__(self, value: str, parent: Union['WordTrieNode', None]):
self.value = value
self.parent = parent
self.children = {}
self.valid = ... | 43.191304 | 128 | 0.625126 |
88c496fa0694124229299841dd0e2edff066988a | 3,766 | py | Python | src/features/drought/build_features.py | IPL-UV/gauss4eo | 8aa5c6faa6ff2a43d8c026383cc51643b97601e4 | [
"MIT"
] | 1 | 2021-03-07T00:30:41.000Z | 2021-03-07T00:30:41.000Z | src/features/drought/build_features.py | IPL-UV/gauss4eo | 8aa5c6faa6ff2a43d8c026383cc51643b97601e4 | [
"MIT"
] | null | null | null | src/features/drought/build_features.py | IPL-UV/gauss4eo | 8aa5c6faa6ff2a43d8c026383cc51643b97601e4 | [
"MIT"
] | null | null | null | import sys, os
sys.path.insert(0, "/home/emmanuel/code/py_esdc")
from functools import reduce
from esdc.shape import ShapeFileExtract, rasterize
from esdc.preprocessing import calculate_monthly_mean
from esdc.transform import DensityCubes
import xarray as xr
import pandas as pd
import shapely
from typing import Uni... | 27.093525 | 86 | 0.714551 |
f9dd64afa958f47933ed01f28422bc1b87614d2b | 2,197 | py | Python | health/views/incident.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | health/views/incident.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | health/views/incident.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | from django.utils.translation import gettext_lazy as _
from rusel.base.views import BaseListView, BaseDetailView
from health.forms.incident import CreateForm, EditForm
from task.const import ROLE_INCIDENT, ROLE_APP
from task.models import Task, Urls
from health.config import app_config
from rusel.categories import get_... | 30.09589 | 109 | 0.615385 |
b1dd44df4b8716f96285694fe4286b10cef28553 | 6,351 | py | Python | _django/queries_restfw.py | zzzeek/imdbench | 4f95aa769e90bfbada84ecfe8a9478d895260b44 | [
"Apache-2.0"
] | 50 | 2022-03-23T00:34:34.000Z | 2022-03-31T01:50:09.000Z | _django/queries_restfw.py | zzzeek/imdbench | 4f95aa769e90bfbada84ecfe8a9478d895260b44 | [
"Apache-2.0"
] | 11 | 2022-03-23T18:18:18.000Z | 2022-03-30T21:50:03.000Z | _django/queries_restfw.py | zzzeek/imdbench | 4f95aa769e90bfbada84ecfe8a9478d895260b44 | [
"Apache-2.0"
] | 5 | 2022-03-25T17:10:20.000Z | 2022-03-28T18:24:02.000Z | #
# Copyright (c) 2019 MagicStack Inc.
# All rights reserved.
#
# See LICENSE for details.
##
from django.db import connection
from django.test.client import RequestFactory
import json
import random
from . import bootstrap # NoQA
from . import models
from . import views
rf = RequestFactory()
DUMMY_REQUEST = rf.g... | 29.539535 | 72 | 0.577074 |
7d6bdc79bbc74a91b96d7e15f9241a2229264de0 | 3,338 | py | Python | ploter.py | beneduzi/PlotNC | 738adf4ba3bf7adc2dab8446aee532968d1c0c05 | [
"Apache-2.0"
] | 1 | 2018-08-09T16:23:35.000Z | 2018-08-09T16:23:35.000Z | ploter.py | beneduzi/PlotNC | 738adf4ba3bf7adc2dab8446aee532968d1c0c05 | [
"Apache-2.0"
] | null | null | null | ploter.py | beneduzi/PlotNC | 738adf4ba3bf7adc2dab8446aee532968d1c0c05 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from netCDF4 import Dataset
import argparse
# import numpy as np
import yaml
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
def gen_map_plot(right_c, left_c, file_name, data, scat_lat=0, scat_lon=0):
"""
Efectivile creates the plot,
lat [-90, 90]
l... | 33.717172 | 170 | 0.597963 |
208ff1fa58fffd4c60294d8bcac0318e20b1c51d | 79 | py | Python | Chapter 11/ch11_1_34.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 11/ch11_1_34.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 11/ch11_1_34.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | t1=tuple((1,"Gold",2,"Silver"))
print(1 in t1)
# True
# please note (()) | 13.166667 | 32 | 0.544304 |
bc05ae43b5bb08be9b25ffc82fffa7c2d4cc3223 | 785 | py | Python | tests/__init__.py | magfest/residue | d8621d8a9c43c19b67f0ee532655aaeaaae4ca62 | [
"BSD-3-Clause"
] | 1 | 2018-02-26T19:03:19.000Z | 2018-02-26T19:03:19.000Z | tests/__init__.py | magfest/residue | d8621d8a9c43c19b67f0ee532655aaeaaae4ca62 | [
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | magfest/residue | d8621d8a9c43c19b67f0ee532655aaeaaae4ca62 | [
"BSD-3-Clause"
] | 2 | 2018-02-05T19:49:30.000Z | 2018-02-24T18:10:30.000Z | import sqlalchemy
from sqlalchemy import event
from sqlalchemy.orm import sessionmaker
def patch_session(Session, request):
orig_engine, orig_factory = Session.engine, Session.session_factory
request.addfinalizer(lambda: setattr(Session, 'engine', orig_engine))
request.addfinalizer(lambda: setattr(Session... | 46.176471 | 104 | 0.735032 |
8ca48a5e7514f8895b073476d0a8e17ff4f87c9c | 2,923 | py | Python | micropython/main.py | fabrizziop/SmartCurrent | d53bb89348e7aa22d4d6351291d6b7339bf542c6 | [
"MIT"
] | null | null | null | micropython/main.py | fabrizziop/SmartCurrent | d53bb89348e7aa22d4d6351291d6b7339bf542c6 | [
"MIT"
] | null | null | null | micropython/main.py | fabrizziop/SmartCurrent | d53bb89348e7aa22d4d6351291d6b7339bf542c6 | [
"MIT"
] | null | null | null | import time
import usocket
from machine import Pin, ADC
from utime import sleep, ticks_ms
from nodemcu_gpio_lcd import GpioLcd
CALIB_CONST_MUL = 0.08076
LIST_MAX_LENGTH = 60
IP_RECEIVER = "YOUR_SERVER_IP"
PORT_RECEIVER = 8000
IOT_RECEIVER = usocket.getaddrinfo(IP_RECEIVER, PORT_RECEIVER)[0][-1]
PROGRAM_NAME = "SMARTCU... | 25.867257 | 132 | 0.716387 |
618480b11ce37f579f09e445fac82f4fe889c6d1 | 27,997 | py | Python | bitfinex/websockets/client.py | aitorSTL/bitfinex | b34ba109500d33ffebe0ff488f93435ecb49e758 | [
"MIT"
] | 5 | 2020-12-09T22:22:08.000Z | 2020-12-13T17:18:28.000Z | bitfinex/websockets/client.py | aitorSTL/bitfinex | b34ba109500d33ffebe0ff488f93435ecb49e758 | [
"MIT"
] | null | null | null | bitfinex/websockets/client.py | aitorSTL/bitfinex | b34ba109500d33ffebe0ff488f93435ecb49e758 | [
"MIT"
] | null | null | null | # coding=utf-8
import threading
import json
import hmac
import hashlib
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet.error impor... | 30.79978 | 109 | 0.559739 |
449c5d92a23196d1c889009d4a75e14ad286d965 | 33,233 | py | Python | venv/Lib/site-packages/scipy/interpolate/_cubic.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 6 | 2019-12-21T21:15:54.000Z | 2021-04-20T17:35:24.000Z | venv/Lib/site-packages/scipy/interpolate/_cubic.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/Lib/site-packages/scipy/interpolate/_cubic.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 3 | 2021-01-31T16:40:52.000Z | 2021-08-29T18:32:34.000Z | """Interpolation algorithms using piecewise cubic polynomials."""
import numpy as np
from . import PPoly
from .polyint import _isscalar
from scipy.linalg import solve_banded, solve
__all__ = ["CubicHermiteSpline", "PchipInterpolator", "pchip_interpolate",
"Akima1DInterpolator", "CubicSpline"]
def prepa... | 38.823598 | 117 | 0.553817 |
f3786afadb53b75434e4fc87831d95eb8d5bee09 | 1,195 | py | Python | AndBug/lib/andbug/errors.py | msayagh/ExecutedAndroidByteCode | 111aa9738f217aaa7c963792219344438b7aefb0 | [
"W3C"
] | null | null | null | AndBug/lib/andbug/errors.py | msayagh/ExecutedAndroidByteCode | 111aa9738f217aaa7c963792219344438b7aefb0 | [
"W3C"
] | null | null | null | AndBug/lib/andbug/errors.py | msayagh/ExecutedAndroidByteCode | 111aa9738f217aaa7c963792219344438b7aefb0 | [
"W3C"
] | null | null | null | ## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
## published by the Free Software Foundation.
##
## AndBug is distributed in the hope that it will be useful, but W... | 30.641026 | 77 | 0.734728 |
2ced0214282ba23443c71277b2ff649347069258 | 4,855 | py | Python | docs/conf.py | vcutrona/elasticpedia | fcb23008a6fedaaa25c876a58b0365e9b273e147 | [
"Apache-2.0"
] | 3 | 2020-03-31T15:57:21.000Z | 2020-04-02T16:09:23.000Z | docs/conf.py | vcutrona/elasticpedia | fcb23008a6fedaaa25c876a58b0365e9b273e147 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | vcutrona/elasticpedia | fcb23008a6fedaaa25c876a58b0365e9b273e147 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# elasticpedia documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# 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.
#
... | 29.785276 | 77 | 0.68898 |
026711b8624dfa58715060d83c268cef2cff296d | 2,848 | py | Python | tests/cli/test_debug.py | dnimtheory/WordOps | 82fc71f5f563df0e4249cc178f768f6cf6c005f6 | [
"MIT"
] | 2 | 2019-09-03T03:39:40.000Z | 2021-04-22T12:09:50.000Z | tests/cli/test_debug.py | BreezeRo/WordOps | 3c5cb8ba0ed8d619cddb170386a07102cb385727 | [
"MIT"
] | null | null | null | tests/cli/test_debug.py | BreezeRo/WordOps | 3c5cb8ba0ed8d619cddb170386a07102cb385727 | [
"MIT"
] | 2 | 2021-01-02T07:49:51.000Z | 2022-03-26T15:58:50.000Z | from wo.utils import test
from wo.cli.main import get_test_app
class CliTestCaseDebug(test.WOTestCase):
def test_wo_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_wo_cli_debug_stop(self):
self.app = get_test_app(argv=['debug', '--stop'])
self.app... | 29.666667 | 76 | 0.580407 |
c7fe4d59939d44399c28cb012ae9e78dc888d648 | 2,656 | py | Python | src/openprocurement/tender/competitivedialogue/procedure/views/stage2/bid.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 10 | 2020-02-18T01:56:21.000Z | 2022-03-28T00:32:57.000Z | src/openprocurement/tender/competitivedialogue/procedure/views/stage2/bid.py | quintagroup/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 26 | 2018-07-16T09:30:44.000Z | 2021-02-02T17:51:30.000Z | src/openprocurement/tender/competitivedialogue/procedure/views/stage2/bid.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 15 | 2019-08-08T10:50:47.000Z | 2022-02-05T14:13:36.000Z | from openprocurement.tender.openeu.procedure.views.bid import TenderBidResource as BaseResourceEU
from openprocurement.tender.openua.procedure.views.bid import TenderBidResource as BaseResourceUA
from openprocurement.tender.competitivedialogue.constants import STAGE_2_UA_TYPE, STAGE_2_EU_TYPE
from openprocurement.tende... | 37.408451 | 103 | 0.752636 |
04e3808516792ff017c8da2f7469b166d652c4c8 | 241 | py | Python | bookmarks/actions/admin.py | xaldey/bookmarks | e2cbed38a06f343b2d61ab7eac08388200efcb04 | [
"Apache-2.0"
] | null | null | null | bookmarks/actions/admin.py | xaldey/bookmarks | e2cbed38a06f343b2d61ab7eac08388200efcb04 | [
"Apache-2.0"
] | null | null | null | bookmarks/actions/admin.py | xaldey/bookmarks | e2cbed38a06f343b2d61ab7eac08388200efcb04 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Action
@admin.register(Action)
class ActionAdmin(admin.ModelAdmin):
list_display = ('user', 'verb', 'target', 'created')
list_filter = ('created',)
search_filter = ('verb',)
| 24.1 | 56 | 0.697095 |
ddc16e101fec45504b2ce3013ba78cce5777b92c | 21,052 | py | Python | netbox/netbox/settings.py | msrt500/netbox | 7bd853e87b51470c50663dedfc07b29774f2707b | [
"Apache-2.0"
] | 1 | 2021-03-29T18:17:16.000Z | 2021-03-29T18:17:16.000Z | netbox/netbox/settings.py | msrt500/netbox | 7bd853e87b51470c50663dedfc07b29774f2707b | [
"Apache-2.0"
] | null | null | null | netbox/netbox/settings.py | msrt500/netbox | 7bd853e87b51470c50663dedfc07b29774f2707b | [
"Apache-2.0"
] | null | null | null | import importlib
import logging
import os
import platform
import re
import socket
import warnings
from urllib.parse import urlsplit
from django.contrib.messages import constants as messages
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.validators import URLValidator
#
# En... | 33.257504 | 123 | 0.713519 |
a38e555ac59d765cc49fba71ec0acb813da6a558 | 5,917 | py | Python | apps/node_man/periodic_tasks/sync_proc_status_task.py | ZhuoZhuoCrayon/bk-nodeman | 76cb71fcc971c2a0c2be161fcbd6b019d4a7a8ab | [
"MIT"
] | null | null | null | apps/node_man/periodic_tasks/sync_proc_status_task.py | ZhuoZhuoCrayon/bk-nodeman | 76cb71fcc971c2a0c2be161fcbd6b019d4a7a8ab | [
"MIT"
] | null | null | null | apps/node_man/periodic_tasks/sync_proc_status_task.py | ZhuoZhuoCrayon/bk-nodeman | 76cb71fcc971c2a0c2be161fcbd6b019d4a7a8ab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 42.568345 | 118 | 0.676694 |
f6f20feb9d6b3c2f2fe81c84e8c7f2b522e7d047 | 615 | py | Python | pyCHAMP/solver/dmc.py | NLESC-JCER/pyCHAMP | 97523237b3521a426d664b6e2972257045ff8f5e | [
"Apache-2.0"
] | 4 | 2019-05-15T13:09:23.000Z | 2021-03-28T09:10:11.000Z | pyCHAMP/solver/dmc.py | NLESC-JCER/pyCHAMP | 97523237b3521a426d664b6e2972257045ff8f5e | [
"Apache-2.0"
] | 14 | 2019-04-23T15:05:07.000Z | 2019-08-14T13:21:07.000Z | pyCHAMP/solver/dmc.py | NLESC-JCER/pyCHAMP | 97523237b3521a426d664b6e2972257045ff8f5e | [
"Apache-2.0"
] | 1 | 2019-09-30T22:55:53.000Z | 2019-09-30T22:55:53.000Z | from functools import partial
from pyCHAMP.solver.solver_base import SolverBase
class DMC(SolverBase):
def __init__(self, wf=None, sampler=None, optimizer=None):
SolverBase.__init__(self, wf, sampler, optimizer)
def sample(self, param):
wf_func = partial(self.wf.values, param)
self.... | 26.73913 | 62 | 0.692683 |
04ef5071c3157fd04b305942eeee5ca567e780e1 | 7,976 | py | Python | ohapi/utils_fs.py | mcescalante/open-humans-api | e2438d6c04c4e8776b5402ed2807136b84ae94c1 | [
"MIT"
] | null | null | null | ohapi/utils_fs.py | mcescalante/open-humans-api | e2438d6c04c4e8776b5402ed2807136b84ae94c1 | [
"MIT"
] | null | null | null | ohapi/utils_fs.py | mcescalante/open-humans-api | e2438d6c04c4e8776b5402ed2807136b84ae94c1 | [
"MIT"
] | null | null | null | """
Utility functions to sync and work with Open Humans data in a local filesystem.
"""
import csv
import hashlib
import logging
import os
import re
import arrow
from humanfriendly import format_size, parse_size
import requests
MAX_FILE_DEFAULT = parse_size('128m')
def strip_zip_suffix(filename):
if filename.e... | 34.829694 | 79 | 0.547768 |
6c98d555b3b627321b1cb428ef01752bcfb01e2a | 8,282 | py | Python | apps/paddlefold/alphafold_paddle/model/model.py | kanz76/PaddleHelix | f31c98db1f6d396f1ed1e51ae427028dcf3b0ae9 | [
"Apache-2.0"
] | 1 | 2022-02-14T13:13:32.000Z | 2022-02-14T13:13:32.000Z | apps/paddlefold/alphafold_paddle/model/model.py | chupvl/PaddleHelix | 6e082f89b8090c3c360593d40a08bffc884165dd | [
"Apache-2.0"
] | null | null | null | apps/paddlefold/alphafold_paddle/model/model.py | chupvl/PaddleHelix | 6e082f89b8090c3c360593d40a08bffc884165dd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 ... | 35.393162 | 80 | 0.618933 |
2f5a80b60ebf4a90edaff3abbc55a92283da9ed7 | 1,556 | py | Python | setup.py | jsandovalc/django-cities-light | a1c6af08938b7b01d4e12555bd4cb5040905603d | [
"MIT"
] | null | null | null | setup.py | jsandovalc/django-cities-light | a1c6af08938b7b01d4e12555bd4cb5040905603d | [
"MIT"
] | null | null | null | setup.py | jsandovalc/django-cities-light | a1c6af08938b7b01d4e12555bd4cb5040905603d | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import shutil
import sys
import os
import os.path
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
d... | 32.416667 | 86 | 0.654242 |
0b36a23da3938dd6a58c332d22bc21433cd520a7 | 2,949 | py | Python | hardware/max7219.py | gcurtis79/letsrobot | 0cb5fae07392ee3661036d138d8986c9705bcf0c | [
"Apache-2.0"
] | 26 | 2018-09-27T17:27:30.000Z | 2022-03-04T20:37:18.000Z | hardware/max7219.py | gcurtis79/letsrobot | 0cb5fae07392ee3661036d138d8986c9705bcf0c | [
"Apache-2.0"
] | 30 | 2018-10-15T03:54:58.000Z | 2020-05-28T06:57:08.000Z | hardware/max7219.py | gcurtis79/letsrobot | 0cb5fae07392ee3661036d138d8986c9705bcf0c | [
"Apache-2.0"
] | 16 | 2018-10-04T03:16:43.000Z | 2021-04-25T06:59:49.000Z | import spidev
columns = [0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8]
LEDOn = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
LEDOff = [0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]
LEDEmoteSmile = [0x0,0x0,0x24,0x0,0x42,0x3C,0x0,0x0]
LEDEmoteSad = [0x0,0x0,0x24,0x0,0x0,0x3C,0x42,0x0]
LEDEmoteTongue = [0x0,0x0,0x24,0x0,0x42,0x3C,0xC,0x0]
LEDEmoteS... | 25.205128 | 57 | 0.617158 |
c22ac0006075217af5838e8cf251c06a472a6201 | 725 | py | Python | tests/test_html.py | joshuadavidthomas/django_coverage_plugin | c4ec0691906dc0923c494efc9c9236d3aa21be73 | [
"Apache-2.0"
] | 172 | 2015-01-03T20:26:42.000Z | 2022-02-18T20:38:59.000Z | tests/test_html.py | joshuadavidthomas/django_coverage_plugin | c4ec0691906dc0923c494efc9c9236d3aa21be73 | [
"Apache-2.0"
] | 71 | 2015-01-17T19:22:53.000Z | 2022-02-03T09:09:35.000Z | tests/test_html.py | BillSchumacher/django_coverage_plugin | 597f07d60fffe05b9062b6c41afa722a4b32f3ba | [
"Apache-2.0"
] | 31 | 2015-01-18T14:32:46.000Z | 2022-02-18T20:39:07.000Z | # coding: utf8
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt
"""Tests of HTML reporting for django_coverage_plugin."""
import glob
from .plugin_test import DjangoPluginTestCase
class HtmlTest(Dj... | 29 | 86 | 0.670345 |
8067806a8d4ad5056d84ffb99227c093f713e824 | 394 | py | Python | send.py | chhantyal/http_recv | fed31fe1a1f8f31d9e117fa00c9d303bfbcb752e | [
"BSD-3-Clause"
] | null | null | null | send.py | chhantyal/http_recv | fed31fe1a1f8f31d9e117fa00c9d303bfbcb752e | [
"BSD-3-Clause"
] | null | null | null | send.py | chhantyal/http_recv | fed31fe1a1f8f31d9e117fa00c9d303bfbcb752e | [
"BSD-3-Clause"
] | null | null | null | import logging
from logging.handlers import HTTPHandler
logger = logging.getLogger(__name__)
server = 'https://log-recv.herokuapp.com:80'
http_handler = HTTPHandler(server, '/', method='POST')
logger.addHandler(http_handler)
logger.setLevel(logging.DEBUG)
if __name__ == "__main__":
logger.debug("Debug messag... | 21.888889 | 57 | 0.741117 |
c4c0de2f46112431a484ca1a04012527bb955b2e | 20,072 | py | Python | txweb2/http.py | grobza/ccs-calendarserver | d26ff131bc46057893dc3abbd3830a6dc0a73738 | [
"Apache-2.0"
] | null | null | null | txweb2/http.py | grobza/ccs-calendarserver | d26ff131bc46057893dc3abbd3830a6dc0a73738 | [
"Apache-2.0"
] | null | null | null | txweb2/http.py | grobza/ccs-calendarserver | d26ff131bc46057893dc3abbd3830a6dc0a73738 | [
"Apache-2.0"
] | null | null | null | # -*- test-case-name: txweb2.test.test_http -*-
##
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# Copyright (c) 2010-2017 Apple Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to ... | 36.56102 | 233 | 0.658679 |
81f3b46c52400f8adb6305d405b548f8b6820602 | 84 | py | Python | tests/snippets/weakrefs.py | EdwardSam4/RustPython | 7ec6a7ffd1afbfe71322cbace161483b6877d4a5 | [
"MIT"
] | 1 | 2021-03-08T02:19:16.000Z | 2021-03-08T02:19:16.000Z | tests/snippets/weakrefs.py | EdwardSam4/RustPython | 7ec6a7ffd1afbfe71322cbace161483b6877d4a5 | [
"MIT"
] | null | null | null | tests/snippets/weakrefs.py | EdwardSam4/RustPython | 7ec6a7ffd1afbfe71322cbace161483b6877d4a5 | [
"MIT"
] | 1 | 2020-12-04T23:52:08.000Z | 2020-12-04T23:52:08.000Z | from _weakref import ref
class X:
pass
a = X()
b = ref(a)
assert b() is a
| 6.461538 | 24 | 0.571429 |
12f36671506cd9f5fdbc26026fd5da48899163e0 | 216 | py | Python | get_last_handle.py | sara-nl/surfsara-handle-client-cpp | 511441fa42b6924dd8c1e0c287ac6adc167621be | [
"Apache-2.0"
] | null | null | null | get_last_handle.py | sara-nl/surfsara-handle-client-cpp | 511441fa42b6924dd8c1e0c287ac6adc167621be | [
"Apache-2.0"
] | 2 | 2019-02-23T21:07:37.000Z | 2019-02-23T21:29:50.000Z | get_last_handle.py | sara-nl/surfsara-handle-client-cpp | 511441fa42b6924dd8c1e0c287ac6adc167621be | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os.path
import json
if os.path.isfile('last_handle.json'):
with open('last_handle.json') as f:
data = json.load(f)
print(str(data.get('handle')))
else:
print("")
| 19.636364 | 39 | 0.625 |
25e198105d8453ed29889266e4213eda12ddd209 | 4,606 | py | Python | prediction_server/prediction_server_pb2_grpc.py | TheFebrin/thesis-normals-estimation | 43c2b9f902b93ec8eace610bb386d190a58eb4e3 | [
"MIT"
] | null | null | null | prediction_server/prediction_server_pb2_grpc.py | TheFebrin/thesis-normals-estimation | 43c2b9f902b93ec8eace610bb386d190a58eb4e3 | [
"MIT"
] | null | null | null | prediction_server/prediction_server_pb2_grpc.py | TheFebrin/thesis-normals-estimation | 43c2b9f902b93ec8eace610bb386d190a58eb4e3 | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import prediction_server_pb2 as prediction__server__pb2
class PredictionServerStub(object):
"""option java_multiple_files = true;
option java_package =... | 37.145161 | 101 | 0.673469 |
d874732d6fa0068f99de1babbacae1e129a6c2cb | 14,127 | py | Python | python/tvm/relay/backend/compile_engine.py | maxtnuk/incubator-tvm | 050a836b18c419213f34b8ac76afced425d9d70e | [
"Apache-2.0"
] | 2 | 2019-11-13T01:17:41.000Z | 2020-05-15T19:06:52.000Z | python/tvm/relay/backend/compile_engine.py | maxtnuk/incubator-tvm | 050a836b18c419213f34b8ac76afced425d9d70e | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/backend/compile_engine.py | maxtnuk/incubator-tvm | 050a836b18c419213f34b8ac76afced425d9d70e | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.397163 | 94 | 0.632264 |
d377504b22923445bde9f82d3bdb735f7d6df86e | 2,218 | py | Python | kibra/tlv.py | KiraleTech/KiBRA | 08bcba625edbb491d4b325e138c69d45b17aca02 | [
"MIT"
] | 11 | 2018-03-06T17:20:41.000Z | 2021-05-16T16:57:53.000Z | kibra/tlv.py | KiraleTech/KiBRA | 08bcba625edbb491d4b325e138c69d45b17aca02 | [
"MIT"
] | 7 | 2019-06-28T02:27:47.000Z | 2020-04-29T16:13:16.000Z | kibra/tlv.py | KiraleTech/KiBRA | 08bcba625edbb491d4b325e138c69d45b17aca02 | [
"MIT"
] | 3 | 2018-12-27T09:46:18.000Z | 2020-09-28T02:48:41.000Z | class ThreadTLV:
'''Thread TLV representation'''
def __init__(self, data=None, t=None, l=None, v=None):
if isinstance(data, str):
self.data = bytearray.fromhex(data)
elif isinstance(data, bytes):
self.data = bytearray(data)
elif isinstance(data, bytearray):
... | 30.383562 | 77 | 0.533814 |
15920af2b04f06447b8b6fd02959a5f37baa856d | 2,845 | py | Python | scene/scene_gen_procedural/scene_gen_procedural.py | unhyperbolic/Blender-3D-Python-Scripts | cea6467fa5629e7461b5eb3cd408aed3526ce811 | [
"MIT"
] | null | null | null | scene/scene_gen_procedural/scene_gen_procedural.py | unhyperbolic/Blender-3D-Python-Scripts | cea6467fa5629e7461b5eb3cd408aed3526ce811 | [
"MIT"
] | null | null | null | scene/scene_gen_procedural/scene_gen_procedural.py | unhyperbolic/Blender-3D-Python-Scripts | cea6467fa5629e7461b5eb3cd408aed3526ce811 | [
"MIT"
] | 1 | 2021-03-21T01:22:13.000Z | 2021-03-21T01:22:13.000Z | import bpy
from mathutils import Vector
##### Clean-up results from an earlier run of the script
# Delete previously created collection if present
collectionName = 'MyCollection'
if collectionName in bpy.data.collections:
bpy.data.collections.remove(bpy.data.collections[collectionName])
# Helper code. Is this p... | 31.611111 | 72 | 0.68225 |
ce5196ffe991aa1108bc833cc6fd02bf11f9f6e7 | 625 | py | Python | src/leetcode/1986/sol_2.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 1 | 2021-07-11T03:20:10.000Z | 2021-07-11T03:20:10.000Z | src/leetcode/1986/sol_2.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 39 | 2021-07-10T05:21:09.000Z | 2021-12-15T06:10:12.000Z | src/leetcode/1986/sol_2.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | null | null | null | import typing
import functools
class Solution:
def minSessions(
self,
a: typing.List[int],
t0: int,
) -> int:
inf = 1 << 10
n = len(a)
@functools.lru_cache(maxsize=None)
def dfs(
s: int,
) -> typing.Tuple[int, int]:
if s == 0: return (0, 0)
res = (inf, 0)
... | 17.361111 | 38 | 0.4112 |
e6c076ad81943e058978be5e2f0a2e7f95742aea | 565 | py | Python | src/utils.py | nashant/topology-spread-constraints-mutator | 99a4f4047f3b113c91f2bf2e17fd6b4b9fe150eb | [
"MIT"
] | null | null | null | src/utils.py | nashant/topology-spread-constraints-mutator | 99a4f4047f3b113c91f2bf2e17fd6b4b9fe150eb | [
"MIT"
] | null | null | null | src/utils.py | nashant/topology-spread-constraints-mutator | 99a4f4047f3b113c91f2bf2e17fd6b4b9fe150eb | [
"MIT"
] | null | null | null | from OpenSSL.crypto import load_certificate, FILETYPE_PEM, X509Store, X509StoreContext, X509StoreContextError
def verify_chain():
with open("/app/certs/ca.crt") as f:
root_cert = load_certificate(FILETYPE_PEM, f.read())
with open("/app/certs/tls.crt") as f:
tls_cert = load_certificate(FILETYP... | 29.736842 | 109 | 0.700885 |
077e99053c0b687a8017412f7c5dc7bad540f1b3 | 3,049 | py | Python | tests/parser/kernel_test.py | fifth-postulate/nand-optimizer | 936d278411a073b8a7b860a47c9032e310736ba2 | [
"MIT"
] | null | null | null | tests/parser/kernel_test.py | fifth-postulate/nand-optimizer | 936d278411a073b8a7b860a47c9032e310736ba2 | [
"MIT"
] | null | null | null | tests/parser/kernel_test.py | fifth-postulate/nand-optimizer | 936d278411a073b8a7b860a47c9032e310736ba2 | [
"MIT"
] | null | null | null | from parser.kernel import Any, Avoid, Chain, Filter, Map, Predicate, Producing, Sequence, Success, Word, atleast, many, optionally
def assert_unique_parse(parses, expected_result, expected_rest):
assert len(parses) == 1
(result, rest) = parses[0]
assert result == expected_result
assert rest == expected... | 21.935252 | 130 | 0.601181 |
062437270ae0b0f813f2b82182b4cfb57c3714db | 14,436 | py | Python | utils.py | MarvinTheParanoid/EmailSum | 0f5bfa25d0a9029edd6c39a85fbc91f96bf471ac | [
"MIT"
] | 28 | 2021-08-02T01:23:43.000Z | 2022-02-22T06:17:41.000Z | utils.py | MarvinTheParanoid/EmailSum | 0f5bfa25d0a9029edd6c39a85fbc91f96bf471ac | [
"MIT"
] | null | null | null | utils.py | MarvinTheParanoid/EmailSum | 0f5bfa25d0a9029edd6c39a85fbc91f96bf471ac | [
"MIT"
] | 2 | 2021-08-02T04:27:51.000Z | 2021-12-01T22:49:12.000Z | import math
import numpy as np
import torch
from torch.utils.data import Sampler
from torch.optim.lr_scheduler import LambdaLR
from typing import Optional
class SortishSampler(Sampler):
"Go through the text data by order of src length with a bit of randomness. From fastai repo."
def __init__(self, data, batc... | 43.481928 | 119 | 0.62829 |
69ef1403156fa89463dd910fbcb088cf211b4dea | 14,903 | py | Python | corporate/views.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | null | null | null | corporate/views.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | null | null | null | corporate/views.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | null | null | null | import logging
from decimal import Decimal
from typing import Any, Dict, Optional, Union
from urllib.parse import urlencode, urljoin, urlunsplit
import stripe
from django.conf import settings
from django.core import signing
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
from django.shortcuts i... | 37.824873 | 100 | 0.689995 |
427ce8d9421098a24df79b3e1633cdf5a433169f | 11,918 | py | Python | electrum_dash/gui/kivy/uix/dialogs/password_dialog.py | abuhabban/electrum-dash | 36a0c9596919a6d9b64e99bcd72a18674353ce43 | [
"MIT"
] | 1 | 2021-03-19T05:25:15.000Z | 2021-03-19T05:25:15.000Z | electrum_dash/gui/kivy/uix/dialogs/password_dialog.py | abuhabban/electrum-dash | 36a0c9596919a6d9b64e99bcd72a18674353ce43 | [
"MIT"
] | null | null | null | electrum_dash/gui/kivy/uix/dialogs/password_dialog.py | abuhabban/electrum-dash | 36a0c9596919a6d9b64e99bcd72a18674353ce43 | [
"MIT"
] | null | null | null | from typing import Callable, TYPE_CHECKING, Optional, Union
import os
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.clock import Clock
from electrum_dash.util import InvalidPassword
from electrum... | 32.652055 | 112 | 0.554288 |
af4e7c76b3ddb758a4d3d369b09db57163099e91 | 141 | py | Python | src/main/resources/docs/tests/E1121.py | h314to/codacy-pylint | 9d31567db6188e1b31ce0e1567998f64946502df | [
"Apache-2.0"
] | null | null | null | src/main/resources/docs/tests/E1121.py | h314to/codacy-pylint | 9d31567db6188e1b31ce0e1567998f64946502df | [
"Apache-2.0"
] | null | null | null | src/main/resources/docs/tests/E1121.py | h314to/codacy-pylint | 9d31567db6188e1b31ce0e1567998f64946502df | [
"Apache-2.0"
] | null | null | null | ##Patterns: E1121
def my_method(arg1, arg2):
print arg1 + arg2
def main():
##Err: E1121
my_method(1, 3, 4)
my_method(1, 3)
| 14.1 | 26 | 0.595745 |
eadb4ebe9bc113b67e9e8df8e3449dd345ab118d | 351 | py | Python | mysite/chat/views.py | MJohnson159/CINS465-F18-Examples | c5fb0d6bdd0937e21e31ed1dbcfe3b6dd44e43c8 | [
"MIT"
] | null | null | null | mysite/chat/views.py | MJohnson159/CINS465-F18-Examples | c5fb0d6bdd0937e21e31ed1dbcfe3b6dd44e43c8 | [
"MIT"
] | null | null | null | mysite/chat/views.py | MJohnson159/CINS465-F18-Examples | c5fb0d6bdd0937e21e31ed1dbcfe3b6dd44e43c8 | [
"MIT"
] | null | null | null | # chat/views.py
from django.shortcuts import render
from django.utils.safestring import mark_safe
import json
# Create your views here.
def index(request):
return render(request, 'chat/index.html', {})
def room(request, room_name):
return render(request ,'chat/room.html', {
'room_name_json': mark_safe... | 25.071429 | 58 | 0.720798 |
b6a26cda7c2b71e476c98c85b211cd375e5b0f1b | 1,047 | py | Python | {{cookiecutter.project_slug}}/djangocms-api/djangocms_api/urls.py | narfman0/zappa-examples | aeb08dd30743a5eda79bebcc66e9285d3171256e | [
"MIT"
] | 44 | 2016-12-16T04:48:23.000Z | 2021-08-17T20:08:52.000Z | {{cookiecutter.project_slug}}/djangocms-api/djangocms_api/urls.py | narfman0/zappa-examples | aeb08dd30743a5eda79bebcc66e9285d3171256e | [
"MIT"
] | 1 | 2017-03-07T23:17:02.000Z | 2017-03-08T08:07:24.000Z | {{cookiecutter.project_slug}}/djangocms-api/djangocms_api/urls.py | narfman0/zappa-examples | aeb08dd30743a5eda79bebcc66e9285d3171256e | [
"MIT"
] | 10 | 2017-07-17T17:02:09.000Z | 2020-12-13T20:02:36.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.sitemaps import CMSSitemap
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.staticfile... | 33.774194 | 74 | 0.702006 |
ad171d04bddce02ac07bc4d0d2a074145f6350a1 | 3,019 | py | Python | lct/secrets/secrets_provider.py | pathbreak/linode-cluster-toolkit | 280257436105703c9a122e7ed111a72efa79adfc | [
"MIT"
] | 11 | 2017-07-19T15:25:39.000Z | 2021-12-02T20:03:21.000Z | lct/secrets/secrets_provider.py | pathbreak/linode-cluster-toolkit | 280257436105703c9a122e7ed111a72efa79adfc | [
"MIT"
] | null | null | null | lct/secrets/secrets_provider.py | pathbreak/linode-cluster-toolkit | 280257436105703c9a122e7ed111a72efa79adfc | [
"MIT"
] | 1 | 2021-12-02T20:03:22.000Z | 2021-12-02T20:03:22.000Z | class SecretsProvider(object):
'''
Interface to be implemented by a secrets provider.
'''
def initialize(self, tk):
raise NotImplementedError('subclasses should override this')
def close(self):
raise NotImplementedError('subclasses should override this')
def get... | 29.891089 | 84 | 0.638953 |
f72fb70520827d455a85f96859c23ec6801cf6f3 | 5,184 | py | Python | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 1 | 2021-11-16T00:58:43.000Z | 2021-11-16T00:58:43.000Z | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 16 | 2021-05-17T19:24:47.000Z | 2021-12-15T13:57:34.000Z | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 1 | 2021-05-12T19:11:52.000Z | 2021-05-12T19:11:52.000Z | import json
import pytest
from ..entrypoint import (
AudiobooksEntryPoint,
EbooksEntryPoint,
EntryPoint,
EverythingEntryPoint,
MediumEntryPoint,
)
from ..external_search import Filter
from ..model import Edition, Work
from ..testing import DatabaseTest
class TestEntryPoint(DatabaseTest):
def... | 34.331126 | 82 | 0.673032 |
fe031d7387295bc55736d5930b5b3ce6b8825e73 | 2,768 | py | Python | rdr_service/lib_fhir/fhirclient_3_0_0/server_tests.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | rdr_service/lib_fhir/fhirclient_3_0_0/server_tests.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | rdr_service/lib_fhir/fhirclient_3_0_0/server_tests.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | # -*- coding: utf-8 -*-
import io
import json
import os
import shutil
import unittest
from . import models.fhirabstractbase as fabst
from . import server
class TestServer(unittest.TestCase):
def tearDown(self):
if os.path.exists('metadata'):
os.remove('metadata')
def testValidCapabili... | 36.906667 | 124 | 0.637283 |
7a0785796983332e708c1989a20811a5630348fa | 6,861 | py | Python | bindings/python/tests/mesh/test-py-graph.py | Geode-solutions/OpenGeode | e47621989e6fc152f529d4e1e7e3b9ef9e7d6ccc | [
"MIT"
] | 64 | 2019-08-02T14:31:01.000Z | 2022-03-30T07:46:50.000Z | bindings/python/tests/mesh/test-py-graph.py | Geode-solutions/OpenGeode | e47621989e6fc152f529d4e1e7e3b9ef9e7d6ccc | [
"MIT"
] | 395 | 2019-08-02T17:15:10.000Z | 2022-03-31T15:10:27.000Z | bindings/python/tests/mesh/test-py-graph.py | Geode-solutions/OpenGeode | e47621989e6fc152f529d4e1e7e3b9ef9e7d6ccc | [
"MIT"
] | 8 | 2019-08-19T21:32:15.000Z | 2022-03-06T18:41:10.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019 - 2021 Geode-solutions
#
# 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, co... | 43.700637 | 82 | 0.679201 |
a2c66597ae26ac804c1bcc98622206cffdfb3fd5 | 845 | py | Python | tests/core/types/test_proof_of_space.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | tests/core/types/test_proof_of_space.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | tests/core/types/test_proof_of_space.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | from secrets import token_bytes
from src.types.proof_of_space import ProofOfSpace # pylint: disable=E0401
from src.consensus.default_constants import DEFAULT_CONSTANTS
class TestProofOfSpace:
def test_can_create_proof(self):
"""
Tests that the change of getting a correct proof is exactly 1/targe... | 35.208333 | 102 | 0.68284 |
e2091bb0752e813f4faed788b9d729623ceba8d1 | 11,361 | py | Python | TorchRecModel/src/com/sparrowrecsys/offline/pytorch/DeepFM.py | liangzhang-lz/SparrowRecSys | 9fe1a27d3903117e6e2b5487c0689c0bd9281473 | [
"Apache-2.0"
] | 1 | 2021-01-23T07:16:10.000Z | 2021-01-23T07:16:10.000Z | TorchRecModel/src/com/sparrowrecsys/offline/pytorch/DeepFM.py | liangzhang-lz/SparrowRecSys | 9fe1a27d3903117e6e2b5487c0689c0bd9281473 | [
"Apache-2.0"
] | null | null | null | TorchRecModel/src/com/sparrowrecsys/offline/pytorch/DeepFM.py | liangzhang-lz/SparrowRecSys | 9fe1a27d3903117e6e2b5487c0689c0bd9281473 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, DataLoader
import torch.nn.functional as F
import torch.optim as optim
from sklearn.metrics import roc_auc_score
import math
import warnings
warnings.filterwarnings("ignore")
def _get_train_test_df(training... | 43.362595 | 128 | 0.641581 |
b97f77fca7d8665af467754dacf3a2879768a99c | 3,999 | py | Python | src/primaires/scripting/fonctions/joindre.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/primaires/scripting/fonctions/joindre.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/primaires/scripting/fonctions/joindre.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | 42.094737 | 146 | 0.684421 |
5fdae903927b702b5347d9dfc078e0667ec3b449 | 254 | py | Python | tests/conftest.py | datacorder/elasmanager | 5e089a85ed9d67da303e55838f338f9df34bc9bc | [
"MIT"
] | null | null | null | tests/conftest.py | datacorder/elasmanager | 5e089a85ed9d67da303e55838f338f9df34bc9bc | [
"MIT"
] | null | null | null | tests/conftest.py | datacorder/elasmanager | 5e089a85ed9d67da303e55838f338f9df34bc9bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dummy conftest.py for elasmanager.
If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
https://pytest.org/latest/plugins.html
"""
# import pytest
| 21.166667 | 60 | 0.65748 |
7590706867751a87e67fa1a2696cf75871bfe122 | 6,988 | py | Python | ioflo/base/test/test_acting.py | 0486/ioflo-python-multiversion | aecb1f5047a3207360afdb9f954834c15ebdc360 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | ioflo/base/test/test_acting.py | 0486/ioflo-python-multiversion | aecb1f5047a3207360afdb9f954834c15ebdc360 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | ioflo/base/test/test_acting.py | 0486/ioflo-python-multiversion | aecb1f5047a3207360afdb9f954834c15ebdc360 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Unit Test Template
"""
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import os
from ioflo.test import testing
from ioflo.aid.consoling import getConsole
console = getConsole()
from ioflo.base import acting
from ioflo.base import doin... | 33.118483 | 100 | 0.617344 |
77ca77a57e941d36e2df2e0c83ee30f98b3aefd9 | 13,594 | py | Python | tests/test_util.py | RossK1/exchangelib | 5550c2fbcc064943e3b4e150f74a724e0bd0a9f3 | [
"BSD-2-Clause"
] | 1,006 | 2016-07-18T16:42:55.000Z | 2022-03-31T10:43:50.000Z | tests/test_util.py | RossK1/exchangelib | 5550c2fbcc064943e3b4e150f74a724e0bd0a9f3 | [
"BSD-2-Clause"
] | 966 | 2016-05-13T18:55:43.000Z | 2022-03-31T15:24:56.000Z | tests/test_util.py | RossK1/exchangelib | 5550c2fbcc064943e3b4e150f74a724e0bd0a9f3 | [
"BSD-2-Clause"
] | 272 | 2016-04-05T02:17:10.000Z | 2022-03-24T08:15:57.000Z | import io
from itertools import chain
import logging
import requests
import requests_mock
from exchangelib.errors import RelativeRedirect, TransportError, RateLimitError, RedirectError, UnauthorizedError,\
CASError
from exchangelib.protocol import FailFast, FaultTolerance
import exchangelib.util
from exchangelib.... | 50.348148 | 119 | 0.612182 |
53131daa8982e591f9583c5f7c4ee47745ff3d1c | 1,812 | py | Python | model_compression_toolkit/core/common/network_editors/edit_network.py | reuvenperetz/model_optimization | 40de02d56750ee4cc20e693da63bc2e70b4d20e6 | [
"Apache-2.0"
] | 42 | 2021-10-31T10:17:49.000Z | 2022-03-21T08:51:46.000Z | model_compression_toolkit/core/common/network_editors/edit_network.py | reuvenperetz/model_optimization | 40de02d56750ee4cc20e693da63bc2e70b4d20e6 | [
"Apache-2.0"
] | 6 | 2021-10-31T15:06:03.000Z | 2022-03-31T10:32:53.000Z | model_compression_toolkit/core/common/network_editors/edit_network.py | reuvenperetz/model_optimization | 40de02d56750ee4cc20e693da63bc2e70b4d20e6 | [
"Apache-2.0"
] | 18 | 2021-11-01T12:16:43.000Z | 2022-03-25T16:52:37.000Z | # Copyright 2021 Sony Semiconductors Israel, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 40.266667 | 113 | 0.695916 |
e591f79c17c9db60e0aabe45337e6f856eeb220b | 531 | py | Python | server/sickbeats/orm/db_mixins.py | byronmejia/sick-beats | 22a38d38587f84e534b004c0e74dae51edfbadd1 | [
"MIT"
] | 1 | 2018-03-28T00:28:29.000Z | 2018-03-28T00:28:29.000Z | server/sickbeats/orm/db_mixins.py | byronmejia/sick-beats | 22a38d38587f84e534b004c0e74dae51edfbadd1 | [
"MIT"
] | 13 | 2017-12-27T02:54:48.000Z | 2018-07-09T23:14:41.000Z | server/sickbeats/orm/db_mixins.py | byronmejia/sick-beats | 22a38d38587f84e534b004c0e74dae51edfbadd1 | [
"MIT"
] | 4 | 2017-12-27T05:46:51.000Z | 2018-07-01T04:57:42.000Z | from passlib.hash import pbkdf2_sha512
import uuid
from sickbeats.app import db
class IDMixin(object):
id = db.Column(db.Integer, primary_key=True, autoincrement=True, nullable=False)
class HashedPasswordMixin(object):
password = db.Column(db.String, nullable=False)
salt = db.Column(db.String, nullable... | 24.136364 | 84 | 0.728814 |
f2b58ad5d7db933a5c983a5aaca7c66b68adaa66 | 1,796 | py | Python | test/chemistry/test_driver_pyquante.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 504 | 2018-12-15T16:34:03.000Z | 2022-03-26T11:24:53.000Z | test/chemistry/test_driver_pyquante.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 746 | 2018-12-16T16:44:42.000Z | 2021-07-10T16:59:43.000Z | test/chemistry/test_driver_pyquante.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 421 | 2018-12-22T14:49:00.000Z | 2022-03-04T09:47:07.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 34.538462 | 77 | 0.660913 |
326816f7d19af21ae1da60ca5eac4191e7de4032 | 1,113 | py | Python | main/models/customfieldenumgroup.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | main/models/customfieldenumgroup.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | main/models/customfieldenumgroup.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# CustomFieldEnumGroup model
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Thir... | 30.916667 | 91 | 0.571429 |
4d259a4fe94cc67a617bfe7d0e34f7166fd829b6 | 5,319 | py | Python | src/ged_pred/gp_data_processing.py | hwwang55/MolR | aaa968c23bea5ed9209e29ab0d21ca9cc04c91bf | [
"MIT"
] | 24 | 2021-09-26T00:46:18.000Z | 2022-03-28T12:12:34.000Z | src/ged_pred/gp_data_processing.py | tiger-tiger/MolR | 9c0ee2b30ae6390cef37e15cccece53274d61860 | [
"MIT"
] | null | null | null | src/ged_pred/gp_data_processing.py | tiger-tiger/MolR | 9c0ee2b30ae6390cef37e15cccece53274d61860 | [
"MIT"
] | 6 | 2021-11-16T06:13:27.000Z | 2022-02-22T12:10:17.000Z | import os
import random
import dgl
import torch
import pickle
import pysmiles
import itertools
import multiprocessing as mp
from data_processing import networkx_to_dgl
from networkx.algorithms.similarity import graph_edit_distance
random.seed(0)
class GEDPredDataset(dgl.data.DGLDataset):
def __init__(self, args)... | 35.939189 | 119 | 0.602369 |
1da74b84cc031dd042448f06d64b9b2e06a9c79c | 5,650 | py | Python | entities.py | ananlvjiao/yi_noob | 61cdb8ef31bce0bb6c8100bc35c516b06982c0be | [
"MIT"
] | null | null | null | entities.py | ananlvjiao/yi_noob | 61cdb8ef31bce0bb6c8100bc35c516b06982c0be | [
"MIT"
] | null | null | null | entities.py | ananlvjiao/yi_noob | 61cdb8ef31bce0bb6c8100bc35c516b06982c0be | [
"MIT"
] | null | null | null | from enum import Enum, unique
@unique
class Element(Enum):
Wood = 0
Fire = 1
Earth = 2
Metal = 3
Water = 4
# which elem overcome me
def ke_wo(self):
return Element((self.value-2)%5)
# which elem generate me
def sheng_wo(self):
return Element((self.value-1)%5)
#... | 27.294686 | 77 | 0.508496 |
bbf975e1b02ccb6e613da4b6f136909426d2d4a4 | 2,541 | py | Python | gem_metrics/questeval.py | ndaheim/GEM-metrics | cfa7a3223d94a7f7ef5fda1d2928e2510b0cbede | [
"MIT"
] | 30 | 2021-02-06T04:58:14.000Z | 2022-03-04T11:26:14.000Z | gem_metrics/questeval.py | ndaheim/GEM-metrics | cfa7a3223d94a7f7ef5fda1d2928e2510b0cbede | [
"MIT"
] | 70 | 2021-01-12T17:55:15.000Z | 2022-03-30T17:37:02.000Z | gem_metrics/questeval.py | ndaheim/GEM-metrics | cfa7a3223d94a7f7ef5fda1d2928e2510b0cbede | [
"MIT"
] | 14 | 2021-01-30T20:55:17.000Z | 2022-03-24T02:31:21.000Z | #!/usr/bin/env python3
from .metric import SourceAndReferencedMetric
from questeval.questeval_metric import QuestEval as QuestEvalMetric
from logzero import logger
class QuestEval(SourceAndReferencedMetric):
def __init__(self):
# Default values
self.task = "summarization"
self.language = ... | 37.367647 | 100 | 0.63046 |
4c8a3cdd4e6141dd5438669a3ede65cf45e9fc74 | 5,187 | py | Python | modules/tools/map_gen/create_traffic_light_from_event.py | BaiduXLab/apollo | 2764e934b6d0da1342be781447348288ac84c5e9 | [
"Apache-2.0"
] | 22 | 2018-10-10T14:46:32.000Z | 2022-02-28T12:43:43.000Z | modules/tools/map_gen/create_traffic_light_from_event.py | BaiduXLab/apollo | 2764e934b6d0da1342be781447348288ac84c5e9 | [
"Apache-2.0"
] | 9 | 2019-12-07T07:26:32.000Z | 2022-02-10T18:26:18.000Z | modules/tools/map_gen/create_traffic_light_from_event.py | BaiduXLab/apollo | 2764e934b6d0da1342be781447348288ac84c5e9 | [
"Apache-2.0"
] | 12 | 2018-12-24T02:17:19.000Z | 2021-12-06T01:54:09.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | 35.527397 | 79 | 0.679391 |
a846673c34f633512e11dedc7da5098eddd42063 | 453 | py | Python | api/utils/parse_params.py | odbalogun/areavas-bl | bde6696e52cc1b1f780b26803f4071edcc6ca428 | [
"Apache-2.0"
] | null | null | null | api/utils/parse_params.py | odbalogun/areavas-bl | bde6696e52cc1b1f780b26803f4071edcc6ca428 | [
"Apache-2.0"
] | null | null | null | api/utils/parse_params.py | odbalogun/areavas-bl | bde6696e52cc1b1f780b26803f4071edcc6ca428 | [
"Apache-2.0"
] | null | null | null | from functools import wraps
from flask_restful import reqparse
def parse_params(*arguments):
def parse(func):
@wraps(func)
def resource_verb(*args, **kwargs):
parser = reqparse.RequestParser()
for argument in arguments:
parser.add_argument(argument)
... | 23.842105 | 50 | 0.615894 |
133b3af168014ff21112d88a4c5a4ec23dee1927 | 857 | py | Python | app/grandchallenge/cases/migrations/0023_auto_20200521_1052.py | njmhendrix/grand-challenge.org | 9bc36f5e26561a78bd405e8ea5e4c0f86c95f011 | [
"Apache-2.0"
] | 1 | 2021-02-09T10:30:44.000Z | 2021-02-09T10:30:44.000Z | app/grandchallenge/cases/migrations/0023_auto_20200521_1052.py | njmhendrix/grand-challenge.org | 9bc36f5e26561a78bd405e8ea5e4c0f86c95f011 | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/cases/migrations/0023_auto_20200521_1052.py | njmhendrix/grand-challenge.org | 9bc36f5e26561a78bd405e8ea5e4c0f86c95f011 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-21 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("cases", "0022_auto_20200325_1151"),
]
operations = [
migrations.AddField(
model_name="image",
name="window_center",
... | 25.205882 | 52 | 0.556593 |
3306a4d0e138c91909af4110a1e689e593d06a24 | 14,189 | py | Python | client/v1/docker_image_.py | pcj/containerregistry | 657fcea7f1206de849058517bd0a0b5bdc92d325 | [
"Apache-2.0"
] | null | null | null | client/v1/docker_image_.py | pcj/containerregistry | 657fcea7f1206de849058517bd0a0b5bdc92d325 | [
"Apache-2.0"
] | 1 | 2018-04-12T13:52:03.000Z | 2018-04-12T13:52:03.000Z | client/v1/docker_image_.py | pcj/containerregistry | 657fcea7f1206de849058517bd0a0b5bdc92d325 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 29.622129 | 108 | 0.657904 |
61b549582c309d90ad35bc0c90411156ddd38f64 | 5,240 | py | Python | brandenburg/scraper_brandenburg.py | okfde/bundesrat-scraper | a5e5b8e4172fb85430807f2a78fe78e69a826dab | [
"MIT"
] | 10 | 2018-12-08T12:16:52.000Z | 2021-05-23T08:14:08.000Z | brandenburg/scraper_brandenburg.py | okfde/bundesrat-scraper | a5e5b8e4172fb85430807f2a78fe78e69a826dab | [
"MIT"
] | 17 | 2018-12-07T09:48:31.000Z | 2020-09-03T14:37:54.000Z | brandenburg/scraper_brandenburg.py | okfde/bundesrat-scraper | a5e5b8e4172fb85430807f2a78fe78e69a826dab | [
"MIT"
] | 1 | 2019-01-21T15:20:00.000Z | 2019-01-21T15:20:00.000Z | import re
import pdb
import requests
from lxml import html as etree
import pdfcutter
# Import relative Parent Directory for Helper Classes
import os, sys
sys.path.insert(0, os.path.abspath('..')) #Used when call is ` python3 file.py`
sys.path.insert(0, os.path.abspath('.')) #Used when call is ` python3 $COUNTY/file.... | 46.785714 | 188 | 0.676145 |
b26d7d3e5940da4687869e14aaaf914363be9fd0 | 323 | py | Python | src/python/WMCore/WMBS/Oracle/Jobs/GetCountByState.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WMBS/Oracle/Jobs/GetCountByState.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WMBS/Oracle/Jobs/GetCountByState.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_GetCountByState_
Oracle implementation of Jobs.GetCountByState
"""
from __future__ import division
from WMCore.WMBS.MySQL.Jobs.GetCountByState import GetCountByState as MySQLGetCountByState
class GetCountByState(MySQLGetCountByState):
"""
Identical to MySQL version.
"""
pa... | 19 | 90 | 0.770898 |
b21d015eaec6dea6d2f9659c6522e827032831d6 | 2,443 | py | Python | pyrandall/executors/requests_http.py | kpn/pyrandall | ece91d3cae901c1913451c3c8996a7ce9f6f58af | [
"Apache-2.0"
] | 2 | 2019-09-26T13:45:35.000Z | 2019-09-27T08:03:43.000Z | pyrandall/executors/requests_http.py | kpn/pyrandall | ece91d3cae901c1913451c3c8996a7ce9f6f58af | [
"Apache-2.0"
] | 7 | 2019-09-25T09:00:36.000Z | 2020-06-29T06:58:11.000Z | pyrandall/executors/requests_http.py | kpn/pyrandall | ece91d3cae901c1913451c3c8996a7ce9f6f58af | [
"Apache-2.0"
] | 2 | 2019-09-25T09:41:38.000Z | 2020-02-17T11:49:37.000Z | import requests
from pyrandall.types import Assertion
from .common import Executor
class RequestHttp(Executor):
def __init__(self, spec, *args, **kwargs):
super().__init__()
self.execution_mode = spec.execution_mode
self.spec = spec
def execute(self, reporter):
spec = self.s... | 34.9 | 106 | 0.633647 |
c475621ccd6cc59fd49da395f0d9cf338c8aea09 | 580 | py | Python | molecool/measure.py | y-yao/molssi_tutorial | d3ef2f4710e0c2ba8c1cad45342e335153d8dfef | [
"BSD-3-Clause"
] | null | null | null | molecool/measure.py | y-yao/molssi_tutorial | d3ef2f4710e0c2ba8c1cad45342e335153d8dfef | [
"BSD-3-Clause"
] | null | null | null | molecool/measure.py | y-yao/molssi_tutorial | d3ef2f4710e0c2ba8c1cad45342e335153d8dfef | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
def calculate_distance(rA, rB):
# This function calculates the distance between two points given as numpy arrays.
d=(rA-rB)
dist=np.linalg.norm(d)
return dist
def calculate_angle(rA, rB, rC, degrees=False):
# Calculate the angle between three points. Answer is given in radians b... | 29 | 114 | 0.67069 |
e42e472ed237c4b50a663755c0780d69c0ec20f7 | 2,405 | py | Python | setup.py | bartoszj/Mallet | 0645b08c7eaea4b2f2769a0ca0d84fa8f0332357 | [
"MIT"
] | 16 | 2015-09-07T00:34:49.000Z | 2021-11-12T05:54:01.000Z | setup.py | bartoszj/Mallet | 0645b08c7eaea4b2f2769a0ca0d84fa8f0332357 | [
"MIT"
] | null | null | null | setup.py | bartoszj/Mallet | 0645b08c7eaea4b2f2769a0ca0d84fa8f0332357 | [
"MIT"
] | 2 | 2017-05-21T16:39:00.000Z | 2017-06-11T13:09:07.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
# Instruction:
# - Dev
# - python setup.py develop --user
# - (test)
# - python setup.py develop --user -u
#
# - PyPI
# - python setup.py register -r https://pypi.python.org/pypi
#
# - python setup.py sdist bdist_whee... | 32.945205 | 80 | 0.590021 |
67921bc90ba3c34e512bd3e4167322daea4dc689 | 7,396 | py | Python | lab9/text_recognizer/models/resnet_transformer.py | AleksandrLiadov/fsdl-text-recognizer-2021-labs | 9495e1457fc82ab83ff7e4141939d603565eb89b | [
"MIT"
] | 402 | 2021-01-18T12:14:08.000Z | 2022-03-28T03:41:05.000Z | lab9/text_recognizer/models/resnet_transformer.py | AleksandrLiadov/fsdl-text-recognizer-2021-labs | 9495e1457fc82ab83ff7e4141939d603565eb89b | [
"MIT"
] | 27 | 2021-01-21T01:54:30.000Z | 2022-03-29T21:39:41.000Z | lab9/text_recognizer/models/resnet_transformer.py | AleksandrLiadov/fsdl-text-recognizer-2021-labs | 9495e1457fc82ab83ff7e4141939d603565eb89b | [
"MIT"
] | 271 | 2021-01-21T18:07:24.000Z | 2022-03-30T12:49:53.000Z | import argparse
from typing import Any, Dict
import math
import torch
import torch.nn as nn
import torchvision
from .transformer_util import PositionalEncodingImage, PositionalEncoding, generate_square_subsequent_mask
TF_DIM = 256
TF_FC_DIM = 1024
TF_DROPOUT = 0.4
TF_LAYERS = 4
TF_NHEAD = 4
RESNET_DIM = 512 # hard-... | 37.543147 | 120 | 0.579638 |
66b414b2099ac3d6d0dcd5d7e996b8ac0026651f | 742 | py | Python | setup.py | rgcmaack/cinema_lib | 9c38fe0c2252fc675c78d965873342c21bee401f | [
"BSD-3-Clause"
] | null | null | null | setup.py | rgcmaack/cinema_lib | 9c38fe0c2252fc675c78d965873342c21bee401f | [
"BSD-3-Clause"
] | null | null | null | setup.py | rgcmaack/cinema_lib | 9c38fe0c2252fc675c78d965873342c21bee401f | [
"BSD-3-Clause"
] | null | null | null | import sys
try:
from setuptools import setup, find_packages
except Exception as e:
print("cinema_lib requires Python 3.6. Exiting.")
sys.exit()
import unittest
from cinema_lib import version
def readme():
with open('README.md') as f:
return f.read()
def tests():
loader = unittest.TestLo... | 23.1875 | 60 | 0.648248 |
98d3ce3ae7ff6ead94a23a94d52ae436b52ee968 | 2,058 | py | Python | agents/model-based-vc.py | asimonw/ai-playground | 2418868fa473582258409981056369be5370c907 | [
"MIT"
] | null | null | null | agents/model-based-vc.py | asimonw/ai-playground | 2418868fa473582258409981056369be5370c907 | [
"MIT"
] | null | null | null | agents/model-based-vc.py | asimonw/ai-playground | 2418868fa473582258409981056369be5370c907 | [
"MIT"
] | null | null | null | # model-based reflex agent
import random
class Agent:
def __init__(self, world):
self.state = world
# rules mapping states to actions
self.rules = {
'A': {
'clean': 'right',
'dirty': 'suck'
},
'B': {
'clean': 'left',
'dirty': 'suck'
}
}
self.action = None
def __str__(self):
... | 23.123596 | 72 | 0.650632 |
bc1517a6c10f6b6cef12fd31b2272bf330cfc2ae | 3,516 | py | Python | tests/test_tek_tojson.py | keiji/probeCOCOATek | accc64c66eb30907fda14cb678f17a49ce3e8675 | [
"MIT"
] | null | null | null | tests/test_tek_tojson.py | keiji/probeCOCOATek | accc64c66eb30907fda14cb678f17a49ce3e8675 | [
"MIT"
] | null | null | null | tests/test_tek_tojson.py | keiji/probeCOCOATek | accc64c66eb30907fda14cb678f17a49ce3e8675 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
import requests
import requests_mock
import json
import sys
import os
from datetime import datetime
from probeCOCOATek.probeCOCOATek import probeCOCOATek, AugumentError, ParamError, DataError
class TestTEKToJSON(object):
def setup_method(self, method):
... | 55.809524 | 160 | 0.644767 |
9ab2ce981ba8cbdd84d9f32c35ad92fce8f6288b | 1,166 | py | Python | tests/philip_20190703_example_tree/UK_DWR/collect_sample.py | philip-brohan/rda-image-archive | acd03656dc313d9a68b318a0c92db07afda654c0 | [
"MIT"
] | null | null | null | tests/philip_20190703_example_tree/UK_DWR/collect_sample.py | philip-brohan/rda-image-archive | acd03656dc313d9a68b318a0c92db07afda654c0 | [
"MIT"
] | null | null | null | tests/philip_20190703_example_tree/UK_DWR/collect_sample.py | philip-brohan/rda-image-archive | acd03656dc313d9a68b318a0c92db07afda654c0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Collect a small sample of images from a UK DWR volume
# For testing the image database
import sys
import os
import glob
import subprocess
# Disk with original images
image_source='/glade/scratch/brohan/Image_disc_copy//Catherine_Ross_DWR/1903A/DWR_1903_10.pdf'
# Take the first n
n_images = 10... | 26.5 | 94 | 0.609777 |
dc6cdd27954d4e3a8af09ec7390bb4fbd0600892 | 7,959 | py | Python | tests/test_examples.py | aparamon/bokeh | cf6c97e35301adb15dd69eb24f4f8af5e75d64e1 | [
"BSD-3-Clause"
] | 12 | 2020-07-20T14:58:31.000Z | 2021-09-04T22:15:14.000Z | tests/test_examples.py | aparamon/bokeh | cf6c97e35301adb15dd69eb24f4f8af5e75d64e1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_examples.py | aparamon/bokeh | cf6c97e35301adb15dd69eb24f4f8af5e75d64e1 | [
"BSD-3-Clause"
] | 3 | 2019-03-27T23:27:05.000Z | 2020-08-05T19:03:19.000Z | from __future__ import absolute_import, print_function
import os
import time
import pytest
import subprocess
import platform
import signal
from os.path import basename, dirname, split
import six
from bokeh.server.callbacks import NextTickCallback, PeriodicCallback, TimeoutCallback
from bokeh._testing.util.screensho... | 30.147727 | 114 | 0.633371 |
51a74116104251219db3ec4d78c429ac6e3973d1 | 23,632 | py | Python | vaca/ipython_config.py | carrerasrodrigo/vaca | b8f6c6a038882cc7d786d80b959c2a2fdfaae689 | [
"BSD-3-Clause"
] | null | null | null | vaca/ipython_config.py | carrerasrodrigo/vaca | b8f6c6a038882cc7d786d80b959c2a2fdfaae689 | [
"BSD-3-Clause"
] | null | null | null | vaca/ipython_config.py | carrerasrodrigo/vaca | b8f6c6a038882cc7d786d80b959c2a2fdfaae689 | [
"BSD-3-Clause"
] | null | null | null |
# Configuration file for ipython.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# InteractiveS... | 37.69059 | 409 | 0.633125 |
350501b67a112814d031498be6698325b7708214 | 5,320 | py | Python | ros/src/util/packages/autoware_bag_tools/scripts/change_frame_id.py | GeoBIMpro/MAS | 60dc4745efb86fc1796e672f5825fa9c54940919 | [
"BSD-3-Clause"
] | 5 | 2018-06-20T08:29:21.000Z | 2018-11-12T06:05:52.000Z | ros/src/util/packages/autoware_bag_tools/scripts/change_frame_id.py | donrv/MAS | 60dc4745efb86fc1796e672f5825fa9c54940919 | [
"BSD-3-Clause"
] | null | null | null | ros/src/util/packages/autoware_bag_tools/scripts/change_frame_id.py | donrv/MAS | 60dc4745efb86fc1796e672f5825fa9c54940919 | [
"BSD-3-Clause"
] | 1 | 2019-01-21T13:38:45.000Z | 2019-01-21T13:38:45.000Z | #!/usr/bin/python
"""
Copyright (c) 2018, Nagoya University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditi... | 46.666667 | 120 | 0.729699 |
f57f9dc71be08487f6b0b6bcf4706776452e6c6c | 3,998 | py | Python | survol/sources_types/CIM_DataFile/portable_executable/pefile_exports.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | null | null | null | survol/sources_types/CIM_DataFile/portable_executable/pefile_exports.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | null | null | null | survol/sources_types/CIM_DataFile/portable_executable/pefile_exports.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Pefile exports
"""
# BEWARE: Do NOT rename it as stat.py otherwise strange errors happen,
# probably a collision of modules names, with the message:
# "Fatal Python error: Py_Initialize: can't initialize sys standard streams"
import os
import sys
import time
import lib_util
import lib_uris
... | 33.596639 | 114 | 0.674087 |
1fd9df89bcd483b2762da29e519cc88759b533c6 | 98,386 | py | Python | QUEEN/qobj.py | yachielab/QUEEN | 94ed667dbb3b95712e5a2473afc889d625c7824a | [
"MIT"
] | 9 | 2021-11-09T23:25:50.000Z | 2021-12-31T23:53:08.000Z | QUEEN/qobj.py | yachielab/QUEEN | 94ed667dbb3b95712e5a2473afc889d625c7824a | [
"MIT"
] | null | null | null | QUEEN/qobj.py | yachielab/QUEEN | 94ed667dbb3b95712e5a2473afc889d625c7824a | [
"MIT"
] | null | null | null | import sys
import copy
import urllib
import tempfile
import requests
from bs4 import BeautifulSoup
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, FeatureLocation, CompoundLocation, FeatureLocation, ExactPosition
from functools import total_ordering
sys.path.append("... | 48.585679 | 311 | 0.52043 |
cffd0da4027e4b232e1508643a81074271708563 | 2,313 | py | Python | model_zoo/official/recommend/wide_and_deep/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | model_zoo/official/recommend/wide_and_deep/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 3 | 2021-03-31T20:15:40.000Z | 2022-02-09T23:50:46.000Z | model_zoo/official/recommend/wide_and_deep/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.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... | 37.918033 | 107 | 0.710333 |
3900d9d036056539316824b2cb114e51443c2dd9 | 3,795 | py | Python | ckanext/cloudstorage/cli.py | ranierigmusella/ckanext-cloudstorage | 83c959d731c87a6f5d6fd08628b5714d637324c0 | [
"MIT"
] | 1 | 2017-03-23T00:13:24.000Z | 2017-03-23T00:13:24.000Z | ckanext/cloudstorage/cli.py | ranierigmusella/ckanext-cloudstorage | 83c959d731c87a6f5d6fd08628b5714d637324c0 | [
"MIT"
] | 1 | 2017-05-04T13:50:41.000Z | 2017-05-04T13:50:41.000Z | ckanext/cloudstorage/cli.py | ranierigmusella/ckanext-cloudstorage | 83c959d731c87a6f5d6fd08628b5714d637324c0 | [
"MIT"
] | 5 | 2016-11-25T11:17:27.000Z | 2020-11-26T10:46:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path
import cgi
from docopt import docopt
from ckan.lib.cli import CkanCommand
from ckanapi import LocalCKAN
from ckanext.cloudstorage.storage import (
CloudStorage,
ResourceCloudStorage
)
from ckanext.cloudstorage.model import (
create_tab... | 25.13245 | 75 | 0.571014 |
15c4224bca13b1b0f4c209bbb5d43143ca1e7b09 | 355 | py | Python | bafd/sprites/metals/__init__.py | TEParsons/BronzeAgeFashionDesigner | 7a48f84290802d3b9470dffa127550de7c2b360e | [
"MIT"
] | null | null | null | bafd/sprites/metals/__init__.py | TEParsons/BronzeAgeFashionDesigner | 7a48f84290802d3b9470dffa127550de7c2b360e | [
"MIT"
] | null | null | null | bafd/sprites/metals/__init__.py | TEParsons/BronzeAgeFashionDesigner | 7a48f84290802d3b9470dffa127550de7c2b360e | [
"MIT"
] | null | null | null | from pathlib import Path
from pygame import image
from . import ores, ingots
# Get files
sprites = {}
for sprite in Path(__file__).parent.glob("*.png"):
sprites[sprite.stem] = image.load(str(sprite))
# Append files to module namespace according to filename
globals().update(sprites)
# Update module namespace
__all... | 27.307692 | 56 | 0.743662 |
491c3965d56305cec433e18b427cf4f4c04077df | 1,879 | py | Python | src/main.py | rubenochiavone/ternary-rk-fit | b378b3a6951660b7a5fa6708ad85ee55220607e6 | [
"MIT"
] | null | null | null | src/main.py | rubenochiavone/ternary-rk-fit | b378b3a6951660b7a5fa6708ad85ee55220607e6 | [
"MIT"
] | null | null | null | src/main.py | rubenochiavone/ternary-rk-fit | b378b3a6951660b7a5fa6708ad85ee55220607e6 | [
"MIT"
] | null | null | null | import sys
import subprocess
import os
import json
from Config import Config
import lmfit
from lmfit import Minimizer
from OutputFormatter import OutputFormatter
from TernaryRKModel import TernaryRKModel
argc = len(sys.argv)
verbose = False
if argc > 1:
for i in range(argc):
if sys.argv[i] == "-v" or sys... | 23.4875 | 101 | 0.729643 |
a04577222c781e4f84de776e028e3f9f0c719b7f | 3,934 | py | Python | python_experiments/data_analysis/aec_algorithm/k_truss_PP_SI_time.py | mexuaz/AccTrussDecomposition | 15a9e8fd2f123f5acace5f3b40b94f1a74eb17d4 | [
"MIT"
] | 9 | 2020-03-30T13:00:15.000Z | 2022-03-17T13:40:17.000Z | python_experiments/data_analysis/aec_algorithm/k_truss_PP_SI_time.py | mexuaz/AccTrussDecomposition | 15a9e8fd2f123f5acace5f3b40b94f1a74eb17d4 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/aec_algorithm/k_truss_PP_SI_time.py | mexuaz/AccTrussDecomposition | 15a9e8fd2f123f5acace5f3b40b94f1a74eb17d4 | [
"MIT"
] | 2 | 2020-08-17T10:05:51.000Z | 2020-08-30T22:57:55.000Z | from data_analysis.util.folder_init import init_folder_md_json_file
from data_analysis.util.get_configurations import get_config_dict_via_hostname
from data_analysis.util.read_file_utils_updated import *
from data_analysis.util.parsing_helpers import *
from data_analysis.aec_algorithm.local_config.ktruss_exec_tags impo... | 44.704545 | 114 | 0.658617 |
db11e6332203be0955b6844a0c90ad135f081587 | 4,232 | py | Python | hparams.py | eloqute/WaveRNN | 036674b2e3745e22f15f6f945661f5f9d8a63003 | [
"MIT"
] | null | null | null | hparams.py | eloqute/WaveRNN | 036674b2e3745e22f15f6f945661f5f9d8a63003 | [
"MIT"
] | null | null | null | hparams.py | eloqute/WaveRNN | 036674b2e3745e22f15f6f945661f5f9d8a63003 | [
"MIT"
] | null | null | null | # CONFIG -----------------------------------------------------------------------------------------------------------#
# Here are the input and output data paths (Note: you can override wav_path in preprocess.py)
wav_path = '/path/to/wav_files/'
data_path = 'data/'
# model ids are separate - that way you can use a new... | 44.083333 | 118 | 0.573015 |
472e2aafd9caa885a43134135931bdd4778e5d1b | 10,745 | py | Python | tests/regressiontests/transactions_regress/tests.py | wnyc/django | 470deb5cbb765e2e731c5b0b184247c7f87482aa | [
"BSD-3-Clause"
] | 1 | 2022-02-05T13:41:30.000Z | 2022-02-05T13:41:30.000Z | tests/regressiontests/transactions_regress/tests.py | wnyc/django | 470deb5cbb765e2e731c5b0b184247c7f87482aa | [
"BSD-3-Clause"
] | 1 | 2016-02-19T00:22:18.000Z | 2016-02-19T00:22:18.000Z | tests/regressiontests/transactions_regress/tests.py | wnyc/django | 470deb5cbb765e2e731c5b0b184247c7f87482aa | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.db import connection, connections, transaction, DEFAULT_DB_ALIAS, DatabaseError
from django.db.transaction import commit_on_success, commit_manually, TransactionManagementError
from django.test import TransactionTestCase, skipUnlessDBFeature
from django.test.utils imp... | 39.503676 | 109 | 0.660679 |
af586a9751d7d13df9e631f3b53daf05bf4ecab8 | 900 | py | Python | codes/Archive/recalculate_optimal_solution.py | htalebiyan/Dec2py | 8c4181eb92d6e52aef8cc804c485865516cee200 | [
"MIT"
] | null | null | null | codes/Archive/recalculate_optimal_solution.py | htalebiyan/Dec2py | 8c4181eb92d6e52aef8cc804c485865516cee200 | [
"MIT"
] | null | null | null | codes/Archive/recalculate_optimal_solution.py | htalebiyan/Dec2py | 8c4181eb92d6e52aef8cc804c485865516cee200 | [
"MIT"
] | null | null | null | import pickle
import indp
root = '/home/hesam/Desktop/Files/Game_Shelby_County/results/ng_results_L4_m92_v12_OPTIMISTIC_OPTIMAL/'
with open(root+'objs_30.pkl', 'rb') as f:
obj = pickle.load(f)
BASE_DIR = "../data/Extended_Shelby_County/"
DAMAGE_DIR = "../data/Wu_Damage_scenarios/"
obj.net, _, _ = indp.initialize_n... | 42.857143 | 103 | 0.704444 |
70c89d8969b611bcd3e6080b1a85f04a982317a9 | 3,710 | py | Python | nova/tests/api/openstack/volume/contrib/test_types_manage.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/volume/contrib/test_types_manage.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | nova/tests/api/openstack/volume/contrib/test_types_manage.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T10:40:59.000Z | 2020-07-24T10:40:59.000Z | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 35.673077 | 78 | 0.660647 |
98ed75b5ff9741b58149e7d6e193b12ce85e9fb3 | 97,658 | py | Python | conans/client/migrations_settings.py | a4z/conan | dec9e0288f81462c53b9222a206002fbc525ea65 | [
"MIT"
] | null | null | null | conans/client/migrations_settings.py | a4z/conan | dec9e0288f81462c53b9222a206002fbc525ea65 | [
"MIT"
] | null | null | null | conans/client/migrations_settings.py | a4z/conan | dec9e0288f81462c53b9222a206002fbc525ea65 | [
"MIT"
] | null | null | null | settings_1_9_0 = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc64le, ppc64, armv6, armv7, armv7hf, armv8, sparc, sparcv9, mips, mips64, avr, armv7s, armv7k]
# Only for building cross compil... | 47.337857 | 266 | 0.537355 |
f77ddc2d022929177bf186b19e8e9dcb867fe198 | 1,194 | py | Python | src/flair_management/skin_manager/weight_editor.py | PxT00/valorant-skin-cli | 4d142174e53769c10a06f2ba5343d8a4d4a7512c | [
"MIT"
] | 2 | 2021-08-11T02:09:15.000Z | 2021-08-11T02:09:19.000Z | src/flair_management/skin_manager/weight_editor.py | PxT00/valorant-skin-cli | 4d142174e53769c10a06f2ba5343d8a4d4a7512c | [
"MIT"
] | null | null | null | src/flair_management/skin_manager/weight_editor.py | PxT00/valorant-skin-cli | 4d142174e53769c10a06f2ba5343d8a4d4a7512c | [
"MIT"
] | null | null | null | from InquirerPy import prompt, inquirer
from InquirerPy.separator import Separator
from ...flair_management.skin_manager.skin_manager import Skin_Manager
from .weapon_config_prompts import Prompts
class Weight_Editor:
@staticmethod
def weights_entrypoint():
weapon_data, skin_data, skin_choice, weapon... | 41.172414 | 160 | 0.718593 |
cede76755d5818aef7b0ecc3430634bd21bc459a | 21,409 | py | Python | arcpyext/mapping/_mapping2.py | dcworldwide/arcpyext | 47ab401b74a2e296f7fc1eef51f80500d1300033 | [
"BSD-3-Clause"
] | null | null | null | arcpyext/mapping/_mapping2.py | dcworldwide/arcpyext | 47ab401b74a2e296f7fc1eef51f80500d1300033 | [
"BSD-3-Clause"
] | null | null | null | arcpyext/mapping/_mapping2.py | dcworldwide/arcpyext | 47ab401b74a2e296f7fc1eef51f80500d1300033 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
"""This module contains extended functionality for related to the arcpy.mapping module."""
# Python 2/3 compatibility
# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-order,wrong-import-position
from __future__ import (absolute_import, division, print_function, unicode_literals)
fro... | 36.97582 | 129 | 0.696343 |
c26ea917df4659652504d2f36f9a1088a804a50f | 716 | py | Python | src/main/resources/assets/openpython/opos/v1.1/lib/micropython/shutil.py | fossabot/OpenPython | 8fe3f794f2a6c543d96c1ef5c097ffa18f90b680 | [
"PSF-2.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 41 | 2018-10-25T06:15:31.000Z | 2022-02-20T11:20:43.000Z | src/main/resources/assets/openpython/opos/v1.1/lib/micropython/shutil.py | fossabot/OpenPython | 8fe3f794f2a6c543d96c1ef5c097ffa18f90b680 | [
"PSF-2.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 16 | 2018-03-20T12:25:27.000Z | 2018-03-25T13:34:44.000Z | src/main/resources/assets/openpython/opos/v1.1/lib/micropython/shutil.py | fossabot/OpenPython | 8fe3f794f2a6c543d96c1ef5c097ffa18f90b680 | [
"PSF-2.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 9 | 2020-11-12T10:23:27.000Z | 2021-04-18T14:46:24.000Z | # Reimplement, because CPython3.3 impl is rather bloated
import os
def rmtree(top):
for path, dirs, files in os.walk(top, False):
for f in files:
os.unlink(path + "/" + f)
os.rmdir(path)
def copyfileobj(src, dest, length=512):
if hasattr(src, "readinto"):
buf = bytearray(l... | 24.689655 | 56 | 0.480447 |
cdf2be01408bcec466128ec45a0099de8db7e66a | 12,658 | py | Python | examples/glut_ex/atoms.py | bpedersen2/python-gr | 664f83d11c5d710aa27e117cc1c2899fbd5582a7 | [
"RSA-MD"
] | 25 | 2018-02-23T18:11:51.000Z | 2021-02-16T10:06:47.000Z | examples/glut_ex/atoms.py | bpedersen2/python-gr | 664f83d11c5d710aa27e117cc1c2899fbd5582a7 | [
"RSA-MD"
] | 29 | 2018-01-24T16:40:53.000Z | 2022-02-21T15:29:48.000Z | examples/glut_ex/atoms.py | bpedersen2/python-gr | 664f83d11c5d710aa27e117cc1c2899fbd5582a7 | [
"RSA-MD"
] | 8 | 2017-11-27T10:28:56.000Z | 2021-11-03T13:10:12.000Z | # -*- coding: utf-8 -*-
"""
This module includes information about elements:
- atom_name_list maps element number to name
- atom_color_list maps element number to rgb color tuple
- atomic_number_dict maps element symbol to element number (not a 1:1, but a n:1 mapping, see Ununbium (UUB)/Copernicum(CN))
- atom_radius_li... | 25.623482 | 124 | 0.616053 |
bdbccf005b5be986093a453c76c29f40cba6dc9d | 640 | py | Python | tests/settings.py | adam-grandt-tts/data-driven-acquisition | 2f970a2815f90f591203c02c9099642e4cbd24d8 | [
"CC0-1.0"
] | 1 | 2020-02-14T17:36:27.000Z | 2020-02-14T17:36:27.000Z | tests/settings.py | adam-grandt-tts/data-driven-acquisition | 2f970a2815f90f591203c02c9099642e4cbd24d8 | [
"CC0-1.0"
] | 20 | 2020-01-21T15:04:16.000Z | 2021-08-05T16:18:06.000Z | tests/settings.py | adam-grandt-tts/data-driven-acquisition | 2f970a2815f90f591203c02c9099642e4cbd24d8 | [
"CC0-1.0"
] | 2 | 2020-05-10T18:29:54.000Z | 2021-03-15T18:12:07.000Z | # -*- coding: utf-8
from __future__ import unicode_literals, absolute_import
import django
DEBUG = True
USE_TZ = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "2*e6n2i!thwjd*niwb-5)ru*ek_du@8x3e$-fs3(y7yx3xue$r"
DATABASES = {
"default": {
"ENGINE": "django.db.backe... | 18.823529 | 66 | 0.664063 |
36a11e4e836aec38edbb0322e490fe5c90827287 | 3,861 | py | Python | codes/django/curso-django/webempresa/webempresa/webempresa/settings.py | crisconru/snippetshell | edd97145029d0d1749845b7b1e90d89dcbfc4506 | [
"MIT"
] | 1 | 2021-12-17T02:04:16.000Z | 2021-12-17T02:04:16.000Z | codes/django/curso-django/webempresa/webempresa/webempresa/settings.py | crisconru/snippetshell | edd97145029d0d1749845b7b1e90d89dcbfc4506 | [
"MIT"
] | 15 | 2019-05-27T19:23:50.000Z | 2022-03-11T23:53:17.000Z | webempresa/webempresa/webempresa/settings.py | davichup/web-empresa | 68791d220d8fd5a950587010ac6966668d12a6de | [
"Apache-2.0"
] | 1 | 2018-09-24T12:10:19.000Z | 2018-09-24T12:10:19.000Z | """
Django settings for webempresa project.
Generated by 'django-admin startproject' using Django 2.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os... | 25.74 | 140 | 0.676509 |
199ddc896738818934715fe5986bd506bbb491ef | 9,729 | py | Python | larcv/app/arxiv/arxiv/LArOpenCVHandle/ana/arxiv/track_shower.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 14 | 2017-10-19T15:08:29.000Z | 2021-03-31T21:21:07.000Z | larcv/app/arxiv/arxiv/LArOpenCVHandle/ana/arxiv/track_shower.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 32 | 2017-10-25T22:54:06.000Z | 2019-10-01T13:57:15.000Z | larcv/app/arxiv/arxiv/LArOpenCVHandle/ana/arxiv/track_shower.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 16 | 2017-12-07T12:04:40.000Z | 2021-11-15T00:53:31.000Z | import os, sys
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import root_numpy as rn
from larocv import larocv
rse = ['run','subrun','event']
rsev = ['run','subrun','event','vtxid']
rserv = ['run','subrun','event','roid','vtxid']
# Vertex data frame
dfs = {}
# Eve... | 32.757576 | 129 | 0.633981 |
7743b7205ca0398d7515163ba68b218682105232 | 21,263 | py | Python | quantum/openstack/common/rpc/impl_qpid.py | cuiwow/quantum | ce11b62046a0501e9fcd8442524d3c151d315dfb | [
"Apache-2.0"
] | 1 | 2019-04-11T10:27:47.000Z | 2019-04-11T10:27:47.000Z | quantum/openstack/common/rpc/impl_qpid.py | cuiwow/quantum | ce11b62046a0501e9fcd8442524d3c151d315dfb | [
"Apache-2.0"
] | null | null | null | quantum/openstack/common/rpc/impl_qpid.py | cuiwow/quantum | ce11b62046a0501e9fcd8442524d3c151d315dfb | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC
# Copyright 2011 - 2012, Red Hat, 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
#
# h... | 34.857377 | 79 | 0.585618 |
0312c5d7f200db3a771a69eb1a38fad0b8c98158 | 2,058 | py | Python | tests/python/game.py | Helen09/pxt | 221233c420f34c74885d1b73f4b1b5074b6960aa | [
"MIT"
] | 1 | 2019-07-04T23:05:54.000Z | 2019-07-04T23:05:54.000Z | tests/python/game.py | LaboratoryForPlayfulComputation/pxt | 1d58e344faef7d6483cf5c1e40ae6ed73f7759bd | [
"MIT"
] | null | null | null | tests/python/game.py | LaboratoryForPlayfulComputation/pxt | 1d58e344faef7d6483cf5c1e40ae6ed73f7759bd | [
"MIT"
] | 2 | 2019-10-29T06:56:11.000Z | 2021-05-25T10:18:12.000Z | class Foo:
def qux2(self):
z = 12
x = z * 3
self.baz = x
for q in range(10):
x += q
lst = ["foo", "bar", "baz"]
lst = lst[1:2]
assert len(lst) == 2, 201
def qux(self):
self.baz = self.bar
self.blah = "hello"
self._priv = 1
self._prot = self.baz
def _prot2(self):
... | 27.810811 | 210 | 0.706997 |
120618b43322669d3f179966004c4ef7cf7facbf | 1,990 | py | Python | src/Current Models/Misc/shell.py | PharaohCola13/Geotesimal | 45de6fb9a587ae8eb3c85d0acd6b93c36fa7bf24 | [
"MIT"
] | 3 | 2018-12-13T20:11:18.000Z | 2022-01-13T13:51:19.000Z | src/Current Models/Misc/shell.py | PharaohCola13/geometric-models | 45de6fb9a587ae8eb3c85d0acd6b93c36fa7bf24 | [
"MIT"
] | 5 | 2018-10-19T18:18:05.000Z | 2021-06-10T00:20:52.000Z | src/Current Models/Misc/shell.py | PharaohCola13/geometric-models | 45de6fb9a587ae8eb3c85d0acd6b93c36fa7bf24 | [
"MIT"
] | 1 | 2018-10-17T05:32:26.000Z | 2018-10-17T05:32:26.000Z | # A Shell, brought to you by PharaohCola13
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.pyplot as plt
from matplotlib import *
from numpy import *
from mpl_toolkits.mplot3d.art3d import *
from matplotlib.animation import *
name = "Shell"
def shape(fig, alpha, color, edge_c, edge_w, grid, sides, edges, ... | 21.630435 | 109 | 0.657286 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.