hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
280722120947017be454a369846c66cb14719cb1 | 3,440 | py | Python | authmechanics/settings.py | shafi2263/drf-auth-mechanisms | e721972300cf8227823c85ea011838a12a01810b | [
"MIT"
] | 1 | 2022-01-18T09:03:36.000Z | 2022-01-18T09:03:36.000Z | authmechanics/settings.py | shafi2263/drf-auth-mechanisms | e721972300cf8227823c85ea011838a12a01810b | [
"MIT"
] | null | null | null | authmechanics/settings.py | shafi2263/drf-auth-mechanisms | e721972300cf8227823c85ea011838a12a01810b | [
"MIT"
] | null | null | null | """
Django settings for authmechanics project.
Generated by 'django-admin startproject' using Django 3.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from p... | 25.294118 | 91 | 0.700291 |
24f7e5a6872f35656ec626fcc82c370b48aa889f | 14,163 | py | Python | nesta/core/orms/patstat_2019_05_13.py | anniyanvr/nesta | 4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3 | [
"MIT"
] | 13 | 2019-06-18T16:53:53.000Z | 2021-03-04T10:58:52.000Z | nesta/core/orms/patstat_2019_05_13.py | nestauk/old_nesta_daps | 4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3 | [
"MIT"
] | 208 | 2018-08-10T13:15:40.000Z | 2021-07-21T10:16:07.000Z | nesta/core/orms/patstat_2019_05_13.py | nestauk/old_nesta_daps | 4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3 | [
"MIT"
] | 8 | 2018-09-20T15:19:23.000Z | 2020-12-15T17:41:34.000Z | '''Automatically generated by pypatstat (https://github.com/nestauk/pypatstat)'''
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column
from sqlalchemy.types import REAL,NVARCHAR,VARCHAR,INT,CHAR,SMALLINT,DATE
Base = declarative_base()
class Tls201Appln(Base):
__tablename__ = 'tls201... | 39.124309 | 81 | 0.741651 |
4847320b5821115f6de9c01391f6adfcdc1b94ef | 2,227 | py | Python | starter/starter_PublishPOA.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | starter/starter_PublishPOA.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | starter/starter_PublishPOA.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | import os
# Add parent directory for imports
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
import boto.swf
import log
import json
import random
from optparse import OptionParser
"""
Amazon SWF PublishPOA starter
"""
class starter_PublishPOA():
def start... | 32.275362 | 97 | 0.620117 |
748c526f7857ac3cdb28a5d22cde7d8af49ed5ad | 8,025 | py | Python | tornado/test/auth_test.py | skarra/tornado | 617f56fe4123c2276bcb3e8ce76664c6f87e7694 | [
"Apache-2.0"
] | 1 | 2019-01-19T15:53:15.000Z | 2019-01-19T15:53:15.000Z | tornado/test/auth_test.py | comforx/tornado | 50244877b57c1870748af607b17519acd4af0226 | [
"Apache-2.0"
] | null | null | null | tornado/test/auth_test.py | comforx/tornado | 50244877b57c1870748af607b17519acd4af0226 | [
"Apache-2.0"
] | null | null | null | # These tests do not currently do much to verify the correct implementation
# of the openid/oauth protocols, they just exercise the major code paths
# and ensure that it doesn't blow up (e.g. with unicode/bytes issues in
# python 3)
from __future__ import absolute_import, division, with_statement
from tornado.auth im... | 40.736041 | 205 | 0.666916 |
cf4fb8f9b1e14e2195fe23a9fa29bffa93469dd6 | 7,809 | py | Python | utils/openface.py | botcs/ppcu-entry | 898be3ac65b11e5a5554d69fe975d80ed8557cca | [
"MIT"
] | 4 | 2018-04-12T16:55:48.000Z | 2019-04-19T23:54:10.000Z | utils/openface.py | botcs/ppcu-entry | 898be3ac65b11e5a5554d69fe975d80ed8557cca | [
"MIT"
] | null | null | null | utils/openface.py | botcs/ppcu-entry | 898be3ac65b11e5a5554d69fe975d80ed8557cca | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
from collections import OrderedDict
from .SpatialCrossMapLRN_temp import SpatialCrossMapLRN_temp
class LambdaBase(nn.Sequential):
def __init__(self, fn, *ar... | 34.706667 | 138 | 0.55705 |
f8828dd0b42eda7cfe1e1ea33c06bcda42114f9e | 476 | py | Python | VideoSearchEngine/tables.py | AkshatSh/VideoSearchEngine | 57f64b241b8a7bbc377ce7826e1206f679f41def | [
"MIT"
] | 49 | 2018-05-22T09:06:18.000Z | 2022-02-26T10:03:43.000Z | VideoSearchEngine/tables.py | AkshatSh/VideoSearchEngine | 57f64b241b8a7bbc377ce7826e1206f679f41def | [
"MIT"
] | 17 | 2018-05-18T21:14:36.000Z | 2019-06-06T09:17:18.000Z | VideoSearchEngine/tables.py | AkshatSh/VideoSearchEngine | 57f64b241b8a7bbc377ce7826e1206f679f41def | [
"MIT"
] | 18 | 2018-06-06T22:14:26.000Z | 2021-11-23T08:59:31.000Z | from flask_table import Table, Col
class Results(Table):
id = Col('Id', show=False)
name = Col('Name', column_html_attrs={'class':'table_col name'}, th_html_attrs={'class':'table_header'})
summary = Col('Extractive Summary', column_html_attrs={'class':'table_col summary'}, td_html_attrs={'class':'sumDescr... | 59.5 | 166 | 0.701681 |
37202d15a6cbe7123c571efcedac3c9847e2b01b | 1,399 | py | Python | MyClass.py | lucyios/pythonStudy | 93a48386ecdaa7c0724b6f8533b0cbf4795c666e | [
"Apache-2.0"
] | null | null | null | MyClass.py | lucyios/pythonStudy | 93a48386ecdaa7c0724b6f8533b0cbf4795c666e | [
"Apache-2.0"
] | null | null | null | MyClass.py | lucyios/pythonStudy | 93a48386ecdaa7c0724b6f8533b0cbf4795c666e | [
"Apache-2.0"
] | null | null | null | # class MyClass:
#
#
# # def __init__(self):
#
#
# i = 100
# def myFunction(self):
# return 'hello world'
#
# x = MyClass()
#
# print("my Class 中的属性i为:",x.i)
#
# print("当前类的调用方法:",x.myFunction())
class People:
#定义基本属性
name = ' '
age = 0
#定义私有属性,_开头
_weight= 0
#定义构造方法
def... | 17.4875 | 76 | 0.553967 |
2e1be04a293a3810ba0451d9d1189883e430fa3a | 1,343 | py | Python | docs/conf.py | stestagg/dangerous-module | 3f5fdc07736f0194f981585d052f2a44d143c1b3 | [
"BSD-2-Clause"
] | null | null | null | docs/conf.py | stestagg/dangerous-module | 3f5fdc07736f0194f981585d052f2a44d143c1b3 | [
"BSD-2-Clause"
] | null | null | null | docs/conf.py | stestagg/dangerous-module | 3f5fdc07736f0194f981585d052f2a44d143c1b3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext... | 24.87037 | 67 | 0.673864 |
3b99fcd5b8978d048bea5114a25bb0cc9c070b4c | 669 | py | Python | voice_assistent/common/utils.py | igornfaustino/voice-assistant | 3f5a19378ddaf7962a4c84720de8c037d36f45e0 | [
"MIT"
] | null | null | null | voice_assistent/common/utils.py | igornfaustino/voice-assistant | 3f5a19378ddaf7962a4c84720de8c037d36f45e0 | [
"MIT"
] | 14 | 2019-11-04T15:46:31.000Z | 2021-04-30T21:14:37.000Z | voice_assistent/common/utils.py | igornfaustino/voice-assistant | 3f5a19378ddaf7962a4c84720de8c037d36f45e0 | [
"MIT"
] | null | null | null | import os
import notify2
import requests
from gtts import gTTS
from pathlib import Path
filename = 'voice.mp3'
notify2.init("voice_assistant")
def get_current_public_ip():
return requests.get('https://api.ipify.org').text
def create_audio_file(text, lang="en"):
tts = gTTS(text, lang=lang)
tts.save(fil... | 17.605263 | 53 | 0.693572 |
6f22b54a049baaa696ee9f6f167c0a039ab4da0c | 1,398 | py | Python | src/telliot_core/queries/legacy_query.py | tellor-io/pytelliot | c5da9168f8dcf8ac5728c208f169b6f7ddba85d7 | [
"MIT"
] | 2 | 2021-09-01T14:19:26.000Z | 2021-09-07T15:17:14.000Z | src/telliot_core/queries/legacy_query.py | tellor-io/pytelliot | c5da9168f8dcf8ac5728c208f169b6f7ddba85d7 | [
"MIT"
] | 77 | 2021-09-03T04:01:20.000Z | 2021-11-09T14:45:52.000Z | src/telliot_core/queries/legacy_query.py | tellor-io/pytelliot | c5da9168f8dcf8ac5728c208f169b6f7ddba85d7 | [
"MIT"
] | 3 | 2021-09-02T10:51:15.000Z | 2021-09-07T15:16:59.000Z | """ :mod:`telliot_core.queries.legacy_query`
"""
from dataclasses import dataclass
from telliot_core.dtypes.float_type import UnsignedFloatType
from telliot_core.dtypes.value_type import ValueType
from telliot_core.queries.query import OracleQuery
@dataclass
class LegacyRequest(OracleQuery):
"""Legacy Price/Val... | 32.511628 | 87 | 0.69814 |
deca216eaeec496711ea0f2c16fe65fbd0b2d481 | 16,485 | py | Python | test/unit/obj/test_auditor.py | citrix-openstack-build/swift | 34340ddf49a84f3b3398012c2b60be1215033559 | [
"Apache-2.0"
] | 1 | 2016-03-14T23:38:37.000Z | 2016-03-14T23:38:37.000Z | test/unit/obj/test_auditor.py | vimeo/swift | 5eea524d3ea6d29c2b6f34927c0130090e7ed44d | [
"Apache-2.0"
] | null | null | null | test/unit/obj/test_auditor.py | vimeo/swift | 5eea524d3ea6d29c2b6f34927c0130090e7ed44d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 38.071594 | 79 | 0.5835 |
634c79c2d3838108f3fc8b34b1abb0fa12ae8ba6 | 6,248 | py | Python | python/fire_rs/demo_situation_assessment_stages.py | arthur-bit-monnot/fire-rs-saop | 321e16fceebf44e8e97b482c24f37fbf6dd7d162 | [
"BSD-2-Clause"
] | 13 | 2018-11-19T15:51:23.000Z | 2022-01-16T11:24:21.000Z | python/fire_rs/demo_situation_assessment_stages.py | fire-rs-laas/fire-rs-saop | 321e16fceebf44e8e97b482c24f37fbf6dd7d162 | [
"BSD-2-Clause"
] | 14 | 2017-10-12T16:19:19.000Z | 2018-03-12T12:07:56.000Z | python/fire_rs/demo_situation_assessment_stages.py | fire-rs-laas/fire-rs-saop | 321e16fceebf44e8e97b482c24f37fbf6dd7d162 | [
"BSD-2-Clause"
] | 4 | 2018-03-12T12:28:55.000Z | 2021-07-07T18:32:17.000Z | """Produce pictures of the Situation Assessment stages Observation, Interpolation, Prediction"""
# Copyright (c) 2020, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistr... | 42.216216 | 254 | 0.71975 |
bf428705cbd1253b7832e366d284546c0135c751 | 21,262 | py | Python | APIScan/views.py | GMedian/archerysec | 9591fdb6b21ca56d77364d1433acbaff84437c7f | [
"BSD-3-Clause"
] | 4 | 2019-03-19T16:53:49.000Z | 2021-12-18T22:12:55.000Z | APIScan/views.py | GMedian/archerysec | 9591fdb6b21ca56d77364d1433acbaff84437c7f | [
"BSD-3-Clause"
] | 8 | 2020-02-12T00:43:21.000Z | 2022-03-11T23:25:08.000Z | APIScan/views.py | GMedian/archerysec | 9591fdb6b21ca56d77364d1433acbaff84437c7f | [
"BSD-3-Clause"
] | 1 | 2018-08-12T17:29:35.000Z | 2018-08-12T17:29:35.000Z | # -*- coding: utf-8 -*-
# _
# /\ | |
# / \ _ __ ___| |__ ___ _ __ _ _
# / /\ \ | '__/ __| '_ \ / _ \ '__| | | |
# / ____ \| | | (__| | | | __/ | | |_| |
#/_/ \_\_| \___|_| |_|\___|_| \__, |
# __/ |
# |... | 39.966165 | 119 | 0.522952 |
df79ae13634ead635e567cb2382d985ebd54359c | 227,213 | py | Python | numpy/add_newdocs.py | njsmith/numpy | 11f3ebf86a16452d0af40b41925b201485ae7f9c | [
"BSD-3-Clause"
] | 1 | 2017-10-27T17:10:40.000Z | 2017-10-27T17:10:40.000Z | numpy/add_newdocs.py | njsmith/numpy | 11f3ebf86a16452d0af40b41925b201485ae7f9c | [
"BSD-3-Clause"
] | 1 | 2015-06-22T21:15:24.000Z | 2015-06-22T21:23:53.000Z | numpy/add_newdocs.py | njsmith/numpy | 11f3ebf86a16452d0af40b41925b201485ae7f9c | [
"BSD-3-Clause"
] | null | null | null | """
This is only meant to add docs to objects defined in C-extension modules.
The purpose is to allow easier editing of the docstrings without
requiring a re-compile.
NOTE: Many of the methods of ndarray have corresponding functions.
If you update these docstrings, please keep also the ones in
core/fromnum... | 29.261172 | 128 | 0.592884 |
55fabc4d34a3da8ee88e6e9cd2f8fc0910151714 | 1,292 | py | Python | sdk/search/azure-search-documents/tests/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/search/azure-search-documents/tests/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/tests/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import sys
... | 35.888889 | 98 | 0.643189 |
f6bb87d45e43dd0f9b363508d863fb76c383ce3a | 14,260 | py | Python | pontoon/administration/tests/test_views.py | udacity/pontoon | e15a03a0c987615385b2a8c537bb18c99567f77e | [
"BSD-3-Clause"
] | 1 | 2019-05-26T04:16:47.000Z | 2019-05-26T04:16:47.000Z | pontoon/administration/tests/test_views.py | udacity/pontoon | e15a03a0c987615385b2a8c537bb18c99567f77e | [
"BSD-3-Clause"
] | 9 | 2020-09-06T05:18:03.000Z | 2022-02-26T14:28:38.000Z | pontoon/administration/tests/test_views.py | udacity/pontoon | e15a03a0c987615385b2a8c537bb18c99567f77e | [
"BSD-3-Clause"
] | 1 | 2019-05-25T23:24:42.000Z | 2019-05-25T23:24:42.000Z | # -*- coding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
from pontoon.administration.forms import (
ProjectForm,
)
from pontoon.administration.views import _create_or_update_translated_resources
from pontoon.base.models import (
Entity,
Locale,
Project,
ProjectLocale,
... | 32.933025 | 91 | 0.675526 |
4549e30c52b517de129cd25acab775ec7ee89b13 | 3,106 | py | Python | movietracker/users/views.py | ChristinSaji/Movie-Tracker | e8d6312f6a892daf36c23d9c4122da723cec7c18 | [
"MIT"
] | 1 | 2021-12-21T13:44:49.000Z | 2021-12-21T13:44:49.000Z | movietracker/users/views.py | ChristinSaji/Movie-Tracker | e8d6312f6a892daf36c23d9c4122da723cec7c18 | [
"MIT"
] | null | null | null | movietracker/users/views.py | ChristinSaji/Movie-Tracker | e8d6312f6a892daf36c23d9c4122da723cec7c18 | [
"MIT"
] | 1 | 2021-11-20T18:50:39.000Z | 2021-11-20T18:50:39.000Z | from users.forms import ProfileUpdateForm, UserUpdateForm
from users.models import Profile
from django.shortcuts import render, redirect
from django.contrib.auth.models import User, auth
from django.contrib import messages
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import ... | 34.511111 | 143 | 0.633612 |
26112074e0dfa302436781c9776d9961d72d9ac5 | 13,810 | py | Python | src/streamlink/plugins/crunchyroll.py | mvaladas/streamlink | 3df9b1d99f86cc9d61af5c3c122fe12599f71dbb | [
"BSD-2-Clause"
] | 1 | 2021-05-02T03:57:02.000Z | 2021-05-02T03:57:02.000Z | src/streamlink/plugins/crunchyroll.py | Inncee81/streamlink | 07029669d58a835bd05029316211343eef78ddf2 | [
"BSD-2-Clause"
] | 3 | 2020-04-07T18:40:42.000Z | 2020-09-23T15:43:18.000Z | src/streamlink/plugins/crunchyroll.py | Inncee81/streamlink | 07029669d58a835bd05029316211343eef78ddf2 | [
"BSD-2-Clause"
] | 2 | 2021-02-09T14:29:21.000Z | 2021-05-28T11:10:34.000Z | import datetime
import logging
import re
from uuid import uuid4
from streamlink.plugin import Plugin, PluginArgument, PluginArguments, PluginError
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
STREAM_WEIGHTS = {
"low": 240,
"mid": 420,
... | 35.139949 | 120 | 0.569225 |
b4b9491ffb996baa9e474ba53d58335b2a4ae255 | 663 | py | Python | tests/candeobj/test_materials.py | Ricyteach/candejar | a83a83a377f7d757568e373f2ff6dcb4e1661e70 | [
"MIT"
] | null | null | null | tests/candeobj/test_materials.py | Ricyteach/candejar | a83a83a377f7d757568e373f2ff6dcb4e1661e70 | [
"MIT"
] | null | null | null | tests/candeobj/test_materials.py | Ricyteach/candejar | a83a83a377f7d757568e373f2ff6dcb4e1661e70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `candejar.candeobj.Material` subclasses."""
import pytest
from candejar.candeobj.parts.materials import Isotropic, MohrCoulomb, Interface
from candejar.candeobj.parts.duncanselig import DuncanSelig, Duncan, Selig, \
DuncanCanned, SeligCanned
from candej... | 26.52 | 79 | 0.72549 |
029b337beac089836b2d4a545acdddf524592cdb | 2,725 | py | Python | naive_bayes_classifier.py | KivenCkl/Data_Analysis_Algorithm | 68754e115e4142d9bbf266465f375c721660bad5 | [
"MIT"
] | null | null | null | naive_bayes_classifier.py | KivenCkl/Data_Analysis_Algorithm | 68754e115e4142d9bbf266465f375c721660bad5 | [
"MIT"
] | null | null | null | naive_bayes_classifier.py | KivenCkl/Data_Analysis_Algorithm | 68754e115e4142d9bbf266465f375c721660bad5 | [
"MIT"
] | null | null | null | """
朴素贝叶斯分类器
---------------
以垃圾邮件过滤器举例说明该算法思想
对外两个方法:
1. train(training_set)
训练朴素贝叶斯分类器
2. classify(message)
利用训练好的数据对 message 进行预测
"""
import re
import math
from collections import defaultdict
class NaiveBayesClassifier:
def __init__(self, k=0.5):
self.k = k
self.word_probs = []
def _tok... | 29.619565 | 79 | 0.594495 |
e0324de1561bc07bc99858fc6d14efb57d42accb | 739 | py | Python | docs/tutorial/plotters_dynamic.py | funkchaser/compas | b58de8771484aa0c6068d43df78b1679503215de | [
"MIT"
] | 235 | 2017-11-07T07:33:22.000Z | 2022-03-25T16:20:00.000Z | docs/tutorial/plotters_dynamic.py | funkchaser/compas | b58de8771484aa0c6068d43df78b1679503215de | [
"MIT"
] | 770 | 2017-09-22T13:42:06.000Z | 2022-03-31T21:26:45.000Z | docs/tutorial/plotters_dynamic.py | funkchaser/compas | b58de8771484aa0c6068d43df78b1679503215de | [
"MIT"
] | 99 | 2017-11-06T23:15:28.000Z | 2022-03-25T16:05:36.000Z | from compas.geometry import Pointcloud, Translation
from compas.utilities import i_to_red, pairwise
from compas_plotters import Plotter
plotter = Plotter(figsize=(8, 5))
pointcloud = Pointcloud.from_bounds(8, 5, 0, 10)
for index, (a, b) in enumerate(pairwise(pointcloud)):
artist = plotter.add(a, edgecolor=i_to_... | 27.37037 | 114 | 0.721245 |
e46b303826e008b8835a4c934e9c062f34a4be56 | 3,432 | py | Python | models/densenet.py | HtutLynn/Knowledge_Distillation_Pytorch | 78130a3212e9305eee8e50498a59a945845eb9eb | [
"MIT"
] | 1 | 2020-05-11T12:02:39.000Z | 2020-05-11T12:02:39.000Z | models/densenet.py | HtutLynn/Knowledge_Distillation_Pytorch | 78130a3212e9305eee8e50498a59a945845eb9eb | [
"MIT"
] | null | null | null | models/densenet.py | HtutLynn/Knowledge_Distillation_Pytorch | 78130a3212e9305eee8e50498a59a945845eb9eb | [
"MIT"
] | 1 | 2020-11-05T03:31:32.000Z | 2020-11-05T03:31:32.000Z | '''DenseNet in PyTorch.'''
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Bottleneck(nn.Module):
def __init__(self, in_planes, growth_rate):
super(Bottleneck, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.conv1 = nn.Conv2d(in_planes, 4*gr... | 34.666667 | 96 | 0.65472 |
3265341e7971d67b101b94b386e6436875f41320 | 126 | py | Python | DelibeRating/DelibeRating/deliberating-env/Lib/site-packages/etc/tests/testapp/views.py | Severose/DelibeRating | 5d227f35c071477ce3fd6fbf3ab13a44d13f6e08 | [
"MIT"
] | 25 | 2015-02-07T15:42:06.000Z | 2022-03-26T02:28:06.000Z | DelibeRating/DelibeRating/deliberating-env/Lib/site-packages/etc/tests/testapp/views.py | Severose/DelibeRating | 5d227f35c071477ce3fd6fbf3ab13a44d13f6e08 | [
"MIT"
] | 3 | 2017-01-06T20:34:13.000Z | 2021-05-11T02:24:22.000Z | DelibeRating/DelibeRating/deliberating-env/Lib/site-packages/etc/tests/testapp/views.py | Severose/DelibeRating | 5d227f35c071477ce3fd6fbf3ab13a44d13f6e08 | [
"MIT"
] | 2 | 2016-07-28T01:54:13.000Z | 2017-02-13T20:55:19.000Z | from django.shortcuts import render
def index(request):
return render(request, 'this.html', {'postfix_var': 'dynamic'})
| 21 | 67 | 0.722222 |
a73f1d942d4111d1341fdb606b11d75b78a6e85f | 816 | py | Python | day04/test_room.py | aschmied/advent-of-code-2016 | 90d6f2415a84b3d2db740252a1a87193d3a47aaa | [
"BSD-2-Clause"
] | null | null | null | day04/test_room.py | aschmied/advent-of-code-2016 | 90d6f2415a84b3d2db740252a1a87193d3a47aaa | [
"BSD-2-Clause"
] | null | null | null | day04/test_room.py | aschmied/advent-of-code-2016 | 90d6f2415a84b3d2db740252a1a87193d3a47aaa | [
"BSD-2-Clause"
] | null | null | null | import unittest
import room
class TestRoomID(unittest.TestCase):
def test_from_string(self):
room_id = room.RoomID.from_string('aaaaa-bbb-z-y-x-123[abxyz]')
self.assertEqual('aaaaa-bbb-z-y-x', room_id.encrypted_name)
self.assertEqual(123, room_id.sector_id)
self.assertEqual('abxyz', room_id.checksum... | 31.384615 | 67 | 0.740196 |
326d778d3330682484ac22e3ab5fc0fcd1e3ecc7 | 1,681 | py | Python | lib/services/monitoring/test/test_v2_api.py | KidongSohn/ncloud-sdk-py | 1c62471a9bd320d77164ed3193a0ebb9f64229ff | [
"MIT"
] | null | null | null | lib/services/monitoring/test/test_v2_api.py | KidongSohn/ncloud-sdk-py | 1c62471a9bd320d77164ed3193a0ebb9f64229ff | [
"MIT"
] | null | null | null | lib/services/monitoring/test/test_v2_api.py | KidongSohn/ncloud-sdk-py | 1c62471a9bd320d77164ed3193a0ebb9f64229ff | [
"MIT"
] | null | null | null | # coding: utf-8
"""
monitoring
OpenAPI spec version: 2018-06-21T02:23:11Z
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import ncloud_monitoring
from ncloud_monitoring.api.v2_api import V2Api # noqa: E501
from ncloud_m... | 28.982759 | 111 | 0.686496 |
bb0a7cbd167238c68db38e9734d11b2bc0fbbe8a | 1,603 | py | Python | pages/forms.py | bekiryavuz/cihazTakipWeb | b25a8f771feb2ec24a1b97956e9c8c1719a4d02a | [
"MIT"
] | null | null | null | pages/forms.py | bekiryavuz/cihazTakipWeb | b25a8f771feb2ec24a1b97956e9c8c1719a4d02a | [
"MIT"
] | null | null | null | pages/forms.py | bekiryavuz/cihazTakipWeb | b25a8f771feb2ec24a1b97956e9c8c1719a4d02a | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm
from .models import Cihazlar,Gorevli
class CihazForm(ModelForm):
class Meta:
model = Cihazlar
fields = "__all__"
labels = {
'btNumarasi': '',
'domainAdi': '',
'isyeri': '',
'cihazTur... | 42.184211 | 136 | 0.532751 |
30c26826ec65ba7b554495d5bf0597c0e25aba0e | 931 | py | Python | pip_services_runtime/errors/ConfigError.py | pip-services-archive/pip-services-runtime-python | 70eca1ffc44bfdc45c9c65b0ee347fa578368849 | [
"MIT"
] | null | null | null | pip_services_runtime/errors/ConfigError.py | pip-services-archive/pip-services-runtime-python | 70eca1ffc44bfdc45c9c65b0ee347fa578368849 | [
"MIT"
] | null | null | null | pip_services_runtime/errors/ConfigError.py | pip-services-archive/pip-services-runtime-python | 70eca1ffc44bfdc45c9c65b0ee347fa578368849 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pip_services_runtime.errors.ConfigError
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Configuration exception type
:copyright: Digital Living Software Corp. 2015-2016, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from .ErrorCategory ... | 33.25 | 87 | 0.644468 |
1fffbc151df75637e884e2339df025ca5828193e | 5,208 | py | Python | testing/kfctl/kfctl_go_test.py | usatko/kubeflow | 58f1c8547e7e2dd29aa1abdc975c8da490114f87 | [
"Apache-2.0"
] | null | null | null | testing/kfctl/kfctl_go_test.py | usatko/kubeflow | 58f1c8547e7e2dd29aa1abdc975c8da490114f87 | [
"Apache-2.0"
] | null | null | null | testing/kfctl/kfctl_go_test.py | usatko/kubeflow | 58f1c8547e7e2dd29aa1abdc975c8da490114f87 | [
"Apache-2.0"
] | null | null | null | import datetime
import logging
import os
import subprocess
import tempfile
import uuid
from retrying import retry
import yaml
import pytest
from kubeflow.testing import util
# retry 4 times, waiting 3 minutes between retries
@retry(stop_max_attempt_number=4, wait_fixed=180000)
def run_with_retries(*args, **kwargs):... | 33.6 | 84 | 0.675499 |
07956d52bd299a225357a2556f59ad8e58f9b26a | 5,099 | py | Python | src/code/static_network/recommendations/helper_job.py | dvaruas/minority_recommendations | 8adcbf5af5c322e4b20d4336b12ecda62a5c4d5f | [
"MIT"
] | null | null | null | src/code/static_network/recommendations/helper_job.py | dvaruas/minority_recommendations | 8adcbf5af5c322e4b20d4336b12ecda62a5c4d5f | [
"MIT"
] | null | null | null | src/code/static_network/recommendations/helper_job.py | dvaruas/minority_recommendations | 8adcbf5af5c322e4b20d4336b12ecda62a5c4d5f | [
"MIT"
] | null | null | null | import configparser
import datetime
import json
import logging
import os
import sys
from code.common.recommenders.adamic_adar import AdamicAdarRecommendation
from code.common.recommenders.pa_homophily import PAHomophily
from code.common.recommenders.ranked_bandit import EspGreedy, Exp3, RankedBanditRecommendation
from... | 42.140496 | 114 | 0.706413 |
7cd567408021707638852d3e34c03cf5cf3fbfa8 | 1,056 | py | Python | prj-tensorrt/demo.py | lamhoangtung/CenterFace | 137a374b47b5428e78aee53de8b31a1ba0afe594 | [
"MIT"
] | null | null | null | prj-tensorrt/demo.py | lamhoangtung/CenterFace | 137a374b47b5428e78aee53de8b31a1ba0afe594 | [
"MIT"
] | null | null | null | prj-tensorrt/demo.py | lamhoangtung/CenterFace | 137a374b47b5428e78aee53de8b31a1ba0afe594 | [
"MIT"
] | null | null | null | import cv2
import scipy.io as sio
import os
from centerface import CenterFace
from tqdm import tqdm
centerface = CenterFace('models/tensorrt/centerface.trt')
def test_image_tensorrt(image_path, visualize_output=False):
frame = cv2.imread(image_path)
h, w = 1088, 1920 # old is 480* 640
landmarks = True
... | 30.171429 | 112 | 0.586174 |
1c33ca6b07df9401deb2a7acc1624f8489ef1b94 | 11,911 | py | Python | dark/html.py | TaliVeith/dark-matter | 1548a6e6fbfceb7c8b13556bbf4f7ce7d1ac18a0 | [
"MIT"
] | 10 | 2016-03-09T09:43:14.000Z | 2021-04-03T21:46:12.000Z | dark/html.py | TaliVeith/dark-matter | 1548a6e6fbfceb7c8b13556bbf4f7ce7d1ac18a0 | [
"MIT"
] | 332 | 2015-01-07T12:37:30.000Z | 2022-01-20T15:48:11.000Z | dark/html.py | TaliVeith/dark-matter | 1548a6e6fbfceb7c8b13556bbf4f7ce7d1ac18a0 | [
"MIT"
] | 4 | 2016-03-08T14:56:39.000Z | 2021-01-27T08:11:27.000Z | from __future__ import print_function
from IPython.display import HTML
from six.moves.urllib.parse import quote
from dark.fastq import FastqReads
def NCBISequenceLinkURL(title, field=None, delim='|'):
"""
Given a sequence title, like
"acc|GENBANK|AY516849.1|GENBANK|42768646 Homo sapiens",
return... | 34.725948 | 78 | 0.589455 |
832fc5b2ce6601aef0f923722fc08c0152d6dad9 | 3,835 | py | Python | src/oci/compute_instance_agent/models/instance_agent_command_source_via_text_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/compute_instance_agent/models/instance_agent_command_source_via_text_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/compute_instance_agent/models/instance_agent_command_source_via_text_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.241071 | 245 | 0.675098 |
3c7c2dfb6ba121424ebe965851887e9c1d1f76ea | 1,089 | py | Python | SoftLayer/CLI/ssl/download.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | SoftLayer/CLI/ssl/download.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | SoftLayer/CLI/ssl/download.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """Download SSL certificate and key file."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""Download SSL certificate and key file."""
manager... | 31.114286 | 78 | 0.700643 |
e164f1c323c9213820a3413d25ea73f0cf02ef16 | 8,045 | py | Python | assignment1/cs231n/classifiers/k_nearest_neighbor.py | e-soroush/cs231n | 0c6f18e6031f401e8a5c44f15f7fe2234d339efa | [
"MIT"
] | 2 | 2019-02-05T11:56:04.000Z | 2019-04-28T19:09:19.000Z | assignment1/cs231n/classifiers/k_nearest_neighbor.py | e-soroush/cs231n | 0c6f18e6031f401e8a5c44f15f7fe2234d339efa | [
"MIT"
] | 1 | 2021-04-16T09:52:48.000Z | 2021-04-16T09:52:48.000Z | assignment1/cs231n/classifiers/k_nearest_neighbor.py | e-soroush/cs231n | 0c6f18e6031f401e8a5c44f15f7fe2234d339efa | [
"MIT"
] | null | null | null | import numpy as np
class KNearestNeighbor(object):
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors this is just
memorizing the training data.
Inputs:
- X: A numpy array of shape (num_train, D) ... | 46.773256 | 113 | 0.462523 |
b413f9176ebea210152971c8decb701e877de936 | 636 | py | Python | ValidationProject/ValidationApp/forms.py | cs-fullstack-2019-spring/django-validation-cw-rsalcido | 5613275631771125c99c2a3463e68f9e66bf5ab2 | [
"Apache-2.0"
] | null | null | null | ValidationProject/ValidationApp/forms.py | cs-fullstack-2019-spring/django-validation-cw-rsalcido | 5613275631771125c99c2a3463e68f9e66bf5ab2 | [
"Apache-2.0"
] | null | null | null | ValidationProject/ValidationApp/forms.py | cs-fullstack-2019-spring/django-validation-cw-rsalcido | 5613275631771125c99c2a3463e68f9e66bf5ab2 | [
"Apache-2.0"
] | null | null | null | from django import forms
from .models import NewCarModel
# linked to model
class NewCarForm(forms.ModelForm):
class Meta:
model = NewCarModel
fields = '__all__'
def clean_mpg(self):
mpg = self.cleaned_data['mpg']
if mpg < 20:
raise forms.ValidationError('That is le... | 25.44 | 70 | 0.613208 |
48b5954bb5f862ee5fb1ddbac402ec48efe26b7d | 896 | py | Python | pre_commit_reject_large_files/reject.py | guykisel/pre-commit-reject-large-files | 2c323b4ddd9fcfe5b20eb041be442d9ce4bd647a | [
"MIT"
] | 3 | 2017-07-25T01:10:25.000Z | 2019-10-03T12:21:06.000Z | pre_commit_reject_large_files/reject.py | guykisel/pre-commit-reject-large-files | 2c323b4ddd9fcfe5b20eb041be442d9ce4bd647a | [
"MIT"
] | 1 | 2019-01-10T21:02:43.000Z | 2019-01-10T21:02:43.000Z | pre_commit_reject_large_files/reject.py | guykisel/pre-commit-reject-large-files | 2c323b4ddd9fcfe5b20eb041be442d9ce4bd647a | [
"MIT"
] | 1 | 2018-12-30T19:59:03.000Z | 2018-12-30T19:59:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import argparse
import os
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='filenames to run')
... | 27.151515 | 72 | 0.592634 |
b4d63ef4e37118d18e3ff4ce210d1b1d53140491 | 3,560 | py | Python | python/tdd.py | mattanimation/new_tdd | 9fbccbd15f58f9c08d80dbc0650e2bca9db01a37 | [
"MIT"
] | null | null | null | python/tdd.py | mattanimation/new_tdd | 9fbccbd15f58f9c08d80dbc0650e2bca9db01a37 | [
"MIT"
] | null | null | null | python/tdd.py | mattanimation/new_tdd | 9fbccbd15f58f9c08d80dbc0650e2bca9db01a37 | [
"MIT"
] | null | null | null | # use the config to unit test the files
import sys
import os
import json
import yaml
import inspect
import importlib
from collections import namedtuple
class TestConfig:
def __init__(self, filename):
if filename:
c = self.open_config_file(filename)
if c:
self.test... | 29.180328 | 122 | 0.539888 |
ffbdfa33cc36ace948dc50246d55a33af1e06cac | 312 | py | Python | PythonChallenge/Ex19/19_05.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | PythonChallenge/Ex19/19_05.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | PythonChallenge/Ex19/19_05.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
from PIL import Image
def com_color(color):
r, g, b = color
return 255-r, 255-g, 255-b
if __name__ == "__main__":
img = Image.open("map.jpg")
data = map(com_color, img.getdata())
img.putdata(list(data))
img.save("19_new_map.jpg")
img.close()
| 18.352941 | 40 | 0.625 |
2e787c0a76fbb5a2d69fdecf45acc1f3a9ad12de | 1,177 | py | Python | scripts/make_pangolin_node_data.py | arodzh-sudo/ncov | 279782a412d16802ef6c37da80248f25e4d249bc | [
"MIT"
] | 1 | 2022-02-06T20:23:03.000Z | 2022-02-06T20:23:03.000Z | scripts/make_pangolin_node_data.py | arodzh-sudo/ncov-puertorico | 1638d62167177de55f3fde3c8149af077047daf2 | [
"MIT"
] | null | null | null | scripts/make_pangolin_node_data.py | arodzh-sudo/ncov-puertorico | 1638d62167177de55f3fde3c8149af077047daf2 | [
"MIT"
] | null | null | null | """
Translate pangolineages from CSV -> JSON for node_data
Note: this should arguably live instead as part of `combine_metadata`,
but this gets particularly complex given the new multiple-inputs logic.
So, for now, following the initial suggestion in the issue.
"""
import argparse
import pandas as pd
import csv
import... | 35.666667 | 149 | 0.740867 |
76b2c4c3827f7b464a01d99486d33765023eed2e | 19,410 | py | Python | python/cuml/preprocessing/encoders.py | tzemicheal/cuml | 377f3c2773e3fc64d93d3d64a3f2fcd6c8759044 | [
"Apache-2.0"
] | 1 | 2021-01-01T10:52:18.000Z | 2021-01-01T10:52:18.000Z | python/cuml/preprocessing/encoders.py | tzemicheal/cuml | 377f3c2773e3fc64d93d3d64a3f2fcd6c8759044 | [
"Apache-2.0"
] | null | null | null | python/cuml/preprocessing/encoders.py | tzemicheal/cuml | 377f3c2773e3fc64d93d3d64a3f2fcd6c8759044 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.122881 | 79 | 0.567852 |
ff5b7f02f134c52a9912b501f073ecb7a0e4591e | 747 | py | Python | common/iotools.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | 1 | 2019-08-05T00:54:27.000Z | 2019-08-05T00:54:27.000Z | common/iotools.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | null | null | null | common/iotools.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import os
import os.path as osp
import errno
import json
import shutil
def mkdir_if_missing(directory):
if not osp.exists(directory):
try:
os.makedirs(directory)
except OSError as e:
if e.errno != errno.EEXIST:
raise
... | 20.75 | 73 | 0.618474 |
6ec00ce0b9a832594dc6a5244cc0076fed7d83fc | 6,146 | py | Python | synapse/rest/admin/background_updates.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | synapse/rest/admin/background_updates.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | synapse/rest/admin/background_updates.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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 a... | 35.526012 | 86 | 0.629027 |
04e86c5e5aa87cf61d94c836779089647705b9be | 4,263 | py | Python | behavior_cloning/prelim_submit/p1.py | chickert/reinforcement_learning | 473323f08b079004f27a7f0931e5e9a46bfad347 | [
"MIT"
] | null | null | null | behavior_cloning/prelim_submit/p1.py | chickert/reinforcement_learning | 473323f08b079004f27a7f0931e5e9a46bfad347 | [
"MIT"
] | null | null | null | behavior_cloning/prelim_submit/p1.py | chickert/reinforcement_learning | 473323f08b079004f27a7f0931e5e9a46bfad347 | [
"MIT"
] | null | null | null | """
Run this file for Problem 1
"""
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset
import logging
import cv2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt; plt.style.use('seaborn-darkgrid')
from copy import deepcopy
from pusher_goal import PusherEnv
from pusher_mo... | 37.394737 | 123 | 0.722496 |
00ad2c49579f6e4a8fc37f7ec81a63d1051031fb | 4,869 | py | Python | rlmolecule/crystal/crystal_problem.py | harrysorensennrel/rlmolecule | 978269400b90f752bf4741f42f03522603b321e2 | [
"BSD-3-Clause"
] | null | null | null | rlmolecule/crystal/crystal_problem.py | harrysorensennrel/rlmolecule | 978269400b90f752bf4741f42f03522603b321e2 | [
"BSD-3-Clause"
] | null | null | null | rlmolecule/crystal/crystal_problem.py | harrysorensennrel/rlmolecule | 978269400b90f752bf4741f42f03522603b321e2 | [
"BSD-3-Clause"
] | null | null | null | import logging
from abc import ABC
from typing import Dict, Optional
import sqlalchemy as sqlalchemy
import tensorflow as tf
from tensorflow.keras import layers
from rlmolecule.alphazero.tensorflow.tfalphazero_problem import TFAlphaZeroProblem
from rlmolecule.crystal.crystal_state import CrystalState
from rlmolecule.... | 46.817308 | 119 | 0.669131 |
891656a76c2e15a0a735a727c254ca9e2bfcd5e5 | 3,111 | py | Python | chainer_chemistry/dataset/preprocessors/mol_preprocessor.py | delta2323/chainerchem | 364dd2b26aec2d0b25d5e2b30a9510a9d44814af | [
"MIT"
] | null | null | null | chainer_chemistry/dataset/preprocessors/mol_preprocessor.py | delta2323/chainerchem | 364dd2b26aec2d0b25d5e2b30a9510a9d44814af | [
"MIT"
] | null | null | null | chainer_chemistry/dataset/preprocessors/mol_preprocessor.py | delta2323/chainerchem | 364dd2b26aec2d0b25d5e2b30a9510a9d44814af | [
"MIT"
] | 1 | 2019-05-23T12:25:57.000Z | 2019-05-23T12:25:57.000Z | from rdkit import Chem
from chainer_chemistry.dataset.preprocessors.base_preprocessor import BasePreprocessor # NOQA
class MolPreprocessor(BasePreprocessor):
"""preprocessor class specified for rdkit mol instance"""
def __init__(self, add_Hs=False):
super(MolPreprocessor, self).__init__()
s... | 33.815217 | 94 | 0.608165 |
0051c5dcc629955615c8899160894f1a323680f5 | 2,921 | py | Python | src/globus_cli/commands/task/event_list.py | masalim2/globus-cli | aaea1635cec2948cb4ca047d2168866d30696e2d | [
"Apache-2.0"
] | null | null | null | src/globus_cli/commands/task/event_list.py | masalim2/globus-cli | aaea1635cec2948cb4ca047d2168866d30696e2d | [
"Apache-2.0"
] | null | null | null | src/globus_cli/commands/task/event_list.py | masalim2/globus-cli | aaea1635cec2948cb4ca047d2168866d30696e2d | [
"Apache-2.0"
] | null | null | null | import json
import click
from globus_cli.paging_wrapper import PagingWrapper
from globus_cli.parsing import command, task_id_arg
from globus_cli.safeio import formatted_print
from globus_cli.services.transfer import get_client, iterable_response_to_dict
@command(
"event-list",
short_help="List events for a ... | 30.113402 | 88 | 0.668607 |
becbd7383d40f831cf612ba8fecfe1008815ca92 | 5,989 | py | Python | taskflow/tests/unit/test_flattening.py | citrix-openstack-build/taskflow | a285c3c39f85e8c7fb6837a8a99f3cdacbe3fea0 | [
"Apache-2.0"
] | null | null | null | taskflow/tests/unit/test_flattening.py | citrix-openstack-build/taskflow | a285c3c39f85e8c7fb6837a8a99f3cdacbe3fea0 | [
"Apache-2.0"
] | null | null | null | taskflow/tests/unit/test_flattening.py | citrix-openstack-build/taskflow | a285c3c39f85e8c7fb6837a8a99f3cdacbe3fea0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! 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... | 32.198925 | 78 | 0.581399 |
c179f2a7813f6ea8f48051b3d23782ec32cb3de1 | 13,998 | py | Python | ddsc/sdk/dukeds.py | Duke-GCB/DukeDSClient | 7f119a5ee2e674e8deaff1f080caed1953c5cc61 | [
"MIT"
] | 4 | 2020-06-18T12:30:13.000Z | 2020-10-12T21:25:54.000Z | ddsc/sdk/dukeds.py | Duke-GCB/DukeDSClient | 7f119a5ee2e674e8deaff1f080caed1953c5cc61 | [
"MIT"
] | 239 | 2016-02-18T14:44:08.000Z | 2022-03-11T14:38:56.000Z | ddsc/sdk/dukeds.py | Duke-GCB/DukeDSClient | 7f119a5ee2e674e8deaff1f080caed1953c5cc61 | [
"MIT"
] | 10 | 2016-02-22T15:01:28.000Z | 2022-02-21T22:46:26.000Z | from __future__ import absolute_import
import logging
from ddsc.sdk.client import Client, FileUpload, PathToFiles, ItemNotFound, DuplicateNameError, RemotePath
from ddsc.core.userutil import UserUtil
class DukeDS(object):
"""
Contains methods for interacting with DukeDS using standard ddsclient config file an... | 45.154839 | 118 | 0.693242 |
5bdfcbf1c24e6224de278557963e557180a7f266 | 7,202 | py | Python | official/cv/ssim-ae/src/eval_utils.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ssim-ae/src/eval_utils.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ssim-ae/src/eval_utils.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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 agreed to... | 38.92973 | 113 | 0.620383 |
9d13a7967c3f596e4f7313825a15685b107ac683 | 6,679 | py | Python | Python Tutorial Reinforcement Learning/12_stable_baseline3/pool_game_posvr/pool/cue.py | PaulPan00/donkey_wrapper | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | [
"MIT"
] | 6 | 2021-03-26T01:42:31.000Z | 2021-04-11T16:17:42.000Z | Python Tutorial Reinforcement Learning/12_stable_baseline3/pool_game_posvr/pool/cue.py | packetsss/Python | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | [
"MIT"
] | null | null | null | Python Tutorial Reinforcement Learning/12_stable_baseline3/pool_game_posvr/pool/cue.py | packetsss/Python | a03cf0f42f65625fbce792b06c98acd153c5d6c8 | [
"MIT"
] | 7 | 2021-04-06T06:55:22.000Z | 2021-05-03T11:26:38.000Z | # Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
import math
import numpy as np
import pygame
import config
import event
import gamestate
import physics
class Cue(pygame.sprite.Sprite):
def __init__(self, target):
pygame.sprite.Sprite.__init__(self)
self.angle = 0
... | 42.814103 | 125 | 0.633927 |
034b9a9aedd6a8b168a1e3aae08f63dc448316de | 26,459 | py | Python | pyFAI/app/calib2.py | yugangzhang/pyFAI | e0453b279dac1f165f637e2a2ed1d4ddf57d31ba | [
"MIT"
] | 45 | 2016-07-16T19:43:47.000Z | 2022-03-12T16:53:47.000Z | pyFAI/app/calib2.py | yugangzhang/pyFAI | e0453b279dac1f165f637e2a2ed1d4ddf57d31ba | [
"MIT"
] | 1,125 | 2016-06-09T07:47:57.000Z | 2022-03-31T20:34:00.000Z | pyFAI/app/calib2.py | yugangzhang/pyFAI | e0453b279dac1f165f637e2a2ed1d4ddf57d31ba | [
"MIT"
] | 52 | 2016-06-09T07:30:46.000Z | 2022-02-14T08:25:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2017-2018 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free ... | 43.37541 | 149 | 0.633924 |
bbae4034f9f1e9656d935d8f7464240680daccaa | 497 | py | Python | voting_intentions/migrations/0005_intention_nation_builder_id.py | PeoplesMomentum/mxv | 3ad06cc8d3db43c63f24a80a5709aed3ade94789 | [
"MIT"
] | 6 | 2017-12-13T18:28:16.000Z | 2019-12-13T06:06:34.000Z | voting_intentions/migrations/0005_intention_nation_builder_id.py | PeoplesMomentum/mxv | 3ad06cc8d3db43c63f24a80a5709aed3ade94789 | [
"MIT"
] | 159 | 2017-11-05T16:48:20.000Z | 2020-07-17T09:38:18.000Z | voting_intentions/migrations/0005_intention_nation_builder_id.py | PeoplesMomentum/mxv | 3ad06cc8d3db43c63f24a80a5709aed3ade94789 | [
"MIT"
] | 2 | 2018-06-30T19:34:57.000Z | 2018-10-17T11:09:41.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-07-11 07:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('voting_intentions', '0004_choicetag_votetag'),
]
operations = [
migrations.... | 23.666667 | 75 | 0.639839 |
68f5d4e4d713af6ec40e828a4ff0e0c2ce95ee38 | 293 | py | Python | tests/urls.py | frankhood/django-self-aware-model | 837ef249c218e5cd7078f3ef25de6e11da1bb8b6 | [
"MIT"
] | null | null | null | tests/urls.py | frankhood/django-self-aware-model | 837ef249c218e5cd7078f3ef25de6e11da1bb8b6 | [
"MIT"
] | null | null | null | tests/urls.py | frankhood/django-self-aware-model | 837ef249c218e5cd7078f3ef25de6e11da1bb8b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('self_aware_model.urls', namespace='self_aware_model')),
]
| 26.636364 | 78 | 0.723549 |
ae1c7eeabdbc270ce918255dc518249093d2e478 | 13,580 | py | Python | models/layers.py | BryanPlummer/SSN | 4bd5d5c8e6a2db9427e9fc5b2b93c78c494f6b79 | [
"MIT"
] | null | null | null | models/layers.py | BryanPlummer/SSN | 4bd5d5c8e6a2db9427e9fc5b2b93c78c494f6b79 | [
"MIT"
] | null | null | null | models/layers.py | BryanPlummer/SSN | 4bd5d5c8e6a2db9427e9fc5b2b93c78c494f6b79 | [
"MIT"
] | null | null | null | from collections import Counter
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import PackedSequence
# Compatibility with PyTorch v1.5.0 versus earlier.
if hasattr(torch.nn, '_VF'):
from torch.nn import _VF
else:
from torch import _VF
def _addinde... | 39.941176 | 131 | 0.616789 |
81e1fb41e93bf1f43065871135d70965a07b7939 | 6,760 | py | Python | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/community/sops/plugins/vars/sops.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/community/sops/plugins/vars/sops.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/community/sops/plugins/vars/sops.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Edoardo Tenani <e.tenani@arduino.cc> [@endorama]
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 43.612903 | 142 | 0.602367 |
dd7e28452cc6b09186598120f05168b400705929 | 15,176 | py | Python | dev/novelty_detection/novelty_detection.py | jmnatzaganian/mHTM | b0ce2e3097ac2480eef4704285586a3e9e93c9e7 | [
"MIT"
] | 30 | 2016-01-05T12:50:37.000Z | 2021-03-05T02:14:52.000Z | dev/novelty_detection/novelty_detection.py | jmnatzaganian/mHTM | b0ce2e3097ac2480eef4704285586a3e9e93c9e7 | [
"MIT"
] | 1 | 2017-03-20T10:20:16.000Z | 2017-03-27T13:49:44.000Z | dev/novelty_detection/novelty_detection.py | tehtechguy/mHTM | b0ce2e3097ac2480eef4704285586a3e9e93c9e7 | [
"MIT"
] | 12 | 2016-02-22T19:28:38.000Z | 2021-06-04T07:00:46.000Z | # novelty_detection.py
#
# Author : James Mnatzaganian
# Contact : http://techtorials.me
# Organization : NanoComputing Research Lab - Rochester Institute of
# Technology
# Website : https://www.rit.edu/kgcoe/nanolab/
# Date Created : 03/13/16
#
# Description : Experiment for usi... | 36.21957 | 79 | 0.694518 |
a95eb6e71ea261fba870f9a8d076d1a3a973b15d | 1,043 | py | Python | tests/test_genotype.py | justaddcoffee/dipper | 085c1601ae5b88848ddcdad0d52387e8f450b1be | [
"BSD-3-Clause"
] | null | null | null | tests/test_genotype.py | justaddcoffee/dipper | 085c1601ae5b88848ddcdad0d52387e8f450b1be | [
"BSD-3-Clause"
] | null | null | null | tests/test_genotype.py | justaddcoffee/dipper | 085c1601ae5b88848ddcdad0d52387e8f450b1be | [
"BSD-3-Clause"
] | 1 | 2022-01-04T14:34:33.000Z | 2022-01-04T14:34:33.000Z | #!/usr/bin/env python3
import unittest
import logging
from dipper.models.Genotype import Genotype
from dipper.graph.RDFGraph import RDFGraph
from dipper import curie_map
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
class GenotypeTestCase(unittest.TestCase):
def setUp(self):
... | 26.74359 | 65 | 0.666347 |
9b89e62eb0b6eabb2f68962db27861a100f34b81 | 58,226 | bzl | Python | bazel/repository_locations.bzl | bgregg/envoy | 190d8cba3bedcc71e73e075bbad0f583991bc1c6 | [
"Apache-2.0"
] | null | null | null | bazel/repository_locations.bzl | bgregg/envoy | 190d8cba3bedcc71e73e075bbad0f583991bc1c6 | [
"Apache-2.0"
] | 62 | 2020-11-23T22:38:20.000Z | 2022-03-31T08:24:29.000Z | bazel/repository_locations.bzl | tonya11en/envoy | ae6192d13b3ec7f76a3448629a537e120ebf835e | [
"Apache-2.0"
] | null | null | null | # This should match the schema defined in external_deps.bzl.
REPOSITORY_LOCATIONS_SPEC = dict(
bazel_compdb = dict(
project_name = "bazel-compilation-database",
project_desc = "Clang JSON compilation database support for Bazel",
project_url = "https://github.com/grailbio/bazel-compilation-da... | 50.941382 | 185 | 0.651307 |
f425a590c008955b9f4cd3e4b619f5cb8af27602 | 315 | py | Python | web-dev/simpleWebAppFlask/logger.py | joonjCode/python | 92889be7c03ce6d3faa1401d34619295cf5d1ce4 | [
"MIT"
] | null | null | null | web-dev/simpleWebAppFlask/logger.py | joonjCode/python | 92889be7c03ce6d3faa1401d34619295cf5d1ce4 | [
"MIT"
] | null | null | null | web-dev/simpleWebAppFlask/logger.py | joonjCode/python | 92889be7c03ce6d3faa1401d34619295cf5d1ce4 | [
"MIT"
] | null | null | null | import os
import datetime
BASE_DIR = os.path.dirname(__file__)
log_dir = os.path.join(BASE_DIR, 'logs')
os.makedirs(log_dir, exist_ok=True)
def trigger_log_save():
filename =f'{datetime.datetime.now()}.txt'
filepath = os.path.join(log_dir, filename)
with open(filepath, 'w+') as f:
f.write('') | 26.25 | 46 | 0.692063 |
a05d65815b7f853d6b72cdefc0724165a4d9dd07 | 2,895 | py | Python | docs/build/html/_downloads/a4d101558012b93696328dcd5ddfc33e/compiled_rosenbrock.py | jbirky/alabi | 632708890f1239e9796035ee7ad407da472df107 | [
"MIT"
] | 2 | 2022-03-04T23:17:42.000Z | 2022-03-16T22:39:34.000Z | docs/build/html/_downloads/a4d101558012b93696328dcd5ddfc33e/compiled_rosenbrock.py | jbirky/alabi | 632708890f1239e9796035ee7ad407da472df107 | [
"MIT"
] | null | null | null | docs/build/html/_downloads/a4d101558012b93696328dcd5ddfc33e/compiled_rosenbrock.py | jbirky/alabi | 632708890f1239e9796035ee7ad407da472df107 | [
"MIT"
] | null | null | null | """
Rosenbrock
==========
"""
# %%
# Initialize training function
# ----------------------------
from alabi.core import SurrogateModel
from alabi.benchmarks import rosenbrock
import alabi.visualization as vis
kernel = "ExpSquaredKernel"
benchmark = "rosenbrock"
vis.plot_true_fit_2D(eval(benchmark)["fn"], eval(bench... | 24.956897 | 102 | 0.639033 |
338a66b49bbec3b25f677f05bb66b18a3eefebfe | 3,872 | py | Python | testdata/PyFEM-master/pyfem/elements/ThermoSurface.py | Konstantin8105/py4go | 7c9f3cf0d939ad94d13abe109d15c885ca849cda | [
"MIT"
] | 3 | 2021-01-28T17:40:50.000Z | 2021-10-05T17:48:32.000Z | testdata/PyFEM-master/pyfem/elements/ThermoSurface.py | Konstantin8105/py4go | 7c9f3cf0d939ad94d13abe109d15c885ca849cda | [
"MIT"
] | 1 | 2021-07-04T14:38:48.000Z | 2021-07-04T14:38:48.000Z | testdata/PyFEM-master/pyfem/elements/ThermoSurface.py | Konstantin8105/py4go | 7c9f3cf0d939ad94d13abe109d15c885ca849cda | [
"MIT"
] | 2 | 2021-07-11T12:51:08.000Z | 2021-10-05T17:48:44.000Z | ############################################################################
# This Python file is part of PyFEM, the code that accompanies the book: #
# #
# 'Non-Linear Finite Element Analysis of Solids and Structures' #
# R. ... | 48.4 | 93 | 0.40625 |
90cb2b98a25287bfbe91605c5f173ca8954e1d13 | 2,255 | py | Python | pccommon/pccommon/middleware.py | gadomski/planetary-computer-apis | 53a04c0b24b9ccc06812bfb8ac2961bbfe58a108 | [
"MIT"
] | null | null | null | pccommon/pccommon/middleware.py | gadomski/planetary-computer-apis | 53a04c0b24b9ccc06812bfb8ac2961bbfe58a108 | [
"MIT"
] | null | null | null | pccommon/pccommon/middleware.py | gadomski/planetary-computer-apis | 53a04c0b24b9ccc06812bfb8ac2961bbfe58a108 | [
"MIT"
] | null | null | null | import logging
from typing import Awaitable, Callable
from fastapi import HTTPException, Request, Response
from fastapi.applications import FastAPI
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.types import Message
from pccommon.logging import request_to_path
from pccommon.tracing import HTT... | 30.890411 | 83 | 0.67051 |
c53a47cfdbc405d24a5a67c56ba30fd67da8b437 | 2,386 | py | Python | utils/events/PARTIALplot_detected_waveforms_HectorMine.py | sf-wilbur/FAST | 9c190c2f593a321b3318d557e33f4b3c499367d8 | [
"Apache-2.0"
] | 1 | 2020-02-11T15:59:46.000Z | 2020-02-11T15:59:46.000Z | utils/events/PARTIALplot_detected_waveforms_HectorMine.py | junlysky/FAST | 9c190c2f593a321b3318d557e33f4b3c499367d8 | [
"Apache-2.0"
] | null | null | null | utils/events/PARTIALplot_detected_waveforms_HectorMine.py | junlysky/FAST | 9c190c2f593a321b3318d557e33f4b3c499367d8 | [
"Apache-2.0"
] | 1 | 2021-06-25T13:09:29.000Z | 2021-06-25T13:09:29.000Z | from obspy import read
from obspy import UTCDateTime
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
from matplotlib import rcParams
rcParams['pdf.fonttype'] = 42
print rcParams['pdf.fonttype']
if len(sys.argv) != 3:
print "Usage: python PARTIALplot_detected_waveforms_HectorMine.py <start_... | 36.707692 | 262 | 0.753143 |
54d59dfd2b00cd05fee5e8064c509c238684bcbf | 6,303 | py | Python | BSMDEMeasuresEstimation/MeasuresCode/UnknownQueue/TCACore.py | OSADP/CVD-DME | 84e40c7c0105d90d9cf6392140101e6d5b88911e | [
"Apache-2.0"
] | null | null | null | BSMDEMeasuresEstimation/MeasuresCode/UnknownQueue/TCACore.py | OSADP/CVD-DME | 84e40c7c0105d90d9cf6392140101e6d5b88911e | [
"Apache-2.0"
] | null | null | null | BSMDEMeasuresEstimation/MeasuresCode/UnknownQueue/TCACore.py | OSADP/CVD-DME | 84e40c7c0105d90d9cf6392140101e6d5b88911e | [
"Apache-2.0"
] | null | null | null | #standard
import math
import sys
import unittest
import time
import logging
import os
def set_logger(console_level = logging.INFO, file_level = logging.DEBUG, include_file = True, append_file = False):
if not append_file:
try:
os.remove('tca2.log')
except:
pass
logger... | 28.65 | 115 | 0.508647 |
63ee93c9c84f0f62cc0ab4881746d7a1382d7d10 | 12,737 | py | Python | homeassistant/components/radiotherm/climate.py | Roeland54/core | de2e9b6d77adb7f86c6ec4aa0a50428ec8606dc3 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/radiotherm/climate.py | Roeland54/core | de2e9b6d77adb7f86c6ec4aa0a50428ec8606dc3 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/radiotherm/climate.py | Roeland54/core | de2e9b6d77adb7f86c6ec4aa0a50428ec8606dc3 | [
"Apache-2.0"
] | null | null | null | """Support for Radio Thermostat wifi-enabled home thermostats."""
from __future__ import annotations
from functools import partial
import logging
from typing import Any
import radiotherm
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.components... | 37.795252 | 91 | 0.686268 |
b0712810c663740d0f721836ac97987f40e9a8a8 | 4,593 | py | Python | pystol-ui/app/__init__.py | pystol/pystol | 95dbff08a0a1448a9b3bcc847623b59761916086 | [
"Apache-2.0"
] | 17 | 2020-03-18T13:49:23.000Z | 2022-02-17T04:38:19.000Z | pystol-ui/app/__init__.py | pystol/pystol | 95dbff08a0a1448a9b3bcc847623b59761916086 | [
"Apache-2.0"
] | 2 | 2021-05-18T07:44:34.000Z | 2021-10-07T13:49:57.000Z | pystol-ui/app/__init__.py | pystol/pystol | 95dbff08a0a1448a9b3bcc847623b59761916086 | [
"Apache-2.0"
] | 44 | 2019-10-23T20:26:31.000Z | 2021-11-12T12:19:41.000Z | #!/usr/bin/env python
"""
Copyright 2019 Pystol (pystol.org).
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | 29.824675 | 92 | 0.631831 |
c696c6cf0f4fc68a8d585c8c3ed3a9e0bbd0e5b3 | 5,579 | py | Python | tests/testChangeAuthor.py | jkjaer/latexResearchDiary | 460869ca28c5515b28e7a1c3a44c61e375fd96c0 | [
"BSD-3-Clause"
] | 6 | 2019-05-07T07:52:06.000Z | 2022-03-29T12:17:34.000Z | tests/testChangeAuthor.py | jkjaer/latexResearchDiary | 460869ca28c5515b28e7a1c3a44c61e375fd96c0 | [
"BSD-3-Clause"
] | null | null | null | tests/testChangeAuthor.py | jkjaer/latexResearchDiary | 460869ca28c5515b28e7a1c3a44c61e375fd96c0 | [
"BSD-3-Clause"
] | 2 | 2020-06-18T10:42:59.000Z | 2021-03-22T11:33:57.000Z | # -*- coding: utf-8 -*-
import unittest, os, sys, time, shutil
sys.path.append('../')
sys.path.append('../database')
sys.path.append('../logic')
import changeAuthor, newAuthor, DiaryDatabaseWrapper, commonDiaryFunctions, \
commonDiaryTestFunctions
class TestChangeAuthor(unittest.TestCase):
def setUp(self)... | 45.729508 | 84 | 0.658899 |
521b10065c36e5c72cdf0b2633639e305cee560f | 2,677 | py | Python | app/core/tests/test_models.py | wgranger/recipe-app-api | 7c9c995f7e5b6602f75240684b35db973ed49a79 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | wgranger/recipe-app-api | 7c9c995f7e5b6602f75240684b35db973ed49a79 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | wgranger/recipe-app-api | 7c9c995f7e5b6602f75240684b35db973ed49a79 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@testing.com', password='testpassword'):
"""Create sample user"""
return get_user_model().objects.create_user(email, password)
class ModelTests... | 31.494118 | 71 | 0.638028 |
8fd786e95e87f17ced0d887ceeb8a16865f189ac | 2,857 | py | Python | kvm_pirate/inject_syscall.py | Mic92/kvm-pirate | 26626db320b385f51ccb88dad76209a812c40ca6 | [
"MIT"
] | 6 | 2020-12-15T04:26:43.000Z | 2020-12-15T13:26:09.000Z | kvm_pirate/inject_syscall.py | Mic92/kvm-pirate | 26626db320b385f51ccb88dad76209a812c40ca6 | [
"MIT"
] | null | null | null | kvm_pirate/inject_syscall.py | Mic92/kvm-pirate | 26626db320b385f51ccb88dad76209a812c40ca6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import ctypes
import os
import signal
from contextlib import contextmanager
from typing import Any, Generator
from . import cpu, ptrace
from .syscalls import SYSCALL_NAMES, SYSCALL_TEXT
class SyscallError(OSError):
pass
class ExitError(SyscallError):
pass
class Process:
def __... | 28.858586 | 86 | 0.60518 |
bc3127106bdd17f9c6caac362c4b1f1ccffb69aa | 9,848 | py | Python | btb_manager_telegram/utils.py | shroukkhan/BTB-manager-telegram | 485b1c96e952aa5cc21d5532dab02e1b4a5a6822 | [
"MIT"
] | null | null | null | btb_manager_telegram/utils.py | shroukkhan/BTB-manager-telegram | 485b1c96e952aa5cc21d5532dab02e1b4a5a6822 | [
"MIT"
] | null | null | null | btb_manager_telegram/utils.py | shroukkhan/BTB-manager-telegram | 485b1c96e952aa5cc21d5532dab02e1b4a5a6822 | [
"MIT"
] | null | null | null | import configparser
import json
import os
import subprocess
from time import sleep
from typing import List, Optional
import psutil
import telegram
import yaml
from telegram import Bot
from telegram.utils.helpers import escape_markdown
import i18n
from btb_manager_telegram import logger, scheduler, settings
def setu... | 31.564103 | 116 | 0.607027 |
9576124042b61182d179aae385053d1a91a5366d | 3,207 | py | Python | kostyor_fuelccp/_misc.py | ikalnytskyi/kostyor-fuelccp | eb7432d0dbc0d8e02ab1849503e936ba4a5184e4 | [
"Apache-2.0"
] | null | null | null | kostyor_fuelccp/_misc.py | ikalnytskyi/kostyor-fuelccp | eb7432d0dbc0d8e02ab1849503e936ba4a5184e4 | [
"Apache-2.0"
] | null | null | null | kostyor_fuelccp/_misc.py | ikalnytskyi/kostyor-fuelccp | eb7432d0dbc0d8e02ab1849503e936ba4a5184e4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Mirantis
#
# 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, sof... | 23.580882 | 77 | 0.578734 |
3df84c0460b70d2c89e51bbca9b59767c203446d | 36,402 | py | Python | xarray/tests/test_computation.py | christophcc/xarray | 132733a917171fcb1f269406eb9e6668cbb7e376 | [
"Apache-2.0"
] | null | null | null | xarray/tests/test_computation.py | christophcc/xarray | 132733a917171fcb1f269406eb9e6668cbb7e376 | [
"Apache-2.0"
] | null | null | null | xarray/tests/test_computation.py | christophcc/xarray | 132733a917171fcb1f269406eb9e6668cbb7e376 | [
"Apache-2.0"
] | null | null | null | import functools
import operator
import pickle
from collections import OrderedDict
import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_array_equal
import xarray as xr
from xarray.core.computation import (
_UFuncSignature,
apply_ufunc,
broadcast_compat_data,
collect_di... | 35.137066 | 88 | 0.642025 |
4778511304f1339a7d2ee593c484da8e561bcc6c | 1,111 | py | Python | docs/user_guide/files/tensor_addition_popart_ir.py | graphcore/popart | 15ce5b098638dc34a4d41ae2a7621003458df798 | [
"MIT"
] | 61 | 2020-07-06T17:11:46.000Z | 2022-03-12T14:42:51.000Z | docs/user_guide/files/tensor_addition_popart_ir.py | graphcore/popart | 15ce5b098638dc34a4d41ae2a7621003458df798 | [
"MIT"
] | 1 | 2021-02-25T01:30:29.000Z | 2021-11-09T11:13:14.000Z | docs/user_guide/files/tensor_addition_popart_ir.py | graphcore/popart | 15ce5b098638dc34a4d41ae2a7621003458df798 | [
"MIT"
] | 6 | 2020-07-15T12:33:13.000Z | 2021-11-07T06:55:00.000Z | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import numpy as np
import popart.ir as pir
import popart.ir.ops as ops
import popart
# Creating a model with popart.ir
ir = pir.Ir()
main = ir.main_graph()
with main:
a = pir.variable(3, dtype=pir.int8, name="variable_a")
b = pir.constant(1, dtype=pir.in... | 25.837209 | 70 | 0.733573 |
1f38b978fc1a203dc8f620824b4d468078b5b60d | 1,616 | py | Python | setup.py | danielbaak/netscan2 | 262bffe6810fa12b7e5ead6cde1c5efc4edf17c1 | [
"MIT"
] | 20 | 2017-07-29T22:16:43.000Z | 2022-01-13T00:26:28.000Z | setup.py | danielbaak/netscan2 | 262bffe6810fa12b7e5ead6cde1c5efc4edf17c1 | [
"MIT"
] | 2 | 2015-08-23T08:23:00.000Z | 2015-08-26T18:36:05.000Z | setup.py | danielbaak/netscan2 | 262bffe6810fa12b7e5ead6cde1c5efc4edf17c1 | [
"MIT"
] | 13 | 2017-08-14T20:04:26.000Z | 2021-04-26T17:24:21.000Z | from setuptools import setup
import os
from netscan import __version__ as VERSION
from build_utils import BuildCommand
from build_utils import PublishCommand
from build_utils import BinaryDistribution
PACKAGE_NAME = 'netscan'
BuildCommand.pkg = PACKAGE_NAME
PublishCommand.pkg = PACKAGE_NAME
PublishCommand.version = V... | 26.491803 | 84 | 0.699257 |
db1684bbc8eff56bf2014a6536324cf490ac70a1 | 316 | py | Python | openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | 87 | 2021-05-07T08:40:46.000Z | 2022-03-19T00:36:25.000Z | openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | 1,019 | 2021-04-26T06:22:56.000Z | 2022-03-31T16:30:43.000Z | openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | 33 | 2021-04-29T12:35:54.000Z | 2022-03-25T14:48:42.000Z | from openpype.hosts.maya.api import plugin
class CreateUnrealStaticMesh(plugin.Creator):
name = "staticMeshMain"
label = "Unreal - Static Mesh"
family = "unrealStaticMesh"
icon = "cube"
def __init__(self, *args, **kwargs):
super(CreateUnrealStaticMesh, self).__init__(*args, **kwargs)
| 26.333333 | 69 | 0.693038 |
62083a2ea4c54562a07a28a7fecee7306b0303c5 | 1,032 | py | Python | _functoin_/6_0_function.py | edisonlz/c1_course_python | e6838596ca118c62ee533176d731efa65f62bf85 | [
"Apache-2.0"
] | 1 | 2019-12-23T13:34:31.000Z | 2019-12-23T13:34:31.000Z | _functoin_/6_0_function.py | edisonlz/c1_course_python | e6838596ca118c62ee533176d731efa65f62bf85 | [
"Apache-2.0"
] | null | null | null | _functoin_/6_0_function.py | edisonlz/c1_course_python | e6838596ca118c62ee533176d731efa65f62bf85 | [
"Apache-2.0"
] | null | null | null |
1.函数的定义
def 定义函数关键字
show 函数名称
(me) 参数
return 返回值
def show(me):
print("%s is here!" % me)
return "Done"
show("ed")
2.函数接受任意数量的位置参数,可以使用一个 * 参数
def avg(first, *rest):
print(first)
print(rest)
print(type(rest))
return (first + sum(rest)) / (1 + len(rest))
avg(1, 2, 3, 4)
3.接受任意数量... | 13.578947 | 49 | 0.55814 |
5794948bf84bb6e69facc0af67a5fc88ab9b9aba | 760 | py | Python | tests/dockpulp/__init__.py | jpopelka/atomic-reactor | 49889a5a0115fd76bd59402b18c1294cd2249374 | [
"BSD-3-Clause"
] | null | null | null | tests/dockpulp/__init__.py | jpopelka/atomic-reactor | 49889a5a0115fd76bd59402b18c1294cd2249374 | [
"BSD-3-Clause"
] | null | null | null | tests/dockpulp/__init__.py | jpopelka/atomic-reactor | 49889a5a0115fd76bd59402b18c1294cd2249374 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2016 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
log = None
def setup_logger(logger):
raise RuntimeError
class Pulp(object):
"""
dockpulp.Pulp stub
"""
def __init__(... | 20.540541 | 79 | 0.648684 |
1371f580c6a2157f287cdf106bcafc09f317c5f7 | 7,187 | py | Python | DjangoTutorial_v3.5/test_helper.py | SSD1805/pycharm-courses | d58b9c945c11c320fc7f50878994f377ccda3e4f | [
"Apache-2.0"
] | null | null | null | DjangoTutorial_v3.5/test_helper.py | SSD1805/pycharm-courses | d58b9c945c11c320fc7f50878994f377ccda3e4f | [
"Apache-2.0"
] | null | null | null | DjangoTutorial_v3.5/test_helper.py | SSD1805/pycharm-courses | d58b9c945c11c320fc7f50878994f377ccda3e4f | [
"Apache-2.0"
] | null | null | null | import sys
def get_file_text(path):
""" Returns file text by path"""
with open(path, "r") as file_io:
text = file_io.read()
return text
def get_file_output(encoding="utf-8", path=sys.argv[-1], arg_string=""):
"""
Returns answer file output
:param encoding: to decode output in python3... | 27.536398 | 119 | 0.613608 |
1744e4bb2dab9241550a9b080d33fb0732ef3f35 | 6,091 | py | Python | applied-statistics/lab/experiment-5/version1.py | TXM-DOOM/B.Tech-CSE-Y2 | 763436ae866f1f18fa8071c253d005bdf289532f | [
"MIT"
] | null | null | null | applied-statistics/lab/experiment-5/version1.py | TXM-DOOM/B.Tech-CSE-Y2 | 763436ae866f1f18fa8071c253d005bdf289532f | [
"MIT"
] | null | null | null | applied-statistics/lab/experiment-5/version1.py | TXM-DOOM/B.Tech-CSE-Y2 | 763436ae866f1f18fa8071c253d005bdf289532f | [
"MIT"
] | null | null | null | # Code by Desh Iyer
# ----------------------------------------------------------------
# PROBLEM STATEMENT
# Import the z table as a data structure in python. Create some 5 demo examples to find the area under the curve and report the answer from the z-table.
# ----------------------------------------------------... | 35.829412 | 328 | 0.686423 |
b1791822df5432112ad05c2d567381628f264ee0 | 757 | py | Python | scons/templates/wheezy_py3_mpi_options.py | svn2github/Escript | 9c616a3b164446c65d4b8564ecd04fafd7dcf0d2 | [
"Apache-2.0"
] | null | null | null | scons/templates/wheezy_py3_mpi_options.py | svn2github/Escript | 9c616a3b164446c65d4b8564ecd04fafd7dcf0d2 | [
"Apache-2.0"
] | 1 | 2019-01-14T03:07:43.000Z | 2019-01-14T03:07:43.000Z | scons/templates/wheezy_py3_mpi_options.py | svn2github/Escript | 9c616a3b164446c65d4b8564ecd04fafd7dcf0d2 | [
"Apache-2.0"
] | null | null | null |
##############################################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | 31.541667 | 78 | 0.610304 |
6562057df8c66f2c66da0f979b36b6122d0ed422 | 1,464 | py | Python | somegame/level_transition_overlay.py | kodo-pp/somegame-but-not-that-one | 6252d34b84fe7c83ada9e699df17688c50dd7596 | [
"MIT"
] | null | null | null | somegame/level_transition_overlay.py | kodo-pp/somegame-but-not-that-one | 6252d34b84fe7c83ada9e699df17688c50dd7596 | [
"MIT"
] | null | null | null | somegame/level_transition_overlay.py | kodo-pp/somegame-but-not-that-one | 6252d34b84fe7c83ada9e699df17688c50dd7596 | [
"MIT"
] | null | null | null | import math
from somegame.util import SpriteBase
class LevelTransitionOverlay(SpriteBase):
def __init__(self, game, image, powerup_image=None):
super().__init__(game)
self.image = image.convert(24)
if powerup_image is not None:
rect = powerup_image.get_rect()
rect.... | 28.153846 | 59 | 0.545765 |
902eab1f59b8977dda59e39dea18079b558e2f8c | 981 | py | Python | Dayyip/commands/info.py | TheDeadStalker/DiscordBot-Dayyip | 6616cc003708a141885e4749f728abd96ba92d8a | [
"MIT"
] | null | null | null | Dayyip/commands/info.py | TheDeadStalker/DiscordBot-Dayyip | 6616cc003708a141885e4749f728abd96ba92d8a | [
"MIT"
] | null | null | null | Dayyip/commands/info.py | TheDeadStalker/DiscordBot-Dayyip | 6616cc003708a141885e4749f728abd96ba92d8a | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
class infocommands(commands.Cog):
def __init__(self,bot):
self.bot = bot
@commands.command()
async def bilgi(self,mesaj):
embed = discord.Embed(title="Receb Dayyip Ersoğan - Evren Bashganım ",
description... | 49.05 | 156 | 0.666667 |
95eec83912f4c130ac9b3428855dccef4f91d579 | 2,345 | py | Python | Collections-a-installer/community-general-2.4.0/scripts/inventory/openvz.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | Collections-a-installer/community-general-2.4.0/scripts/inventory/openvz.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | Collections-a-installer/community-general-2.4.0/scripts/inventory/openvz.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# openvz.py
#
# Copyright 2014 jordonr <jordon@beamsyn.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Inspired by libvirt_lxc.py inventory script
# https://github.com/ansible/ansible/blob/e5ef0eca03cbb6c8950c06dc50d0c... | 31.266667 | 115 | 0.601279 |
820c7ffdcc159e29b0e28345f8cc718b75e840a6 | 854 | py | Python | synced-music/core/util/audio.py | jojonas/synced-music | 938d86dd8ce3fa4376f6bb25c3d58ca4354a692e | [
"MIT"
] | 1 | 2022-03-07T12:12:53.000Z | 2022-03-07T12:12:53.000Z | synced-music/core/util/audio.py | jojonas/synced-music | 938d86dd8ce3fa4376f6bb25c3d58ca4354a692e | [
"MIT"
] | null | null | null | synced-music/core/util/audio.py | jojonas/synced-music | 938d86dd8ce3fa4376f6bb25c3d58ca4354a692e | [
"MIT"
] | null | null | null | import pyaudio
# Mostly synced-music is written to be rather robust in the sense that server and client don't have to
# have many variables that should be set according to each other. Most of the configurable values are
# rather free to set on both sides with the other side mostly adapting to it. Including the port in... | 40.666667 | 111 | 0.799766 |
ffc8c716d8948cf48fc349608a0f3412406adc58 | 493 | py | Python | WeatheringModel/simple_example.py | olehmer/CarbSilWeathering | 27b9d67028135dd06d89498c16c424574c41fa9e | [
"MIT"
] | 1 | 2020-10-01T00:21:14.000Z | 2020-10-01T00:21:14.000Z | WeatheringModel/simple_example.py | olehmer/CarbSilWeathering | 27b9d67028135dd06d89498c16c424574c41fa9e | [
"MIT"
] | null | null | null | WeatheringModel/simple_example.py | olehmer/CarbSilWeathering | 27b9d67028135dd06d89498c16c424574c41fa9e | [
"MIT"
] | 1 | 2020-10-28T17:54:55.000Z | 2020-10-28T17:54:55.000Z | from weatheringmodel import runWeatheringModel, ModelInputs
#First create an input object. Use this object to change the input parameters.
inpts = ModelInputs() #default values are for modern Earth
inpts.lum = 0.9 #set the incident flux to 90% modern Earth's
#Call the model and pass in the inputs.
times, Co, Ao, pCO... | 32.866667 | 78 | 0.730223 |
0fc0e65de4c848308ce15c9874553ba3f922eeaf | 1,865 | py | Python | setup.py | syhw/DTW_Cython | c8a6e0c69d5b17230ddfc97fdc37806ca735124b | [
"MIT"
] | 2 | 2016-11-29T13:08:58.000Z | 2017-02-20T11:22:38.000Z | setup.py | syhw/DTW_Cython | c8a6e0c69d5b17230ddfc97fdc37806ca735124b | [
"MIT"
] | null | null | null | setup.py | syhw/DTW_Cython | c8a6e0c69d5b17230ddfc97fdc37806ca735124b | [
"MIT"
] | 4 | 2017-02-20T11:22:44.000Z | 2020-02-29T03:17:35.000Z | import os, sys
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
from distutils.sysconfig import *
from distutils.util import *
from Cython.... | 34.537037 | 68 | 0.563003 |
af11a965391c466247fbb58ba2aec405d525e0fc | 24,509 | py | Python | applied_python/applied_python/lib/python2.7/site-packages/ansible/modules/core/cloud/amazon/ec2_vpc.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/ansible/modules/core/cloud/amazon/ec2_vpc.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/ansible/modules/core/cloud/amazon/ec2_vpc.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | 38.657729 | 776 | 0.594884 |
6142772f5c7c63fb6caff701539d5631b16ea360 | 11,401 | py | Python | RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | RecoHI/HiTracking/python/hiLowPtTripletStep_cff.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
# NEW CLUSTERS (remove previously used clusters)
hiLowPtTripletStepClusters = cms.EDProducer("HITrackClusterRemover",
clusterLessSolution= cms.bool(True),
oldClusterRemovalInfo = cms.In... | 45.422311 | 148 | 0.730462 |
08cf45d8a7a0f24e851ac181d234132e091823ca | 836 | py | Python | yatube/posts/urls.py | ShumilovAlexandr/yatube_project | 49770f2788b61f565ec9652a25eef6edbd20ed9c | [
"MIT"
] | null | null | null | yatube/posts/urls.py | ShumilovAlexandr/yatube_project | 49770f2788b61f565ec9652a25eef6edbd20ed9c | [
"MIT"
] | null | null | null | yatube/posts/urls.py | ShumilovAlexandr/yatube_project | 49770f2788b61f565ec9652a25eef6edbd20ed9c | [
"MIT"
] | null | null | null | """yatube_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 33.44 | 77 | 0.700957 |
30a162420115273f641173202c7cef5a26941c1d | 2,116 | py | Python | xor_exploration.py | Ezra/heavens-vault-dictionary | 6389f94edc210355b5fcc1cb2aa9d0f4a4a9d985 | [
"MIT"
] | null | null | null | xor_exploration.py | Ezra/heavens-vault-dictionary | 6389f94edc210355b5fcc1cb2aa9d0f4a4a9d985 | [
"MIT"
] | null | null | null | xor_exploration.py | Ezra/heavens-vault-dictionary | 6389f94edc210355b5fcc1cb2aa9d0f4a4a9d985 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
import sys
from myio.myio import auto_open
from myio.util import toggle_prefix
# File format:
# Six-byte header. Constant. By inspection you can tell
# whether the xor encryption has been applied.
# line 0 (JSON): file format info (format version number)
# blank line
# line... | 26.45 | 74 | 0.653119 |
54cb66218f332bf7b481cc8612445d2d8b906100 | 191,302 | py | Python | src/aks-preview/azext_aks_preview/custom.py | guanzhousongmicrosoft/azure-cli-extensions | 623f8ae45ee3c010ebc4db52f90049105fa9b865 | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/custom.py | guanzhousongmicrosoft/azure-cli-extensions | 623f8ae45ee3c010ebc4db52f90049105fa9b865 | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/custom.py | guanzhousongmicrosoft/azure-cli-extensions | 623f8ae45ee3c010ebc4db52f90049105fa9b865 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... | 45.310753 | 300 | 0.636956 |
c2bf6bf40c41bff3e0d9d689b586b860e9bb93d7 | 6,550 | py | Python | qiskit_experiments/library/tomography/qpt_experiment.py | spencerking/qiskit-experiments | 11a254b010afe35933aaabac70de12b5b5a244bf | [
"Apache-2.0"
] | null | null | null | qiskit_experiments/library/tomography/qpt_experiment.py | spencerking/qiskit-experiments | 11a254b010afe35933aaabac70de12b5b5a244bf | [
"Apache-2.0"
] | null | null | null | qiskit_experiments/library/tomography/qpt_experiment.py | spencerking/qiskit-experiments | 11a254b010afe35933aaabac70de12b5b5a244bf | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# 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 derivative wo... | 47.463768 | 96 | 0.678779 |
e7ffd76e9ba601302dd2cbc226c2a65a2fe43d8f | 23,111 | py | Python | scripts/netcdf_utils.py | noaa-nws-cpc/climate_indices | 2c06f269be30ce855ebdc031eb9b65144aed7a6a | [
"Unlicense",
"BSD-3-Clause"
] | 2 | 2019-02-20T19:42:55.000Z | 2020-02-01T16:40:35.000Z | scripts/netcdf_utils.py | rongwuy/climate_indices | 2c06f269be30ce855ebdc031eb9b65144aed7a6a | [
"Unlicense",
"BSD-3-Clause"
] | null | null | null | scripts/netcdf_utils.py | rongwuy/climate_indices | 2c06f269be30ce855ebdc031eb9b65144aed7a6a | [
"Unlicense",
"BSD-3-Clause"
] | 1 | 2018-06-21T19:00:03.000Z | 2018-06-21T19:00:03.000Z | from datetime import datetime
import logging
import netCDF4
import numpy as np
import os
import random
from climate_indices import utils
#-----------------------------------------------------------------------------------------------------------------------
# set up a basic, global _logger
logging.basicCon... | 49.488223 | 132 | 0.576522 |
6b93f926cdf235129cf7f98a429c64aca49f9b21 | 204 | py | Python | mindhome_alpha/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | mindhome_alpha/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | null | null | null | mindhome_alpha/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'payment_order',
'transactions': [
{
'items': ['Payment Entry', 'Journal Entry']
}
]
} | 17 | 47 | 0.651961 |
47652cc7a92641df34c3387c720d99f2727e4001 | 1,154 | py | Python | gallery_plugins/plugin_xVideos_gallery.py | rpplusplus/gallery_get | e62198abe77c8ef4323eb97489220bcf73ce72d5 | [
"MIT"
] | null | null | null | gallery_plugins/plugin_xVideos_gallery.py | rpplusplus/gallery_get | e62198abe77c8ef4323eb97489220bcf73ce72d5 | [
"MIT"
] | null | null | null | gallery_plugins/plugin_xVideos_gallery.py | rpplusplus/gallery_get | e62198abe77c8ef4323eb97489220bcf73ce72d5 | [
"MIT"
] | null | null | null | # Plugin for gallery_get.
import re
# Each definition can be one of the following:
# - a string
# - a regex string
# - a function that takes source as a parameter and returns an array or a string. (You may assume that re and urllib are already imported.)
# If you comment out a parameter, it will use the default defin... | 50.173913 | 149 | 0.746101 |
a26fe2dda1311f1b002107887a455558649337bc | 30,520 | py | Python | babyai/imitation.py | MathijsMul/babyai-emergent-guidance | 9e37535134c89bd019affa51c7f199d1672811b6 | [
"BSD-3-Clause"
] | null | null | null | babyai/imitation.py | MathijsMul/babyai-emergent-guidance | 9e37535134c89bd019affa51c7f199d1672811b6 | [
"BSD-3-Clause"
] | null | null | null | babyai/imitation.py | MathijsMul/babyai-emergent-guidance | 9e37535134c89bd019affa51c7f199d1672811b6 | [
"BSD-3-Clause"
] | null | null | null | import copy
import gym
import time
import datetime
import numpy as np
import sys
import itertools
import torch
from babyai.evaluate import batch_evaluate
import babyai.utils as utils
from babyai.rl import DictList
from babyai.model import ACModel
import multiprocessing
import os
import json
import logging
from sklearn... | 46.666667 | 168 | 0.572543 |
ae3f05a669d6654a8c97bbe386dbe50ce5e68ccf | 2,410 | py | Python | test/test_files/pylops/pylops/utils/utils.py | SoftwareUnderstanding/inspect4py | 9c4d7252535082ad938b26baf281d93f3a27285e | [
"BSD-3-Clause"
] | 2 | 2022-02-15T20:30:57.000Z | 2022-03-17T00:50:37.000Z | test/test_files/pylops/pylops/utils/utils.py | SoftwareUnderstanding/code_inspector | a820b5a7bb18f5df9c3e79346108d8280b20c39a | [
"BSD-3-Clause"
] | 101 | 2021-06-09T14:19:59.000Z | 2022-01-24T13:24:39.000Z | test/test_files/pylops/pylops/utils/utils.py | SoftwareUnderstanding/inspect4py | 9c4d7252535082ad938b26baf281d93f3a27285e | [
"BSD-3-Clause"
] | 1 | 2021-09-22T06:59:32.000Z | 2021-09-22T06:59:32.000Z | # scooby is a soft dependency for pylops
try:
from scooby import Report as ScoobyReport
except ImportError:
class ScoobyReport:
def __init__(self, additional, core, optional, ncol, text_width, sort):
print("\nNOTE: `pylops.Report` requires `scooby`. Install it via"
"\n ... | 33.472222 | 79 | 0.616598 |
ee120fc4efbd27fe1912993a2b6917f9737b6717 | 24,115 | py | Python | pay-api/src/pay_api/services/cfs_service.py | saravanpa-aot/sbc-pay | fb9f61b99e506e43280bc69531ee107cc12cd92d | [
"Apache-2.0"
] | null | null | null | pay-api/src/pay_api/services/cfs_service.py | saravanpa-aot/sbc-pay | fb9f61b99e506e43280bc69531ee107cc12cd92d | [
"Apache-2.0"
] | null | null | null | pay-api/src/pay_api/services/cfs_service.py | saravanpa-aot/sbc-pay | fb9f61b99e506e43280bc69531ee107cc12cd92d | [
"Apache-2.0"
] | 5 | 2019-03-01T01:12:12.000Z | 2019-07-08T16:33:47.000Z | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 50.239583 | 119 | 0.627701 |
4f12e8c13086892c91dcd959adc64a2882b2a11c | 54,373 | py | Python | test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 39.89215 | 112 | 0.586137 |
adb36737532a991701f53394322756109727e532 | 15,900 | py | Python | metar/Datatypes.py | mkjunker/python-metar | ba599ad78f8e7d2f46849a5e98106a6221d1f787 | [
"BSD-1-Clause"
] | 136 | 2018-07-25T06:44:30.000Z | 2022-03-29T18:39:03.000Z | metar/Datatypes.py | mkjunker/python-metar | ba599ad78f8e7d2f46849a5e98106a6221d1f787 | [
"BSD-1-Clause"
] | 125 | 2018-07-22T19:00:41.000Z | 2022-03-30T13:28:44.000Z | metar/Datatypes.py | mkjunker/python-metar | ba599ad78f8e7d2f46849a5e98106a6221d1f787 | [
"BSD-1-Clause"
] | 66 | 2018-07-22T18:57:23.000Z | 2022-03-10T18:29:28.000Z | # Copyright (c) 2004,2018 Python-Metar Developers.
# Distributed under the terms of the BSD 2-Clause License.
# SPDX-License-Identifier: BSD-2-Clause
"""Python classes to represent dimensioned quantities used in weather reports.
"""
import re
from math import sin, cos, atan2, sqrt
# exceptions
class UnitsError(Excep... | 32.581967 | 87 | 0.51566 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.