hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7479d47d68e9fe3cd0ca67bc1a3837be3f1d6e9 | 2,156 | py | Python | pysnmp/SUPERMICRO-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/SUPERMICRO-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/SUPERMICRO-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SUPERMICRO-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SUPERMICRO-SMI
# Produced by pysmi-0.3.4 at Mon Apr 29 21:04:30 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 93.73913 | 505 | 0.78525 |
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuild... | true | true |
f7479d944404ffef1df7ac15eba4b8cbcda06d47 | 1,993 | py | Python | app/core/tests/test_models.py | trstocks/recipe-app-api | 6b8531365a9334613018955dac502c76939d66d9 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | trstocks/recipe-app-api | 6b8531365a9334613018955dac502c76939d66d9 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | trstocks/recipe-app-api | 6b8531365a9334613018955dac502c76939d66d9 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@ceratopsdev.com', password='testPass'):
"""Create a sample user"""
return get_user_model().objects.create_user(email, password)
class ModelTests(TestCase):
def test_create_... | 33.216667 | 69 | 0.64576 | from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@ceratopsdev.com', password='testPass'):
return get_user_model().objects.create_user(email, password)
class ModelTests(TestCase):
def test_create_user_with_email_successful(self... | true | true |
f7479eac9e9c4697f6fb040e22d009a76ee5125a | 2,170 | py | Python | polII-wf/scripts/plot_boxplot_polII.py | jfear/larval_gonad | 624a71741864b74e0372f89bdcca578e5cca3722 | [
"MIT"
] | 1 | 2019-09-13T13:24:18.000Z | 2019-09-13T13:24:18.000Z | polII-wf/scripts/plot_boxplot_polII.py | jfear/larval_gonad | 624a71741864b74e0372f89bdcca578e5cca3722 | [
"MIT"
] | 65 | 2019-07-24T16:23:08.000Z | 2020-03-06T22:18:47.000Z | polII-wf/scripts/plot_boxplot_polII.py | jfear/larval_gonad | 624a71741864b74e0372f89bdcca578e5cca3722 | [
"MIT"
] | 1 | 2021-06-02T19:09:35.000Z | 2021-06-02T19:09:35.000Z | """Playing with plots for galletta"""
import os
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from scipy.stats import ttest_ind
from larval_gonad.plotting.stats import pval_to_string
def main():
plt.style.use(["2c", "science_base"])
fig, ... | 28.552632 | 106 | 0.649309 | import os
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from scipy.stats import ttest_ind
from larval_gonad.plotting.stats import pval_to_string
def main():
plt.style.use(["2c", "science_base"])
fig, (ax1, ax2) = plt.subplots(1, 2, figsiz... | true | true |
f7479ee917f94d0dd68d4355400184538d3afd89 | 243 | py | Python | other/remove_pdf_extra_newline_and_blank.py | zzvsjs1/MyPyScripts | 0b161d8a0096c5253d2c6a9e7d5c9bebcfbe0f07 | [
"MIT"
] | null | null | null | other/remove_pdf_extra_newline_and_blank.py | zzvsjs1/MyPyScripts | 0b161d8a0096c5253d2c6a9e7d5c9bebcfbe0f07 | [
"MIT"
] | null | null | null | other/remove_pdf_extra_newline_and_blank.py | zzvsjs1/MyPyScripts | 0b161d8a0096c5253d2c6a9e7d5c9bebcfbe0f07 | [
"MIT"
] | null | null | null | import re
import pyperclip
def remove(string: str):
return re.sub(r'\s+', ' ', string)
# return re.sub(r' {2,}', ' ', re.sub(r'\s+', ' ', string))
if __name__ == '__main__':
pyperclip.copy(remove(pyperclip.paste()))
| 20.25 | 64 | 0.563786 | import re
import pyperclip
def remove(string: str):
return re.sub(r'\s+', ' ', string)
if __name__ == '__main__':
pyperclip.copy(remove(pyperclip.paste()))
| true | true |
f7479f1a05ace202d6234fbd90b428551eb021a1 | 7,989 | py | Python | testplan/testing/cpp/cppunit.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | testplan/testing/cpp/cppunit.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | testplan/testing/cpp/cppunit.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | import os
from schema import Or
from testplan.common.config import ConfigOption
from ..base import ProcessRunnerTest, ProcessRunnerTestConfig
from ...importers.cppunit import CPPUnitResultImporter, CPPUnitImportedResult
class CppunitConfig(ProcessRunnerTestConfig):
"""
Configuration object for :py:class:`~... | 35.506667 | 80 | 0.620729 | import os
from schema import Or
from testplan.common.config import ConfigOption
from ..base import ProcessRunnerTest, ProcessRunnerTestConfig
from ...importers.cppunit import CPPUnitResultImporter, CPPUnitImportedResult
class CppunitConfig(ProcessRunnerTestConfig):
@classmethod
def get_options(cls):
... | true | true |
f747a128dd5f65a9a77ed19626010476b4bedd9c | 2,337 | py | Python | veriloggen/types/util.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | veriloggen/types/util.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | veriloggen/types/util.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import math
import veriloggen.core.vtypes as vtypes
import veriloggen.seq.seq as seq
t_Input = 'Input'
t_Output = 'Output'
t_Wire = 'Wire'
t_Reg = 'Reg'
t_OutputReg = 'OutputReg'
def swap_type(cls):
return cls._O, cls._I
def make_po... | 26.556818 | 64 | 0.650407 | from __future__ import absolute_import
from __future__ import print_function
import math
import veriloggen.core.vtypes as vtypes
import veriloggen.seq.seq as seq
t_Input = 'Input'
t_Output = 'Output'
t_Wire = 'Wire'
t_Reg = 'Reg'
t_OutputReg = 'OutputReg'
def swap_type(cls):
return cls._O, cls._I
def make_po... | true | true |
f747a137f6b9b07a00971eac458b7351f435900e | 849 | py | Python | timeapp/urls.py | jameskomo/time-management-system | 0f3f24db276b2d6e4fcd86a71b368cae512d90fc | [
"MIT"
] | 1 | 2020-07-26T11:37:40.000Z | 2020-07-26T11:37:40.000Z | timeapp/urls.py | jameskomo/time-management-system | 0f3f24db276b2d6e4fcd86a71b368cae512d90fc | [
"MIT"
] | 10 | 2020-02-12T00:39:16.000Z | 2022-02-10T07:47:02.000Z | timeapp/urls.py | jameskomo/time-management-system | 0f3f24db276b2d6e4fcd86a71b368cae512d90fc | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf.urls import url
from .views import (
PostListView,
PostDetailView,
PostCreateView,
PostUpdateView,
PostDeleteView,
)
from . import views
urlpatterns = [
path('', PostListView.as_view(), name='timeapp-home'),
path('post/<int:pk>/', PostDetailVie... | 35.375 | 80 | 0.667845 | from django.urls import path
from django.conf.urls import url
from .views import (
PostListView,
PostDetailView,
PostCreateView,
PostUpdateView,
PostDeleteView,
)
from . import views
urlpatterns = [
path('', PostListView.as_view(), name='timeapp-home'),
path('post/<int:pk>/', PostDetailVie... | true | true |
f747a25cb33515649e1486af9ce9335f320c79d2 | 3,360 | py | Python | frappe/email/doctype/email_alert/test_email_alert.py | khatrijitendra/lumalock-frappe | b3864278dad21dde5c53604be65aa56c79e5d909 | [
"MIT"
] | null | null | null | frappe/email/doctype/email_alert/test_email_alert.py | khatrijitendra/lumalock-frappe | b3864278dad21dde5c53604be65aa56c79e5d909 | [
"MIT"
] | 7 | 2020-03-24T17:07:47.000Z | 2022-03-11T23:49:25.000Z | frappe/email/doctype/email_alert/test_email_alert.py | khatrijitendra/lumalock-frappe | b3864278dad21dde5c53604be65aa56c79e5d909 | [
"MIT"
] | 3 | 2016-01-19T10:59:53.000Z | 2018-03-21T16:26:43.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe, frappe.utils, frappe.utils.scheduler
import unittest
test_records = frappe.get_test_records('Email Alert')
class TestEmailAlert(unittest.TestCase):
def setUp(self):
frappe.... | 33.6 | 90 | 0.71369 |
from __future__ import unicode_literals
import frappe, frappe.utils, frappe.utils.scheduler
import unittest
test_records = frappe.get_test_records('Email Alert')
class TestEmailAlert(unittest.TestCase):
def setUp(self):
frappe.db.sql("""delete from `tabBulk Email`""")
frappe.set_user("test1@example.com")
de... | true | true |
f747a26df397b4ab55a8d72ca915d2fec125bd2f | 2,614 | py | Python | homeassistant/components/sensor/rainmachine.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | homeassistant/components/sensor/rainmachine.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2021-09-08T03:06:43.000Z | 2022-03-12T00:56:04.000Z | homeassistant/components/sensor/rainmachine.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2018-10-09T08:37:48.000Z | 2019-11-16T08:32:27.000Z | """
This platform provides support for sensor data from RainMachine.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rainmachine/
"""
import logging
from homeassistant.components.rainmachine import (
DATA_RAINMACHINE, SENSOR_UPDATE_TOPIC, SENS... | 29.044444 | 76 | 0.674828 | import logging
from homeassistant.components.rainmachine import (
DATA_RAINMACHINE, SENSOR_UPDATE_TOPIC, SENSORS, RainMachineEntity)
from homeassistant.const import CONF_MONITORED_CONDITIONS
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
DEPENDENCIES ... | true | true |
f747a292c1faff5cac56ac5fe3ddced9c9b86c5d | 4,284 | py | Python | Chatbot_Model/Info_Extraction/Entity_Extraction/data.py | chenpocufa/Chatbot_CN | 5e13c129c159143610f4dfc99478d401dd5777e6 | [
"Apache-2.0"
] | 1 | 2019-08-02T06:09:34.000Z | 2019-08-02T06:09:34.000Z | Chatbot_Model/Info_Extraction/Entity_Extraction/data.py | yuxuan2015/Chatbot_CN | 1adf1c01d3eced5f0644102bdec9be22705b6f3f | [
"Apache-2.0"
] | null | null | null | Chatbot_Model/Info_Extraction/Entity_Extraction/data.py | yuxuan2015/Chatbot_CN | 1adf1c01d3eced5f0644102bdec9be22705b6f3f | [
"Apache-2.0"
] | 1 | 2019-06-10T00:36:17.000Z | 2019-06-10T00:36:17.000Z | #-*- coding:utf-8 _*-
"""
@author:charlesXu
@file: data.py
@desc: 构建字向量、词向量
@time: 2018/08/08
"""
import sys, pickle, os, random
import numpy as np
import pdb
## tags, BIO 标注策略 标签矩阵
tag2label = {"O": 0,
"B-PER": 1, "I-PER": 2,
"B-LOC": 3, "I-LOC": 4,
"B-ORG": 5, "I-ORG": 6,
... | 23.8 | 107 | 0.556256 |
import sys, pickle, os, random
import numpy as np
import pdb
"B-PER": 1, "I-PER": 2,
"B-LOC": 3, "I-LOC": 4,
"B-ORG": 5, "I-ORG": 6,
"B-TIM": 7, "I-TIM": 8
}
def read_corpus(corpus_path):
data = []
with open(corpus_path, encoding='utf-8') a... | true | true |
f747a3188030106f3e5bead83261a715ef2d38a9 | 41 | py | Python | dwdbulk/__init__.py | hoetzgit/dwdbulk | 780d784c04a46d64d427b8a7aec303805a842d53 | [
"MIT"
] | 7 | 2020-01-07T23:31:27.000Z | 2020-07-28T12:44:04.000Z | dwdbulk/__init__.py | hoetzgit/dwdbulk | 780d784c04a46d64d427b8a7aec303805a842d53 | [
"MIT"
] | 4 | 2020-01-08T08:08:41.000Z | 2020-09-28T06:30:15.000Z | dwdbulk/__init__.py | hoetzgit/dwdbulk | 780d784c04a46d64d427b8a7aec303805a842d53 | [
"MIT"
] | 4 | 2020-02-10T21:42:49.000Z | 2020-06-11T01:07:26.000Z | from .api import forecasts, observations
| 20.5 | 40 | 0.829268 | from .api import forecasts, observations
| true | true |
f747a333e3e9f86072e8c3c3d1f6275b338d8f82 | 409 | py | Python | endorsement/test/support/test_notifications.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | 3 | 2017-10-16T17:19:32.000Z | 2019-07-31T22:31:48.000Z | endorsement/test/support/test_notifications.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | 284 | 2016-06-17T18:21:31.000Z | 2022-03-21T16:55:03.000Z | endorsement/test/support/test_notifications.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from endorsement.test.support import SupportApiTest
class TestSupportNotifications(SupportApiTest):
@property
def reverse_id(self):
return 'endorsee_notifications'
def test_statistics(self):
self._test_... | 25.5625 | 51 | 0.748166 |
from endorsement.test.support import SupportApiTest
class TestSupportNotifications(SupportApiTest):
@property
def reverse_id(self):
return 'endorsee_notifications'
def test_statistics(self):
self._test_good_page()
def test_bogus_user_statistics(self):
self._test_invalid_use... | true | true |
f747a38fbb26a5157c21b6d60ed98e858e4c0dcd | 8,191 | py | Python | commands/song.py | Princ3x/ddmbot | 088eb6b46447a1ec184b1bc7fea493b66ee35284 | [
"MIT"
] | 8 | 2016-12-13T17:52:51.000Z | 2019-06-23T22:11:42.000Z | commands/song.py | Princ3x/ddmbot | 088eb6b46447a1ec184b1bc7fea493b66ee35284 | [
"MIT"
] | 13 | 2016-12-13T17:35:09.000Z | 2017-07-08T10:53:51.000Z | commands/song.py | Princ3x/ddmbot | 088eb6b46447a1ec184b1bc7fea493b66ee35284 | [
"MIT"
] | 4 | 2016-12-13T17:52:53.000Z | 2019-01-01T17:43:33.000Z | import discord.ext.commands as dec
import database.song
from commands.common import *
class Song:
"""Song insertion, querying and manipulation"""
def __init__(self, bot):
self._bot = bot
self._db = database.song.SongInterface(bot.loop)
_help_messages = {
'group': 'Song informatio... | 56.881944 | 120 | 0.652545 | import discord.ext.commands as dec
import database.song
from commands.common import *
class Song:
def __init__(self, bot):
self._bot = bot
self._db = database.song.SongInterface(bot.loop)
_help_messages = {
'group': 'Song information, querying and manipulation',
'blacklist':... | true | true |
f747a39a401dfc0e13b704b316a3fb06d66e49d9 | 1,527 | py | Python | cleanapp/migrations/0001_initial.py | naorsa/CleanApp | 8e8e66edaaf1e774dee99019abb37000a2de7417 | [
"Apache-2.0"
] | null | null | null | cleanapp/migrations/0001_initial.py | naorsa/CleanApp | 8e8e66edaaf1e774dee99019abb37000a2de7417 | [
"Apache-2.0"
] | null | null | null | cleanapp/migrations/0001_initial.py | naorsa/CleanApp | 8e8e66edaaf1e774dee99019abb37000a2de7417 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-08-15 12:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateM... | 33.933333 | 161 | 0.569745 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
... | true | true |
f747a453c6f5c533aa4b0430c7c325a3824061ba | 2,380 | py | Python | trioasm/whatshap/build/lib.linux-x86_64-3.6/whatshap/__main__.py | shilpagarg/WHdenovo | 7a03798397ee0f131f100402d12ad53eab4334dc | [
"MIT"
] | 45 | 2019-03-18T06:57:23.000Z | 2021-06-24T12:24:48.000Z | trioasm/whatshap/build/lib.linux-x86_64-3.7/whatshap/__main__.py | shilpagarg/WHdenovo | 7a03798397ee0f131f100402d12ad53eab4334dc | [
"MIT"
] | 2 | 2019-05-06T22:11:22.000Z | 2020-01-10T15:14:40.000Z | trioasm/whatshap/build/lib.linux-x86_64-3.7/whatshap/__main__.py | shilpagarg/WHdenovo | 7a03798397ee0f131f100402d12ad53eab4334dc | [
"MIT"
] | 7 | 2019-05-06T22:07:47.000Z | 2020-12-11T08:48:26.000Z | import sys
import importlib
import logging
from . import __version__
from .args import HelpfulArgumentParser
# List of all subcommands. A module of the given name must exist and define
# add_arguments() and main() functions. Documentation is taken from the first
# line of the module’s docstring.
COMMANDS = [
'phase'... | 27.045455 | 86 | 0.739916 | import sys
import importlib
import logging
from . import __version__
from .args import HelpfulArgumentParser
COMMANDS = [
'phase',
'phaseg',
'stats',
'compare',
'hapcut2vcf',
'unphase',
'haplotag'
]
logger = logging.getLogger(__name__)
class NiceFormatter(logging.Formatter):
def format(self, record):
... | true | true |
f747a4e69b0b79a0963e3cfbf40c1fc88eaf552c | 10,561 | py | Python | transitions/extensions/diagrams.py | thedrow/transitions | 8995d9c37c7bab9204d279682073ba86144ffed9 | [
"MIT"
] | null | null | null | transitions/extensions/diagrams.py | thedrow/transitions | 8995d9c37c7bab9204d279682073ba86144ffed9 | [
"MIT"
] | null | null | null | transitions/extensions/diagrams.py | thedrow/transitions | 8995d9c37c7bab9204d279682073ba86144ffed9 | [
"MIT"
] | null | null | null | from transitions import Transition
from transitions.extensions.markup import MarkupMachine
from transitions.core import listify
import warnings
import logging
from functools import partial
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
# make deprecation warnings of transition visibl... | 40.003788 | 113 | 0.58716 | from transitions import Transition
from transitions.extensions.markup import MarkupMachine
from transitions.core import listify
import warnings
import logging
from functools import partial
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
warnings.filterwarnings(action='default', messa... | true | true |
f747a4f022ceed660ce623f692709a3e3ded2295 | 10,396 | py | Python | lib/dnssec.py | NunoEdgarGFlowHub/qtum-electrum | 8e37396d77696c162015ed8c0677d533d82fbc23 | [
"MIT"
] | null | null | null | lib/dnssec.py | NunoEdgarGFlowHub/qtum-electrum | 8e37396d77696c162015ed8c0677d533d82fbc23 | [
"MIT"
] | null | null | null | lib/dnssec.py | NunoEdgarGFlowHub/qtum-electrum | 8e37396d77696c162015ed8c0677d533d82fbc23 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 37.941606 | 418 | 0.657561 |
import traceback
import sys
import time
import struct
import dns.name
import dns.query
import dns.dnssec
import dns.message
import dns.resolver
import dns.rdatatype
import dns.rdtypes.ANY.NS
import dns.rdtypes.ANY.CNAME
import dns.rdtypes.ANY.DLV
import dns.rdtypes.ANY.DNSKEY
import d... | true | true |
f747a633a8fb8ed35dd19b92bdb67dcbad4dbe72 | 5,047 | py | Python | learn_to_infer/lda.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | learn_to_infer/lda.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | learn_to_infer/lda.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 43.886957 | 80 | 0.733703 |
import jax
from jax import jit
import jax.numpy as jnp
from functools import partial
@partial(jit, static_argnums=(1,))
def sample_params(key, num_docs, doc_topic_alpha, topic_word_alpha):
num_topics = doc_topic_alpha.shape[0]
k1, k2 = jax.random.split(key)
topic_params = jax.random.diri... | true | true |
f747a7e6fd65a6be8340808508d91a8668310c41 | 578 | py | Python | nonebot/matcher.py | mobyw/nonebot2 | 36663f1a8a51bd89f4a60110047e73719adcc73d | [
"MIT"
] | null | null | null | nonebot/matcher.py | mobyw/nonebot2 | 36663f1a8a51bd89f4a60110047e73719adcc73d | [
"MIT"
] | null | null | null | nonebot/matcher.py | mobyw/nonebot2 | 36663f1a8a51bd89f4a60110047e73719adcc73d | [
"MIT"
] | null | null | null | """本模块实现事件响应器的创建与运行,并提供一些快捷方法来帮助用户更好的与机器人进行对话。
FrontMatter:
sidebar_position: 3
description: nonebot.matcher 模块
"""
from nonebot.internal.matcher import Matcher as Matcher
from nonebot.internal.matcher import matchers as matchers
from nonebot.internal.matcher import current_bot as current_bot
from nonebot.int... | 30.421053 | 71 | 0.816609 |
from nonebot.internal.matcher import Matcher as Matcher
from nonebot.internal.matcher import matchers as matchers
from nonebot.internal.matcher import current_bot as current_bot
from nonebot.internal.matcher import current_event as current_event
from nonebot.internal.matcher import current_handler as current_handler
f... | true | true |
f747a84130a9bfd17312f0b2d61d4f2d2e977eaa | 4,895 | py | Python | affspec/models/cnn_utils.py | BeibinLi/affspec | d00a290cb1c86cb079acef69f914805737cb3696 | [
"MIT"
] | null | null | null | affspec/models/cnn_utils.py | BeibinLi/affspec | d00a290cb1c86cb079acef69f914805737cb3696 | [
"MIT"
] | null | null | null | affspec/models/cnn_utils.py | BeibinLi/affspec | d00a290cb1c86cb079acef69f914805737cb3696 | [
"MIT"
] | null | null | null | import torch.nn as nn
__author__ = "Sachin Mehta"
__version__ = "1.0.1"
__maintainer__ = "Sachin Mehta"
class CBR(nn.Module):
'''
This class defines the convolution layer with batch normalization and PReLU activation
'''
def __init__(self, nIn, nOut, kSize, stride=1, groups=1):
'''
:... | 29.136905 | 106 | 0.573647 | import torch.nn as nn
__author__ = "Sachin Mehta"
__version__ = "1.0.1"
__maintainer__ = "Sachin Mehta"
class CBR(nn.Module):
def __init__(self, nIn, nOut, kSize, stride=1, groups=1):
super().__init__()
padding = int((kSize - 1) / 2)
self.conv = nn.Conv2d(nIn, nOut, kSize, stride=stride, ... | true | true |
f747a897d8e129afaee76919be306a14ed4c5791 | 591 | py | Python | elit/datasets/ner/resume.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | 9 | 2021-07-12T22:05:47.000Z | 2022-02-22T03:10:14.000Z | elit/datasets/ner/resume.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-08-31T08:28:37.000Z | 2022-03-28T05:52:14.000Z | elit/datasets/ner/resume.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-06-08 12:10
from elit.common.dataset import TransformableDataset
from elit.utils.io_util import get_resource, generate_words_tags_from_tsv
_RESUME_NER_HOME = 'https://github.com/jiesutd/LatticeLSTM/archive/master.zip#'
RESUME_NER_TRAIN = _RESUME_NER_HOME + 'Resume... | 34.764706 | 79 | 0.764805 |
from elit.common.dataset import TransformableDataset
from elit.utils.io_util import get_resource, generate_words_tags_from_tsv
_RESUME_NER_HOME = 'https://github.com/jiesutd/LatticeLSTM/archive/master.zip#'
RESUME_NER_TRAIN = _RESUME_NER_HOME + 'ResumeNER/train.char.bmes'
RESUME_NER_DEV = _RESUME_NER_HOME + 'Resu... | true | true |
f747a9122739267aa10af390ac96ba987b882658 | 778 | py | Python | source/summary.py | arrismo/tripods-testing | 4ab9a7059df84cfd1f8984960900a3cf80b5c13c | [
"ECL-2.0"
] | 2 | 2019-09-27T20:17:46.000Z | 2020-06-24T22:15:52.000Z | source/summary.py | arrismo/tripods-testing | 4ab9a7059df84cfd1f8984960900a3cf80b5c13c | [
"ECL-2.0"
] | 3 | 2021-03-31T19:53:37.000Z | 2021-12-13T20:44:25.000Z | source/summary.py | arrismo/tripods-testing | 4ab9a7059df84cfd1f8984960900a3cf80b5c13c | [
"ECL-2.0"
] | 1 | 2019-05-22T18:55:39.000Z | 2019-05-22T18:55:39.000Z | # -*- coding: utf-8 -*-
"""
Prints out a simple summary of the courses extracted from the school catalogs.
Created on Mon Jun 8 11:51:22 2020
@author: Francisco Vazquez
"""
import os
import pandas as pd
n_colleges=0
n_courses = 0
for filename in os.listdir('../courses'):
# if current file is the one for all s... | 26.827586 | 80 | 0.66838 |
import os
import pandas as pd
n_colleges=0
n_courses = 0
for filename in os.listdir('../courses'):
if filename == "AllSchools.csv":
continue
csv = pd.read_csv('../courses/'+filename,encoding = 'utf-8')
n_colleges +=1
n_courses += len(csv['CourseID'])
print('number of courses in ' +... | true | true |
f747aa33352005f23373c6e1107642a4943fb357 | 53 | py | Python | pangan/app.py | pangan/pangan | 443a5ae04c0566eddd84d2330406753603012bbe | [
"Apache-2.0"
] | null | null | null | pangan/app.py | pangan/pangan | 443a5ae04c0566eddd84d2330406753603012bbe | [
"Apache-2.0"
] | null | null | null | pangan/app.py | pangan/pangan | 443a5ae04c0566eddd84d2330406753603012bbe | [
"Apache-2.0"
] | null | null | null | def launch():
print('This is the launch method!') | 26.5 | 39 | 0.660377 | def launch():
print('This is the launch method!') | true | true |
f747aeac7a0c1e341d1d3d9d90553638ba819193 | 2,302 | py | Python | scphylo/commands/solver/_phiscs.py | faridrashidi/scphylo-tools | 4574e2c015da58e59caa38e3b3e49b398c1379c1 | [
"BSD-3-Clause"
] | null | null | null | scphylo/commands/solver/_phiscs.py | faridrashidi/scphylo-tools | 4574e2c015da58e59caa38e3b3e49b398c1379c1 | [
"BSD-3-Clause"
] | null | null | null | scphylo/commands/solver/_phiscs.py | faridrashidi/scphylo-tools | 4574e2c015da58e59caa38e3b3e49b398c1379c1 | [
"BSD-3-Clause"
] | null | null | null | import os
import click
import scphylo as scp
@click.command(short_help="Run PhISCS (CSP version).")
@click.argument(
"genotype_file",
required=True,
type=click.Path(
exists=True, file_okay=True, dir_okay=False, readable=True, resolve_path=True
),
)
@click.argument(
"alpha",
required=... | 22.568627 | 85 | 0.665508 | import os
import click
import scphylo as scp
@click.command(short_help="Run PhISCS (CSP version).")
@click.argument(
"genotype_file",
required=True,
type=click.Path(
exists=True, file_okay=True, dir_okay=False, readable=True, resolve_path=True
),
)
@click.argument(
"alpha",
required=... | true | true |
f747af2536ddffe721a8d83084feac9d93eeadfa | 2,089 | py | Python | src/maya/compat.py | santiagobasulto/maya | 03540c48c1c6c84fd27264478ba442fa24c74ffd | [
"MIT"
] | 3,124 | 2016-12-16T00:24:14.000Z | 2022-02-21T23:30:29.000Z | src/maya/compat.py | not-kennethreitz/maya | f3f95a92ee1f29c1eebdd4e1aefdac98da3c3df3 | [
"MIT"
] | 161 | 2016-12-16T02:42:11.000Z | 2019-07-11T06:57:46.000Z | src/maya/compat.py | not-kennethreitz/maya | f3f95a92ee1f29c1eebdd4e1aefdac98da3c3df3 | [
"MIT"
] | 240 | 2016-12-16T01:25:08.000Z | 2022-02-08T10:42:33.000Z | # -*- coding: utf-8 -*-
"""
maya.compat
~~~~~~~~~~~~~~~
This module handles import compatibility issues between Python 2 and
Python 3.
"""
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
# : Python 2.x?
is_py2 = _ver[0] == 2
# : Python 3.x?
is_py3 = _ver[0] == 3
# ---------
# Specific... | 20.086538 | 76 | 0.543322 |
import sys
_ver = sys.version_info
is_py2 = _ver[0] == 2
is_py3 = _ver[0] == 3
if is_py2:
cmp = cmp
elif is_py3:
def cmp(a, b):
"""
Compare two objects.
Returns a negative number if C{a < b}, zero if they are equal, and a
positive number if C{a > b}.
"""
... | true | true |
f747afb295d38e8203bad9f663dfc5ebf20596c8 | 59,829 | py | Python | Tests/test_AlignIO.py | ajmaurais/biopython | f110e06e740d81ff0d762a5da34099bfdca269c3 | [
"BSD-3-Clause"
] | 1 | 2020-01-21T02:04:08.000Z | 2020-01-21T02:04:08.000Z | Tests/test_AlignIO.py | ajmaurais/biopython | f110e06e740d81ff0d762a5da34099bfdca269c3 | [
"BSD-3-Clause"
] | null | null | null | Tests/test_AlignIO.py | ajmaurais/biopython | f110e06e740d81ff0d762a5da34099bfdca269c3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2008 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for AlignIO module."""
import unittest
import warnings
from io import StringIO
from ... | 49.486352 | 725 | 0.59884 |
import unittest
import warnings
from io import StringIO
from Bio import SeqIO
from Bio import AlignIO
from Bio.Align import AlignInfo, MultipleSeqAlignment
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
test_write_read_alignment_formats = sorted(AlignIO._FormatToWriter)
test_write_read_align_with... | true | true |
f747b001b48de0dec5b20c0adbdaa62ced4b9f7c | 385 | py | Python | Mentor_Meeting_Application-aditya/django_school/classroom/migrations/0008_auto_20181101_1149.py | AdityaMalani/Mentor-Meet | b3d24d64a42692a4394df5216e8a465daa7fc711 | [
"MIT"
] | 2 | 2018-10-24T09:10:15.000Z | 2018-10-29T10:54:15.000Z | Mentor_Meeting_Application-aditya/django_school/classroom/migrations/0008_auto_20181101_1149.py | AdityaMalani/Mentor-Meet | b3d24d64a42692a4394df5216e8a465daa7fc711 | [
"MIT"
] | null | null | null | Mentor_Meeting_Application-aditya/django_school/classroom/migrations/0008_auto_20181101_1149.py | AdityaMalani/Mentor-Meet | b3d24d64a42692a4394df5216e8a465daa7fc711 | [
"MIT"
] | 1 | 2018-10-31T18:16:38.000Z | 2018-10-31T18:16:38.000Z | # Generated by Django 2.0.1 on 2018-11-01 11:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classroom', '0007_auto_20181101_1145'),
]
operations = [
migrations.AlterField(
model_name='quiz',
name='report',
... | 20.263158 | 49 | 0.592208 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classroom', '0007_auto_20181101_1145'),
]
operations = [
migrations.AlterField(
model_name='quiz',
name='report',
field=models.FileField(upload_to=''),... | true | true |
f747b019c75615dbb133a33a36dbb1c03c4e27ee | 955 | py | Python | lib/PADS/MinimumSpanningTree.py | ncbray/pystream | 70bba5646d6512adb6803564c22268d3424c66d8 | [
"Apache-2.0"
] | 6 | 2015-09-19T18:22:33.000Z | 2020-11-29T15:21:17.000Z | lib/PADS/MinimumSpanningTree.py | ncbray/pystream | 70bba5646d6512adb6803564c22268d3424c66d8 | [
"Apache-2.0"
] | 1 | 2015-08-04T08:03:46.000Z | 2015-08-04T08:03:46.000Z | lib/PADS/MinimumSpanningTree.py | ncbray/pystream | 70bba5646d6512adb6803564c22268d3424c66d8 | [
"Apache-2.0"
] | 1 | 2019-12-09T08:27:09.000Z | 2019-12-09T08:27:09.000Z | """MinimumSpanningTree.py
Kruskal's algorithm for minimum spanning trees. D. Eppstein, April 2006.
"""
from UnionFind import UnionFind
def MinimumSpanningTree(G):
"""
Return the minimum spanning tree of an undirected graph G.
G should be represented in such a way that G[u][v] gives the
length of edge... | 32.931034 | 76 | 0.648168 |
from UnionFind import UnionFind
def MinimumSpanningTree(G):
# We use Kruskal's algorithm, first because it is very simple to
subtrees = UnionFind()
tree = []
edges = [(G[u][v],u,v) for u in G for v in G[u]]
edges.sort()
for W,u,v in edges:
if subtrees[u] != subtrees[v]:... | true | true |
f747b15249ba715547fc26e525651060931f03c2 | 2,799 | py | Python | django_airavata/app_config.py | sairohithA007/airavata-django-portal | fe18d65802f02c9faf805c8edfdee3341c66e93a | [
"Apache-2.0"
] | null | null | null | django_airavata/app_config.py | sairohithA007/airavata-django-portal | fe18d65802f02c9faf805c8edfdee3341c66e93a | [
"Apache-2.0"
] | null | null | null | django_airavata/app_config.py | sairohithA007/airavata-django-portal | fe18d65802f02c9faf805c8edfdee3341c66e93a | [
"Apache-2.0"
] | null | null | null |
import logging
from abc import ABC, abstractmethod
from importlib import import_module
from django.apps import AppConfig
logger = logging.getLogger(__name__)
class AiravataAppConfig(AppConfig, ABC):
"""Custom AppConfig for Django Airavata apps."""
@property
def url_app_name(self):
"""Return th... | 27.441176 | 79 | 0.67667 |
import logging
from abc import ABC, abstractmethod
from importlib import import_module
from django.apps import AppConfig
logger = logging.getLogger(__name__)
class AiravataAppConfig(AppConfig, ABC):
@property
def url_app_name(self):
return get_url_app_name(self)
@property
@abstractmethod
... | true | true |
f747b27d5695bbd2b4a6980d17901592e99e736c | 9,535 | py | Python | s3_storage_provider.py | srhoulam/synapse-s3-storage-provider | 843576b54526c74df8388bc195fb61c6cb9ab970 | [
"Apache-2.0"
] | 1 | 2019-05-21T18:20:09.000Z | 2019-05-21T18:20:09.000Z | s3_storage_provider.py | srhoulam/synapse-s3-storage-provider | 843576b54526c74df8388bc195fb61c6cb9ab970 | [
"Apache-2.0"
] | null | null | null | s3_storage_provider.py | srhoulam/synapse-s3-storage-provider | 843576b54526c74df8388bc195fb61c6cb9ab970 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector 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 la... | 32.431973 | 101 | 0.644887 |
import logging
import os
import threading
from six import string_types
import boto3
import botocore
from twisted.internet import defer, reactor
from twisted.python.failure import Failure
from synapse.rest.media.v1._base import Responder
from synapse.rest.media.v1.storage_provider import StorageProvid... | true | true |
f747b2c6951cd50758af23c359abe198e311991e | 2,125 | py | Python | web/demo/bff/flaskr/__init__.py | trisacrypto/testnet | 46574df999a82ad72dc47c38eb3a36ddef00fdb4 | [
"MIT"
] | 1 | 2022-01-20T23:49:28.000Z | 2022-01-20T23:49:28.000Z | web/demo/bff/flaskr/__init__.py | trisacrypto/testnet | 46574df999a82ad72dc47c38eb3a36ddef00fdb4 | [
"MIT"
] | 23 | 2020-12-16T18:26:41.000Z | 2021-06-14T20:18:41.000Z | web/demo/bff/flaskr/__init__.py | trisacrypto/testnet | 46574df999a82ad72dc47c38eb3a36ddef00fdb4 | [
"MIT"
] | 1 | 2021-07-21T01:59:56.000Z | 2021-07-21T01:59:56.000Z | import logging
import os
import jsons
from flask import Flask
from flask_cors import CORS
from flask_restful import Api
from flask_socketio import SocketIO
from flaskr import db
from flaskr.api.vasps import Vasps
from flaskr.models.user_wallet import UserWallet
from flaskr.models.vasp_details import VaspDetails
from ... | 27.960526 | 103 | 0.685176 | import logging
import os
import jsons
from flask import Flask
from flask_cors import CORS
from flask_restful import Api
from flask_socketio import SocketIO
from flaskr import db
from flaskr.api.vasps import Vasps
from flaskr.models.user_wallet import UserWallet
from flaskr.models.vasp_details import VaspDetails
from ... | true | true |
f747b396fa973e21ff69b253e51b84c2462bfea0 | 2,817 | py | Python | src/functions.py | sambit-giri/DMemu | 1827832efdab2dfcb735035b6956854e34d17202 | [
"MIT"
] | null | null | null | src/functions.py | sambit-giri/DMemu | 1827832efdab2dfcb735035b6956854e34d17202 | [
"MIT"
] | null | null | null | src/functions.py | sambit-giri/DMemu | 1827832efdab2dfcb735035b6956854e34d17202 | [
"MIT"
] | null | null | null | import numpy as np
import pickle
def ps_suppression_8param(theta, emul, return_std=False):
log10Mc, mu, thej, gamma, delta, eta, deta, fb = theta
# fb = 0.1612
mins = [11, 0.0, 2, 1, 3, 0.2, 0.2, 0.10]
maxs = [15, 2.0, 8, 4, 11, 0.4, 0.4, 0.25]
assert mins[0]<=log10Mc<=maxs[0]
assert mins[1]<... | 31.651685 | 123 | 0.652112 | import numpy as np
import pickle
def ps_suppression_8param(theta, emul, return_std=False):
log10Mc, mu, thej, gamma, delta, eta, deta, fb = theta
mins = [11, 0.0, 2, 1, 3, 0.2, 0.2, 0.10]
maxs = [15, 2.0, 8, 4, 11, 0.4, 0.4, 0.25]
assert mins[0]<=log10Mc<=maxs[0]
assert mins[1]<=mu<=maxs[1]
... | true | true |
f747b413c526b77e27bb85c0cd7a00874523067e | 7,525 | py | Python | src/models/train_model.py | egaznep/toy_vae_example | a41bed14454462da9a1b0ca658f4e72998b7d10b | [
"MIT"
] | null | null | null | src/models/train_model.py | egaznep/toy_vae_example | a41bed14454462da9a1b0ca658f4e72998b7d10b | [
"MIT"
] | null | null | null | src/models/train_model.py | egaznep/toy_vae_example | a41bed14454462da9a1b0ca658f4e72998b7d10b | [
"MIT"
] | null | null | null | import re
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import importlib
import torch
import torch.autograd
from torch.utils.data import dataset
import torch.utils.data.dataloader
import ignite.utils
import ignite.handlers.early_stopping
import ignite.engine
import ... | 39.814815 | 138 | 0.694086 | import re
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import importlib
import torch
import torch.autograd
from torch.utils.data import dataset
import torch.utils.data.dataloader
import ignite.utils
import ignite.handlers.early_stopping
import ignite.engine
import ... | true | true |
f747b4957eed37eaa62e4e88fbd096f632382341 | 316 | py | Python | src/recursividad/invertir.py | GokoshiJr/algoritmos2-py | 106dcbed31739309c193a77c671522aac17f6e45 | [
"MIT"
] | null | null | null | src/recursividad/invertir.py | GokoshiJr/algoritmos2-py | 106dcbed31739309c193a77c671522aac17f6e45 | [
"MIT"
] | null | null | null | src/recursividad/invertir.py | GokoshiJr/algoritmos2-py | 106dcbed31739309c193a77c671522aac17f6e45 | [
"MIT"
] | null | null | null | # 10. Programe un método recursivo que invierta los números de un arreglo de enteros.
def invertir(numArray):
if (len(numArray) == 0):
return []
else:
return ([numArray[-1]] + invertir(numArray[:-1]))
numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
print(invertir(numeros))
| 28.727273 | 87 | 0.579114 |
def invertir(numArray):
if (len(numArray) == 0):
return []
else:
return ([numArray[-1]] + invertir(numArray[:-1]))
numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
print(invertir(numeros))
| true | true |
f747b531da863fd51761e605fca32a2a3e0b738f | 5,447 | py | Python | villager-bot/util/misc.py | Chiruso/Villager-Bot | 4801b12241f47a1869a8888a4dd41d7befd8140e | [
"MIT"
] | null | null | null | villager-bot/util/misc.py | Chiruso/Villager-Bot | 4801b12241f47a1869a8888a4dd41d7befd8140e | [
"MIT"
] | null | null | null | villager-bot/util/misc.py | Chiruso/Villager-Bot | 4801b12241f47a1869a8888a4dd41d7befd8140e | [
"MIT"
] | null | null | null | from urllib.parse import urlparse
import classyjson as cj
import asyncio
import discord
import math
import time
from util.code import format_exception
from util.ipc import PacketType
def strip_command(ctx): # returns message.clean_content excluding the command used
length = len(ctx.prefix) + len(ctx.invoked_wit... | 29.928571 | 126 | 0.608041 | from urllib.parse import urlparse
import classyjson as cj
import asyncio
import discord
import math
import time
from util.code import format_exception
from util.ipc import PacketType
def strip_command(ctx):
length = len(ctx.prefix) + len(ctx.invoked_with) + 1
return ctx.message.clean_content[length:]
def... | true | true |
f747b68882d3196649ad0a7a4d85d754573fccbe | 2,208 | py | Python | tests/test_epicurious.py | gloriousDan/recipe-scrapers | 4e11b04db92abe11b75d373a147cc566629f265b | [
"MIT"
] | null | null | null | tests/test_epicurious.py | gloriousDan/recipe-scrapers | 4e11b04db92abe11b75d373a147cc566629f265b | [
"MIT"
] | null | null | null | tests/test_epicurious.py | gloriousDan/recipe-scrapers | 4e11b04db92abe11b75d373a147cc566629f265b | [
"MIT"
] | null | null | null | from recipe_scrapers.epicurious import Epicurious
from tests import ScraperTest
class TestEpicurious(ScraperTest):
scraper_class = Epicurious
def test_host(self):
self.assertEqual("epicurious.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
... | 38.736842 | 390 | 0.65942 | from recipe_scrapers.epicurious import Epicurious
from tests import ScraperTest
class TestEpicurious(ScraperTest):
scraper_class = Epicurious
def test_host(self):
self.assertEqual("epicurious.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
... | true | true |
f747b6f9166c920204ebef4a055aa9f65440146f | 3,801 | py | Python | src/olympia/constants/permissions.py | nothingisdead/addons-server | e779422102d323d22a213818849fd8ee912b621f | [
"BSD-3-Clause"
] | null | null | null | src/olympia/constants/permissions.py | nothingisdead/addons-server | e779422102d323d22a213818849fd8ee912b621f | [
"BSD-3-Clause"
] | null | null | null | src/olympia/constants/permissions.py | nothingisdead/addons-server | e779422102d323d22a213818849fd8ee912b621f | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict, namedtuple
AclPermission = namedtuple('AclPermission', 'app, action')
# Null rule. Only useful in tests really as no access group should have this.
NONE = AclPermission('None', 'None')
# A special wildcard permission to use when checking if someone has access to
# any admin, or... | 39.59375 | 79 | 0.770587 | from collections import defaultdict, namedtuple
AclPermission = namedtuple('AclPermission', 'app, action')
NONE = AclPermission('None', 'None')
ANY_ADMIN = AclPermission('Admin', '%')
SUPERPOWERS = AclPermission('*', '*')
ADMIN_TOOLS = AclPermission('Admin', 'Tools')
ADMIN_CURATION = AclPermission('Admin'... | true | true |
f747b739b7a2b2b77392f3d67016b91cc73e4774 | 557 | py | Python | Challenges/InProgress/Stack Implementation_convertToPY3.py | smirecki/Coding_Challenges | 01e6ff2d780ab16cb3ca86fcc5859e4734a2cb52 | [
"MIT"
] | null | null | null | Challenges/InProgress/Stack Implementation_convertToPY3.py | smirecki/Coding_Challenges | 01e6ff2d780ab16cb3ca86fcc5859e4734a2cb52 | [
"MIT"
] | null | null | null | Challenges/InProgress/Stack Implementation_convertToPY3.py | smirecki/Coding_Challenges | 01e6ff2d780ab16cb3ca86fcc5859e4734a2cb52 | [
"MIT"
] | null | null | null | import sys
test_cases = open(sys.argv[1], 'r') # open file and read test file
for test in test_cases: # read one line at a time
test = test.split( ) # split the string into a list (space as the default delimiter and removing /n newlines)
test.reverse() # reverse the order of the list items
tes... | 55.7 | 116 | 0.660682 | import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
test = test.split( )
test.reverse()
test = test[::2]
test = ' '.join(test)
_cases.close() | true | true |
f747b860b2c5a8f0082a8e46266aa924e5fee0b7 | 26,486 | py | Python | salt/modules/heat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/modules/heat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/modules/heat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Module for handling OpenStack Heat calls
.. versionadded:: 2017.7.0
:depends: - heatclient Python module
:configuration: This module is not usable until the user, password, tenant, and
auth URL are specified either in a pillar or in the minion's config file.
For example::
... | 30.304348 | 95 | 0.56679 |
from __future__ import absolute_import, print_function, unicode_literals
import time
import logging
from salt.exceptions import SaltInvocationError
from salt.ext import six
import salt.utils.files
import salt.utils.json
import salt.utils.stringutils
import salt.utils.versions
import salt.utils.yaml
HAS_HEAT = Fa... | true | true |
f747b8ca620ba188192fec14574e195eec9285f5 | 1,001 | py | Python | logger_util.py | DayongTong/MEAM517_Project_Git | c6debfb53e279339879b6c535e91bd5fbcd4ba79 | [
"MIT"
] | null | null | null | logger_util.py | DayongTong/MEAM517_Project_Git | c6debfb53e279339879b6c535e91bd5fbcd4ba79 | [
"MIT"
] | null | null | null | logger_util.py | DayongTong/MEAM517_Project_Git | c6debfb53e279339879b6c535e91bd5fbcd4ba79 | [
"MIT"
] | 1 | 2020-11-11T18:02:38.000Z | 2020-11-11T18:02:38.000Z | def logger_util(t_sol, x_sol, u_sol, tinit, xinit, uinit):
x_labels = ["r: ", "alpha: ", "beta: ",
"Vx: ", "Vy: ", "Vz: ",
"m: ", "phi: ", "psi: "]
u_labels = ["T: ", "w_phi: ", "w_psi: "]
with open("save_solution_variables.txt", mode='w') as F:
F.write("LOGGING S... | 34.517241 | 60 | 0.47952 | def logger_util(t_sol, x_sol, u_sol, tinit, xinit, uinit):
x_labels = ["r: ", "alpha: ", "beta: ",
"Vx: ", "Vy: ", "Vz: ",
"m: ", "phi: ", "psi: "]
u_labels = ["T: ", "w_phi: ", "w_psi: "]
with open("save_solution_variables.txt", mode='w') as F:
F.write("LOGGING S... | true | true |
f747b8d1c1877b874cf3d1d66dd54d28126e8573 | 2,405 | py | Python | pyod/test/test_stat_models.py | DrewNow/pyod | 4439904ce05e95c31dbeed22d34526f729eaad2b | [
"BSD-2-Clause"
] | 2 | 2021-05-13T01:24:25.000Z | 2021-11-08T09:23:04.000Z | pyod/test/test_stat_models.py | anisayari/pyod | 3b814b567ba8ea9ab8a64c97c24165df48c6e699 | [
"BSD-2-Clause"
] | null | null | null | pyod/test/test_stat_models.py | anisayari/pyod | 3b814b567ba8ea9ab8a64c97c24165df48c6e699 | [
"BSD-2-Clause"
] | 1 | 2020-01-15T09:29:54.000Z | 2020-01-15T09:29:54.000Z | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
from sklearn.utils.testing import assert_equal
# noinspection PyProtectedMember
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_raises
from skl... | 31.233766 | 79 | 0.621206 |
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_greater_equal
from skl... | true | true |
f747b94d4b0db28d90270c4b45eacf920f21d2e2 | 27,961 | py | Python | pony/orm/sqlbuilding.py | anirudh-ramesh/pony | b4d3da69d2fbd18c870db204d7de12a06e0b2328 | [
"Apache-2.0"
] | null | null | null | pony/orm/sqlbuilding.py | anirudh-ramesh/pony | b4d3da69d2fbd18c870db204d7de12a06e0b2328 | [
"Apache-2.0"
] | null | null | null | pony/orm/sqlbuilding.py | anirudh-ramesh/pony | b4d3da69d2fbd18c870db204d7de12a06e0b2328 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, print_function, division
from pony.py23compat import PY2, izip, imap, itervalues, basestring, unicode, buffer, int_types
from operator import attrgetter
from decimal import Decimal
from datetime import date, datetime, timedelta
from binascii import hexlify
from pony import opti... | 43.826019 | 111 | 0.595758 | from __future__ import absolute_import, print_function, division
from pony.py23compat import PY2, izip, imap, itervalues, basestring, unicode, buffer, int_types
from operator import attrgetter
from decimal import Decimal
from datetime import date, datetime, timedelta
from binascii import hexlify
from pony import opti... | true | true |
f747ba1f888acd75d604a4769af966657b9e7176 | 4,246 | py | Python | train_parsingrcnn.py | JasonDu1993/ATEN | 74cb892d88f4d2f5ba5014336d61b6fa90dc250a | [
"MIT"
] | null | null | null | train_parsingrcnn.py | JasonDu1993/ATEN | 74cb892d88f4d2f5ba5014336d61b6fa90dc250a | [
"MIT"
] | null | null | null | train_parsingrcnn.py | JasonDu1993/ATEN | 74cb892d88f4d2f5ba5014336d61b6fa90dc250a | [
"MIT"
] | null | null | null | import os
import sys
from time import time
sys.path.insert(0, os.getcwd())
import tensorflow as tf
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
from configs.vip import ParsingRCNNModelConfig
from configs.vip import VIPDa... | 32.914729 | 107 | 0.628827 | import os
import sys
from time import time
sys.path.insert(0, os.getcwd())
import tensorflow as tf
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
from configs.vip import ParsingRCNNModelConfig
from configs.vip import VIPDa... | true | true |
f747bac6efbe42e2ea3d1d195eebcc5275b5d013 | 17,461 | py | Python | PythonProjects/10-Sequences/src/m7_summary.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/10-Sequences/src/m7_summary.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/10-Sequences/src/m7_summary.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """
This module lets you practice two forms of the ACCUMULATOR pattern:
-- SUMMING
-- COUNTING
where the accumulation is done via ITERATING (i.e., looping)
through a SEQUENCE.
It also demonstrates the distinction between:
-- an INDEX of the sequence (e.g., -5 is at index 1 in [0, -5, 12, -6]) and
-- the item A... | 35.489837 | 79 | 0.573335 |
import testing_helper
import time
def main():
run_test_summary1a()
run_test_summary1c()
run_test_summary1c()
rint_expected_result_of_test([sequence], expected, test_results,
format_string)
actual = summary1b(sequence)
print_actual_result_of_test(expected, actu... | true | true |
f747bd9bc5b8f9d3c7ec0a36fa037a7b42c9c604 | 6,839 | py | Python | code/lufangxiao/__init__.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | 1 | 2021-12-20T07:20:25.000Z | 2021-12-20T07:20:25.000Z | code/lufangxiao/__init__.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | code/lufangxiao/__init__.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | from code.models.D_LinkNet import DLinkNet
from code.models.DeepLabv3plus import DeepLabV3Plus
from code.models.LinkNet import LinkNet
from code.models.ResUNet import ResUNet
from code.models.SegHRNet import SegHRNet
from code.models.SegHRNet_OCR import SegHRNet_OCR
from code.models.SegHR_LinkNet import SegHR_LinkNet
f... | 45.291391 | 212 | 0.592046 | from code.models.D_LinkNet import DLinkNet
from code.models.DeepLabv3plus import DeepLabV3Plus
from code.models.LinkNet import LinkNet
from code.models.ResUNet import ResUNet
from code.models.SegHRNet import SegHRNet
from code.models.SegHRNet_OCR import SegHRNet_OCR
from code.models.SegHR_LinkNet import SegHR_LinkNet
f... | true | true |
f747be60ec993ec9c126737f2edad04393542967 | 493 | py | Python | language/test.py | jhe8281/openSW | 6f3bc5bb34996616a6e862b48e5d164da12344a7 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T02:03:41.000Z | 2019-03-07T04:43:08.000Z | language/test.py | jhe8281/openSW | 6f3bc5bb34996616a6e862b48e5d164da12344a7 | [
"BSD-3-Clause"
] | null | null | null | language/test.py | jhe8281/openSW | 6f3bc5bb34996616a6e862b48e5d164da12344a7 | [
"BSD-3-Clause"
] | null | null | null | import json
print('name : ', end = '')
b = input()
json_data = open('en-US.json', 'rt', encoding='utf-8').read()
a_json = json.loads(json_data)
json_data = open(str(b) + '.json', 'rt', encoding='utf-8').read()
b_json = json.loads(json_data)
for a_in in a_json:
if not a_in in b_json:
print(a_in + ' : ', ... | 25.947368 | 108 | 0.527383 | import json
print('name : ', end = '')
b = input()
json_data = open('en-US.json', 'rt', encoding='utf-8').read()
a_json = json.loads(json_data)
json_data = open(str(b) + '.json', 'rt', encoding='utf-8').read()
b_json = json.loads(json_data)
for a_in in a_json:
if not a_in in b_json:
print(a_in + ' : ', ... | true | true |
f747be80b5eb886d724e3f177af6c841ffd51fc2 | 1,583 | py | Python | setup.py | sullivancolin/hexpy | 37aeb39935c1ac3e8d776a44373bc02b0e753a4e | [
"MIT"
] | 7 | 2017-09-29T01:06:44.000Z | 2018-12-05T17:22:05.000Z | setup.py | sullivancolin/hexpy | 37aeb39935c1ac3e8d776a44373bc02b0e753a4e | [
"MIT"
] | 13 | 2018-06-27T14:28:59.000Z | 2020-04-03T01:38:49.000Z | setup.py | sullivancolin/hexpy | 37aeb39935c1ac3e8d776a44373bc02b0e753a4e | [
"MIT"
] | 8 | 2017-10-17T16:34:29.000Z | 2020-04-01T07:30:20.000Z | #!/usr/bin/env python
"""The setup script."""
from setuptools import find_packages, setup
requirements = [
"xlrd>=1.1.0",
"requests>=2.22.0",
"click>=7.0",
"click-help-colors>=0.5",
"pandas>=0.20.3",
"openpyxl>=2.4.8",
"pendulum>=1.3.2",
"pydantic>= 1.1",
"ftfy>=5.5.1",
]
setup_re... | 28.781818 | 77 | 0.638029 |
from setuptools import find_packages, setup
requirements = [
"xlrd>=1.1.0",
"requests>=2.22.0",
"click>=7.0",
"click-help-colors>=0.5",
"pandas>=0.20.3",
"openpyxl>=2.4.8",
"pendulum>=1.3.2",
"pydantic>= 1.1",
"ftfy>=5.5.1",
]
setup_requirements = ["pytest-runner", "setuptools>=3... | true | true |
f747bf113acbc3b196b90660bcc1d14ba4dc2e32 | 360 | py | Python | collect/spider/getpdf/pipelines.py | Thanatoz-1/Text-Technology | f07a4d9fcfb4a1297103917fa2db4a3d513bed9c | [
"Apache-2.0"
] | null | null | null | collect/spider/getpdf/pipelines.py | Thanatoz-1/Text-Technology | f07a4d9fcfb4a1297103917fa2db4a3d513bed9c | [
"Apache-2.0"
] | 20 | 2022-01-25T20:07:46.000Z | 2022-02-25T09:30:11.000Z | collect/spider/getpdf/pipelines.py | Thanatoz-1/Text-Technology | f07a4d9fcfb4a1297103917fa2db4a3d513bed9c | [
"Apache-2.0"
] | 1 | 2022-02-26T10:33:48.000Z | 2022-02-26T10:33:48.000Z | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class GetpdfPipeline:
def process_item(s... | 25.714286 | 66 | 0.766667 |
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class GetpdfPipeline:
def process_item(self, item, spider):
return item
| true | true |
f747bf4e12e7c7ba06ce780c9bd4d5e2e513f877 | 4,501 | py | Python | A Star Pathfinding.py | ihtasham42/a-star-pathfinding | 263702f5fe03f5fbff41f585f519c613154e8805 | [
"Unlicense"
] | null | null | null | A Star Pathfinding.py | ihtasham42/a-star-pathfinding | 263702f5fe03f5fbff41f585f519c613154e8805 | [
"Unlicense"
] | null | null | null | A Star Pathfinding.py | ihtasham42/a-star-pathfinding | 263702f5fe03f5fbff41f585f519c613154e8805 | [
"Unlicense"
] | null | null | null | import pygame, random, math, queue, pdb
pygame.init()
clock = pygame.time.Clock()
SCREEN_WIDTH = 800
COLUMNS = 100
ROWS = 100
CELL_WIDTH = 8
CELL_COLOURS = {
"empty" : (128, 128, 128),
"wall" : (0, 0, 0),
"start" : (0, 255, 0),
"goal" : (255, 0, 0),
"path" : (255, 255, 255),
... | 26.791667 | 83 | 0.576094 | import pygame, random, math, queue, pdb
pygame.init()
clock = pygame.time.Clock()
SCREEN_WIDTH = 800
COLUMNS = 100
ROWS = 100
CELL_WIDTH = 8
CELL_COLOURS = {
"empty" : (128, 128, 128),
"wall" : (0, 0, 0),
"start" : (0, 255, 0),
"goal" : (255, 0, 0),
"path" : (255, 255, 255),
... | true | true |
f747c220335e099b89e395fdd5654de51246ebf9 | 1,407 | py | Python | evaluation/tsne_analysis_baseline/test/test_grid.py | Leinadh/PeruvianImageGenerator | 9bf11125f4ea3090e217cf15866ec19ce944f9c6 | [
"Apache-2.0"
] | 3 | 2020-06-30T04:44:31.000Z | 2020-06-30T04:44:55.000Z | evaluation/tsne_analysis_baseline/test/test_grid.py | Leinadh/PeruvianImageGenerator | 9bf11125f4ea3090e217cf15866ec19ce944f9c6 | [
"Apache-2.0"
] | null | null | null | evaluation/tsne_analysis_baseline/test/test_grid.py | Leinadh/PeruvianImageGenerator | 9bf11125f4ea3090e217cf15866ec19ce944f9c6 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
from gen_tsne import build_grid
ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
class TestGrid(unittest.TestCase):
def test_build(self):
paths = [os.path.join(ASSETS_DIR, "dataset"), os.path.join(ASSETS_DIR, "model_a"),
os.path.join(ASSETS_DIR, ... | 42.636364 | 119 | 0.636816 | import os
import unittest
from gen_tsne import build_grid
ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
class TestGrid(unittest.TestCase):
def test_build(self):
paths = [os.path.join(ASSETS_DIR, "dataset"), os.path.join(ASSETS_DIR, "model_a"),
os.path.join(ASSETS_DIR, ... | true | true |
f747c2c3495090f44d609becd744a4a2a2b5eed9 | 3,594 | py | Python | tests/star_wars_data.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | tests/star_wars_data.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | tests/star_wars_data.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | """This defines a basic set of data for our Star Wars Schema.
This data is hard coded for the sake of the demo, but you could imagine fetching this
data from a backend service rather than from hardcoded JSON objects in a more complex
demo.
"""
from typing import Collection, Iterator
__all__ = ["get_droid", "get_frie... | 25.671429 | 87 | 0.661658 |
from typing import Collection, Iterator
__all__ = ["get_droid", "get_friends", "get_hero", "get_human", "get_secret_backstory"]
class Character:
id: str
name: str
friends: Collection[str]
appearsIn: Collection[str]
class Human(Character):
type = "Human"
homePlanet: str
def __... | true | true |
f747c30ff0c0c1565b8639d9a272079caea9d452 | 1,909 | py | Python | orodja.py | benoucakar/analiza-podatkov---Najbolj-ih-10000-videoiger | 35ece3eb03b7f796bee48ec6bc568580d36e976b | [
"MIT"
] | 1 | 2020-12-24T23:19:58.000Z | 2020-12-24T23:19:58.000Z | orodja.py | benoucakar/Najboljse-videoigre-vseh-casov | 35ece3eb03b7f796bee48ec6bc568580d36e976b | [
"MIT"
] | null | null | null | orodja.py | benoucakar/Najboljse-videoigre-vseh-casov | 35ece3eb03b7f796bee48ec6bc568580d36e976b | [
"MIT"
] | null | null | null | # Prirejeno po datotekah iz predavanj in vaj.
import csv
import json
import os
import requests
default_headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
# Prenos spletne strani
def url_v_html(url, mapa, ime_datotek... | 32.913793 | 157 | 0.688318 |
import csv
import json
import os
import requests
default_headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
def url_v_html(url, mapa, ime_datoteke, headers=default_headers):
try:
page_content = request... | true | true |
f747c333c63e86db17020b033f19b010e4423d33 | 303 | py | Python | pydnb/__init__.py | tsabata/PyDNB | 19cc25ee8b7e95475f19eb6e6bb066f20782bb06 | [
"MIT"
] | 3 | 2018-10-03T20:30:32.000Z | 2020-10-27T16:49:21.000Z | pydnb/__init__.py | tsabata/PyDNB | 19cc25ee8b7e95475f19eb6e6bb066f20782bb06 | [
"MIT"
] | null | null | null | pydnb/__init__.py | tsabata/PyDNB | 19cc25ee8b7e95475f19eb6e6bb066f20782bb06 | [
"MIT"
] | null | null | null | import os.path
import re
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as f:
version_content = [line for line in f.readlines() if re.search(r'([\d.]+)',line)]
if len(version_content) != 1:
raise RuntimeError('Invalid format of VERSION file.')
__version__ = version_content[0]
| 27.545455 | 85 | 0.706271 | import os.path
import re
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as f:
version_content = [line for line in f.readlines() if re.search(r'([\d.]+)',line)]
if len(version_content) != 1:
raise RuntimeError('Invalid format of VERSION file.')
__version__ = version_content[0]
| true | true |
f747c43dd2301d2d61d582e8ab8b0488466235c8 | 4,356 | py | Python | website-backend/ava/jobs/models.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | null | null | null | website-backend/ava/jobs/models.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | null | null | null | website-backend/ava/jobs/models.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2017 Electronic Arts Inc. All Rights Reserved
#
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from model_utils.fields import MonitorField, StatusField
from model_utils.models import TimeStampedModel
from model_utils import C... | 37.551724 | 139 | 0.725207 |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from model_utils.fields import MonitorField, StatusField
from model_utils.models import TimeStampedModel
from model_utils import Choices
from archive.models import Take, StaticScanAsset, Tracki... | true | true |
f747c47b77ee10ec42fa1e8006ca41b0425162c5 | 5,484 | py | Python | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/express_route_circuit_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/express_route_circuit_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/express_route_circuit_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 50.777778 | 405 | 0.692378 |
from .resource_py3 import Resource
class ExpressRouteCircuit(Resource):
_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', ... | true | true |
f747c4d8a6bc6a057e8a2be91fba5d2dd7042f9f | 667 | py | Python | configs/alrp_loss/ap_loss_retinanet_r50_fpn_100e_coco500.py | kemaloksuz/aLRPLoss | 2cfaa8ec3150692cca8b085221f1bd8c8c78db8e | [
"Apache-2.0"
] | 126 | 2020-09-30T05:48:12.000Z | 2022-03-10T08:12:54.000Z | configs/alrp_loss/ap_loss_retinanet_r50_fpn_100e_coco500.py | fundamentalvision/Parameterized-AP-Loss | 0f36f022bfc2624f4add960cc27de464dba2c9f9 | [
"Apache-2.0"
] | 13 | 2020-11-13T06:29:48.000Z | 2021-09-14T20:33:52.000Z | configs/alrp_loss/ap_loss_retinanet_r50_fpn_100e_coco500.py | kemaloksuz/aLRPLoss | 2cfaa8ec3150692cca8b085221f1bd8c8c78db8e | [
"Apache-2.0"
] | 14 | 2020-10-04T14:48:29.000Z | 2022-01-08T14:04:46.000Z | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco500_detection_augm.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
bbox_head=dict(type='APLossRetinaHead',
anchor_generator=dict(scales_per_octave=2),
bbox_coder=dict(
... | 33.35 | 73 | 0.655172 | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco500_detection_augm.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
bbox_head=dict(type='APLossRetinaHead',
anchor_generator=dict(scales_per_octave=2),
bbox_coder=dict(
... | true | true |
f747c5230a951a6167b4e8260802d31407957835 | 5,494 | py | Python | pymc3_ext/step_methods/hmc/hmc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/step_methods/hmc/hmc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/step_methods/hmc/hmc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ..arraystep import Competence
from pymc3_ext.vartypes import discrete_types
from pymc3_ext.step_methods.hmc.integration import IntegrationError
from pymc3_ext.step_methods.hmc.base_hmc import BaseHMC, HMCStepData, DivergenceInfo
__all__ = ['HamiltonianMC']
def unif(step_size, elow=.85, ehig... | 38.964539 | 84 | 0.615217 | import numpy as np
from ..arraystep import Competence
from pymc3_ext.vartypes import discrete_types
from pymc3_ext.step_methods.hmc.integration import IntegrationError
from pymc3_ext.step_methods.hmc.base_hmc import BaseHMC, HMCStepData, DivergenceInfo
__all__ = ['HamiltonianMC']
def unif(step_size, elow=.85, ehig... | true | true |
f747c56cff56c7a02a33781ccf0c5001c7a0f4ad | 1,247 | py | Python | rpg/mocks.py | juanmagalhaes/rpg-manager | 32b88cec0baff0562b44a998f9e2ecd551361383 | [
"MIT"
] | 1 | 2018-05-08T18:30:49.000Z | 2018-05-08T18:30:49.000Z | rpg/mocks.py | juanmagalhaes/rpg-manager | 32b88cec0baff0562b44a998f9e2ecd551361383 | [
"MIT"
] | 2 | 2020-02-11T21:27:34.000Z | 2020-06-05T16:49:53.000Z | rpg/mocks.py | juanmagalhaes/rpg-manager | 32b88cec0baff0562b44a998f9e2ecd551361383 | [
"MIT"
] | null | null | null | from datetime import datetime
def create_game_mock(
name="Dungeons & Dragons",
sumary="Medieval fantasy adventures on D20 based systems",
):
return {
'name': name,
'sumary': sumary,
}
def create_item_mock(
name="Vorpal Sword",
description="Pierces anything",... | 21.877193 | 76 | 0.540497 | from datetime import datetime
def create_game_mock(
name="Dungeons & Dragons",
sumary="Medieval fantasy adventures on D20 based systems",
):
return {
'name': name,
'sumary': sumary,
}
def create_item_mock(
name="Vorpal Sword",
description="Pierces anything",... | true | true |
f747c5f4148789ffa72b834beacbd044a5cb6421 | 2,468 | py | Python | linear_error_analysis/src/main.py | spacesys-finch/Science | 623c9d77de6a52e87571debf7970cea7af591f2a | [
"MIT"
] | null | null | null | linear_error_analysis/src/main.py | spacesys-finch/Science | 623c9d77de6a52e87571debf7970cea7af591f2a | [
"MIT"
] | null | null | null | linear_error_analysis/src/main.py | spacesys-finch/Science | 623c9d77de6a52e87571debf7970cea7af591f2a | [
"MIT"
] | 1 | 2021-10-09T19:35:26.000Z | 2021-10-09T19:35:26.000Z | """
main.py
Main driver for the Linear Error Analysis program.
Can be run using `lea.sh`.
Can choose which plots to see by toggling on/off `show_fig` param.
Author(s): Adyn Miles, Shiqi Xu, Rosie Liang
"""
import os
import matplotlib.pyplot as plt
import numpy as np
import config
import libs.gta_xch4 as gta_xch4
i... | 28.697674 | 87 | 0.687601 |
import os
import matplotlib.pyplot as plt
import numpy as np
import config
import libs.gta_xch4 as gta_xch4
import libs.photon_noise as pn
from errors import Errors
from forward import Forward
from isrf import ISRF
from optim import Optim
if __name__ == "__main__":
cfg = config.parse_config()
forward = Fo... | true | true |
f747c6a71c66e49ecfa58700c9c153610f28792a | 3,036 | py | Python | Pong.py | ldtownsend/Python_Games | 50756de124b16f982995a522e8c7a18a95b4e66e | [
"MIT"
] | 1 | 2019-12-11T20:45:53.000Z | 2019-12-11T20:45:53.000Z | Pong.py | ldtownsend/Python_Games | 50756de124b16f982995a522e8c7a18a95b4e66e | [
"MIT"
] | null | null | null | Pong.py | ldtownsend/Python_Games | 50756de124b16f982995a522e8c7a18a95b4e66e | [
"MIT"
] | null | null | null | # Simple Pong in Python 3
# Tutorial by @TokyoEdTech
import turtle
wn = turtle.Screen()
wn.title("Pong by Luke Townsend")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)
# Paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stre... | 24.095238 | 134 | 0.629447 |
import turtle
wn = turtle.Screen()
wn.title("Pong by Luke Townsend")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=5, stretch_len=1)
paddle_a.penup()
paddle_a.goto(-350... | true | true |
f747c6f1c6f3731777c15dc597be876812958ac0 | 609 | py | Python | catalog/migrations/0004_bookinstance_borrower.py | skupriienko/django_local_library | 2bc2b380b806b6d83bd02cafe0370c835f55269b | [
"MIT"
] | null | null | null | catalog/migrations/0004_bookinstance_borrower.py | skupriienko/django_local_library | 2bc2b380b806b6d83bd02cafe0370c835f55269b | [
"MIT"
] | null | null | null | catalog/migrations/0004_bookinstance_borrower.py | skupriienko/django_local_library | 2bc2b380b806b6d83bd02cafe0370c835f55269b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-01 22:02
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0003_auto_202... | 27.681818 | 134 | 0.683087 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0003_auto_20201126_1636'),
]
operations = [
... | true | true |
f747c723ba6602da563b4f6e601579602eaae1b9 | 869 | py | Python | django_tpl_loader_component_test/service/views.py | haricot/django-tpl-loader-component-test | ea477ae1c2ed48132c2b019ff1f95c09eb68c34e | [
"MIT"
] | null | null | null | django_tpl_loader_component_test/service/views.py | haricot/django-tpl-loader-component-test | ea477ae1c2ed48132c2b019ff1f95c09eb68c34e | [
"MIT"
] | null | null | null | django_tpl_loader_component_test/service/views.py | haricot/django-tpl-loader-component-test | ea477ae1c2ed48132c2b019ff1f95c09eb68c34e | [
"MIT"
] | null | null | null | from rest_framework.filters import OrderingFilter, SearchFilter
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny, IsAdminUser
from django_filters.rest_framework import DjangoFilterBackend
from .models import ServiceAgentBus
from .serializers import ServiceAgentSerialize... | 24.138889 | 63 | 0.746835 | from rest_framework.filters import OrderingFilter, SearchFilter
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny, IsAdminUser
from django_filters.rest_framework import DjangoFilterBackend
from .models import ServiceAgentBus
from .serializers import ServiceAgentSerialize... | true | true |
f747c78dcf8f258ad007158b5446070cc457949d | 1,093 | py | Python | tests/basic/candle_engine.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | tests/basic/candle_engine.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | tests/basic/candle_engine.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | from vnpy.app.cta_strategy import BarData
class CandleEngine:
"""
蜡烛图分析引擎
"""
def recognitionBar(self, bar: BarData):
"""
识别单个bar数据
:param bar:
:return:
"""
candle_chart = CandleChart(bar.open_price, bar.high_price, bar.low_price, bar.close_price)
cla... | 30.361111 | 98 | 0.603843 | from vnpy.app.cta_strategy import BarData
class CandleEngine:
def recognitionBar(self, bar: BarData):
candle_chart = CandleChart(bar.open_price, bar.high_price, bar.low_price, bar.close_price)
class CandleChart:
def __init__(self, open: float, high: float, low: float, close: float):
self.o... | true | true |
f747c851f792f378c712cecd54dd22d634527ba7 | 9,357 | py | Python | src/TR/src/classesRT.py | MarceloFCandido/PIC | 884cdc3706fd00f7652cb3a04801c0c00fe7e73f | [
"MIT"
] | 2 | 2018-04-07T23:57:16.000Z | 2018-04-07T23:57:18.000Z | src/TR/src/classesRT.py | MarceloFCandido/PIC | 884cdc3706fd00f7652cb3a04801c0c00fe7e73f | [
"MIT"
] | 2 | 2018-04-13T13:30:36.000Z | 2018-11-05T16:32:27.000Z | src/TR/src/classesRT.py | MarceloFCandido/PIC01 | 884cdc3706fd00f7652cb3a04801c0c00fe7e73f | [
"MIT"
] | null | null | null | """
Arquivo: classesRT.py
Reune as classes utilizadas no tracamento de raios, definindo os elementos
que compoem o meio onde os raios serao tracados, definindo tambem os
proprios raios.
"""
from eqDiferencialOrdinaria import eqDiferencialOrdinaria as EDO
import numpy as np
class ray(EDO):
"""
... | 38.665289 | 80 | 0.523993 |
from eqDiferencialOrdinaria import eqDiferencialOrdinaria as EDO
import numpy as np
class ray(EDO):
def __init__(self, dimension, XP, time = 0.):
super(ray, self).__init__(dimension)
self.XP = XP
self.time = np.array([0.])
def evaluate(self, Y, v):
retorno ... | true | true |
f747c879cbb691c4fc5a098e32bc3ff77069173b | 235 | py | Python | config.sample.py | oysteinoren/testGithub | 71a3f0ba805ae5259b3863ff993d4c8986dc3ada | [
"MIT"
] | 2 | 2017-03-10T10:38:01.000Z | 2017-10-11T03:02:40.000Z | config.sample.py | oysteinoren/testGithub | 71a3f0ba805ae5259b3863ff993d4c8986dc3ada | [
"MIT"
] | null | null | null | config.sample.py | oysteinoren/testGithub | 71a3f0ba805ae5259b3863ff993d4c8986dc3ada | [
"MIT"
] | 1 | 2019-06-05T09:34:34.000Z | 2019-06-05T09:34:34.000Z | FACEBOOK_USER = ""
FACEBOOK_PASSWORD = ""
FACEBOOK_ID = ""
AUTO_LIKE = True
DB_NAME = ""
DB_USER = ""
DB_PASSWORD = ""
WEBSERVER_FOLDER = ""
NOTIFICATIONS_EMAIL = ""
SMTP_SERVER = ""
SMTP_PASSWORD = ""
NOTIFICATIONS_IFTTT_KEY = "" | 13.823529 | 28 | 0.685106 | FACEBOOK_USER = ""
FACEBOOK_PASSWORD = ""
FACEBOOK_ID = ""
AUTO_LIKE = True
DB_NAME = ""
DB_USER = ""
DB_PASSWORD = ""
WEBSERVER_FOLDER = ""
NOTIFICATIONS_EMAIL = ""
SMTP_SERVER = ""
SMTP_PASSWORD = ""
NOTIFICATIONS_IFTTT_KEY = "" | true | true |
f747c8fb76c502fbe8730bc3204bed979825ccff | 6,680 | py | Python | pybind/nos/v7_1_0/interface/hundredgigabitethernet/snmp/trap/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/snmp/trap/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/snmp/trap/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 51.782946 | 574 | 0.72006 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f747c97748ee682b185ee2d7d5782aca2bfe16ab | 3,345 | py | Python | utils/make-sqlite.py | BuloZB/https-everywhere | cf994d1d8389e6bf611c736ac20beb485dea5c3f | [
"MIT"
] | null | null | null | utils/make-sqlite.py | BuloZB/https-everywhere | cf994d1d8389e6bf611c736ac20beb485dea5c3f | [
"MIT"
] | null | null | null | utils/make-sqlite.py | BuloZB/https-everywhere | cf994d1d8389e6bf611c736ac20beb485dea5c3f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
#
# Builds an sqlite DB containing all the rulesets, indexed by target.
import glob
import locale
import os
import sqlite3
import subprocess
import sys
from collections import Counter
from lxml import etree
# Explicitly set locale so sorting order for filenames is consistent.
# This is impor... | 34.84375 | 105 | 0.688789 |
import glob
import locale
import os
import sqlite3
import subprocess
import sys
from collections import Counter
from lxml import etree
tlocale(locale.LC_ALL, 'C')
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), '../src/defaults/rulesets.sqlite'))
c = conn.cursor()
c.execute('''DROP TABLE IF EXIS... | true | true |
f747c992a9124f114a911fe54822ff0b2570003a | 429 | py | Python | 0001-0100/0064-Minimum Path Sum/0064-Minimum Path Sum.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0001-0100/0064-Minimum Path Sum/0064-Minimum Path Sum.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0001-0100/0064-Minimum Path Sum/0064-Minimum Path Sum.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
m = len(grid)
if m == 0:
return 0
n = len(grid[0])
for j in range(1, n):
grid[0][j] += grid[0][j - 1]
for i in range(1, m):
grid[i][0] += grid[i - 1][0]
for j i... | 30.642857 | 65 | 0.410256 | class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
m = len(grid)
if m == 0:
return 0
n = len(grid[0])
for j in range(1, n):
grid[0][j] += grid[0][j - 1]
for i in range(1, m):
grid[i][0] += grid[i - 1][0]
for j i... | true | true |
f747c9cd5d8014fb94e542ea8a63fb8dd7380af2 | 13,167 | py | Python | moto/ec2/exceptions.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 2 | 2019-07-10T14:44:12.000Z | 2020-06-08T17:26:29.000Z | moto/ec2/exceptions.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 5 | 2018-04-25T21:04:20.000Z | 2018-11-02T19:59:27.000Z | moto/ec2/exceptions.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 2 | 2020-01-13T17:51:02.000Z | 2020-07-24T17:50:44.000Z | from __future__ import unicode_literals
from moto.core.exceptions import RESTError
class EC2ClientError(RESTError):
code = 400
class DependencyViolationError(EC2ClientError):
def __init__(self, message):
super(DependencyViolationError, self).__init__(
"DependencyViolation", message)
c... | 31.12766 | 112 | 0.670616 | from __future__ import unicode_literals
from moto.core.exceptions import RESTError
class EC2ClientError(RESTError):
code = 400
class DependencyViolationError(EC2ClientError):
def __init__(self, message):
super(DependencyViolationError, self).__init__(
"DependencyViolation", message)
c... | true | true |
f747cab237ad806ed50fa94850957921316214ea | 1,179 | py | Python | examples/Python/RNAfold_MEA.py | tsjzz/ViennaRNA | f58f58ac6fb3e050f12e69cbbf7f0a95bc625d99 | [
"Python-2.0"
] | 1 | 2021-12-02T06:38:05.000Z | 2021-12-02T06:38:05.000Z | examples/Python/RNAfold_MEA.py | tsjzz/ViennaRNA | f58f58ac6fb3e050f12e69cbbf7f0a95bc625d99 | [
"Python-2.0"
] | null | null | null | examples/Python/RNAfold_MEA.py | tsjzz/ViennaRNA | f58f58ac6fb3e050f12e69cbbf7f0a95bc625d99 | [
"Python-2.0"
] | null | null | null | #!/usr/bin/python
#
import RNA
seq = "AUUUCCACUAGAGAAGGUCUAGAGUGUUUGUCGUUUGUCAGAAGUCCCUAUUCCAGGUACGAACACGGUGGAUAUGUUCGACGACAGGAUCGGCGCACUA"
# create fold_compound data structure (required for all subsequently applied algorithms)
fc = RNA.fold_compound(seq)
# compute MFE and MFE structure
(mfe_struct, mfe) = fc.mfe... | 31.026316 | 141 | 0.741306 |
import RNA
seq = "AUUUCCACUAGAGAAGGUCUAGAGUGUUUGUCGUUUGUCAGAAGUCCCUAUUCCAGGUACGAACACGGUGGAUAUGUUCGACGACAGGAUCGGCGCACUA"
fc = RNA.fold_compound(seq)
(mfe_struct, mfe) = fc.mfe()
fc.exp_params_rescale(mfe)
(pp, pf) = fc.pf()
(centroid_struct, dist) = fc.centroid()
centroid_en = fc.eval_structure(centroid_... | true | true |
f747cad6c46411db2d4dc2a79b5cd4e1cf42b62f | 1,388 | py | Python | django_blog/urls.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | django_blog/urls.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | django_blog/urls.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | """djangoBlog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 40.823529 | 101 | 0.729107 | from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from users import views as user_views
urlpatterns = [
path('admin/', admin.site.urls),
path('register/', user_vi... | true | true |
f747cb6c0fa2c6bd8c3825dfcb95392d3218e245 | 229 | py | Python | tests/arbpack/arbinvalidimportmod.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 261 | 2020-08-18T19:31:29.000Z | 2022-03-31T14:54:06.000Z | tests/arbpack/arbinvalidimportmod.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 89 | 2017-04-12T09:50:32.000Z | 2020-08-13T13:18:36.000Z | tests/arbpack/arbinvalidimportmod.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 15 | 2020-09-30T12:15:50.000Z | 2022-03-30T07:25:40.000Z | """Module will not import due to invalid blahblah import."""
import blahblah.blah
print("I dont do much")
def arbmodinvalid_attribute():
"""Can't ever run on account of how blah doesn't exist."""
blahblah.blah.blah()
| 20.818182 | 62 | 0.703057 | import blahblah.blah
print("I dont do much")
def arbmodinvalid_attribute():
blahblah.blah.blah()
| true | true |
f747cb701495e98da0898401c18ec0d5e5c58ba6 | 2,705 | py | Python | src/rubrix/sdk/models/text_classification_annotation.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/text_classification_annotation.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/text_classification_annotation.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# 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 ... | 29.086022 | 77 | 0.655083 |
from typing import Any, Dict, List, Type, TypeVar
import attr
from ..models.class_prediction import ClassPrediction
T = TypeVar("T", bound="TextClassificationAnnotation")
@attr.s(auto_attribs=True)
class TextClassificationAnnotation:
agent: str
labels: List[ClassPrediction]
additional_p... | true | true |
f747cd44893cfd12ecca93170e1b769af5d74877 | 8,324 | py | Python | vnpy/api/bitmex/vnbitmex.py | SonHOuse1993/vnpy | afd63cc7ea2217634613a07864db3f48e13e6e33 | [
"MIT"
] | 5 | 2019-01-17T12:14:14.000Z | 2021-05-30T10:24:42.000Z | vnpy/api/bitmex/vnbitmex.py | SonHOuse1993/vnpy | afd63cc7ea2217634613a07864db3f48e13e6e33 | [
"MIT"
] | null | null | null | vnpy/api/bitmex/vnbitmex.py | SonHOuse1993/vnpy | afd63cc7ea2217634613a07864db3f48e13e6e33 | [
"MIT"
] | 5 | 2019-03-26T03:17:45.000Z | 2019-11-05T08:08:18.000Z | # encoding: UTF-8
from __future__ import print_function
import hashlib
import hmac
import json
import ssl
import traceback
from queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import time
from urlparse import urlparse
from copy import copy
from urllib import urlencode
from threading import ... | 28.802768 | 100 | 0.417468 |
from __future__ import print_function
import hashlib
import hmac
import json
import ssl
import traceback
from queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import time
from urlparse import urlparse
from copy import copy
from urllib import urlencode
from threading import Thread
from six.... | true | true |
f747cde52a86865a9b4c914435659ed13a1e8bad | 11,410 | py | Python | generators/app/templates/python/app.py | shumach5/generator-line-bot | e1e8849d3116e1a559fe6128195a696216210916 | [
"MIT"
] | 4 | 2018-01-29T09:52:22.000Z | 2019-09-03T03:11:40.000Z | generators/app/templates/python/app.py | shumach5/generator-line-bot | e1e8849d3116e1a559fe6128195a696216210916 | [
"MIT"
] | 4 | 2017-12-14T01:01:40.000Z | 2020-02-14T07:17:39.000Z | generators/app/templates/python/app.py | shumach5/generator-line-bot | e1e8849d3116e1a559fe6128195a696216210916 | [
"MIT"
] | 3 | 2017-12-14T01:01:54.000Z | 2020-11-13T23:44:12.000Z | # -*- coding: utf-8 -*-
# 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, ... | 36.925566 | 96 | 0.650307 |
from __future__ import unicode_literals
import errno
import os
import sys
import tempfile
from argparse import ArgumentParser
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models i... | true | true |
f747ceff035a41e272dafe720387c5920af21959 | 703 | py | Python | posthog/settings/dynamic_settings.py | leirons/posthog | 3d8bcdfae03a1ead9aad44cd4d176ca2180c1ea4 | [
"MIT"
] | 7,409 | 2020-02-09T23:18:10.000Z | 2022-03-31T22:36:25.000Z | posthog/settings/dynamic_settings.py | leirons/posthog | 3d8bcdfae03a1ead9aad44cd4d176ca2180c1ea4 | [
"MIT"
] | 5,709 | 2020-02-09T23:26:13.000Z | 2022-03-31T20:20:01.000Z | posthog/settings/dynamic_settings.py | leirons/posthog | 3d8bcdfae03a1ead9aad44cd4d176ca2180c1ea4 | [
"MIT"
] | 647 | 2020-02-13T17:50:55.000Z | 2022-03-31T11:24:19.000Z | from posthog.settings.utils import get_from_env, str_to_bool
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
CONSTANCE_DATABASE_PREFIX = "constance:posthog:"
CONSTANCE_CONFIG = {
"MATERIALIZED_COLUMNS_ENABLED": (
get_from_env("MATERIALIZED_COLUMNS_ENABLED", True, type_cast=str_to_bool),... | 37 | 120 | 0.745377 | from posthog.settings.utils import get_from_env, str_to_bool
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
CONSTANCE_DATABASE_PREFIX = "constance:posthog:"
CONSTANCE_CONFIG = {
"MATERIALIZED_COLUMNS_ENABLED": (
get_from_env("MATERIALIZED_COLUMNS_ENABLED", True, type_cast=str_to_bool),... | true | true |
f747d0568e53d968c75ddc172682ae40be043819 | 8,847 | py | Python | rasa/core/run.py | AndrewKinsman/rasa | 810d1c2f52261b3704b0b77b7fcb8c63eafaeb5e | [
"Apache-2.0"
] | null | null | null | rasa/core/run.py | AndrewKinsman/rasa | 810d1c2f52261b3704b0b77b7fcb8c63eafaeb5e | [
"Apache-2.0"
] | 3 | 2020-09-26T01:29:46.000Z | 2021-05-21T16:46:15.000Z | rasa/core/run.py | AndrewKinsman/rasa | 810d1c2f52261b3704b0b77b7fcb8c63eafaeb5e | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import os
import shutil
import warnings
from functools import partial
from typing import Any, List, Optional, Text, Union
import rasa.core.utils
import rasa.utils
import rasa.utils.common
import rasa.utils.io
from rasa import model, server
from rasa.constants import ENV_SANIC_BACKLOG
from... | 32.170909 | 86 | 0.672657 | import asyncio
import logging
import os
import shutil
import warnings
from functools import partial
from typing import Any, List, Optional, Text, Union
import rasa.core.utils
import rasa.utils
import rasa.utils.common
import rasa.utils.io
from rasa import model, server
from rasa.constants import ENV_SANIC_BACKLOG
from... | true | true |
f747d08fe09943102dcf8e7a62ac0abcdf563dea | 3,618 | py | Python | alembic/compat.py | limodou/uliweb-alembic | 177ff67441a0f07d464df196caa43f894a0bd6aa | [
"MIT"
] | null | null | null | alembic/compat.py | limodou/uliweb-alembic | 177ff67441a0f07d464df196caa43f894a0bd6aa | [
"MIT"
] | null | null | null | alembic/compat.py | limodou/uliweb-alembic | 177ff67441a0f07d464df196caa43f894a0bd6aa | [
"MIT"
] | null | null | null | import io
import sys
from sqlalchemy import __version__ as sa_version
if sys.version_info < (2, 6):
raise NotImplementedError("Python 2.6 or greater is required.")
sqla_08 = sa_version >= '0.8.0'
sqla_09 = sa_version >= '0.9.0'
py2k = sys.version_info < (3, 0)
py3k = sys.version_info >= (3, 0)
py33 = sys.version... | 25.842857 | 73 | 0.623273 | import io
import sys
from sqlalchemy import __version__ as sa_version
if sys.version_info < (2, 6):
raise NotImplementedError("Python 2.6 or greater is required.")
sqla_08 = sa_version >= '0.8.0'
sqla_09 = sa_version >= '0.9.0'
py2k = sys.version_info < (3, 0)
py3k = sys.version_info >= (3, 0)
py33 = sys.version... | true | true |
f747d0f8803d5ef7d4a0440c636db6069c5f6d59 | 4,147 | py | Python | src/model.py | pmoe7/Stock-Price-Prediction | 062874fc2565fb14b5a25856baeabdcf705c646f | [
"MIT"
] | 3 | 2019-03-11T02:48:11.000Z | 2021-03-18T06:45:42.000Z | src/model.py | pmuhamed1/Stock-Price-Prediction | 062874fc2565fb14b5a25856baeabdcf705c646f | [
"MIT"
] | null | null | null | src/model.py | pmuhamed1/Stock-Price-Prediction | 062874fc2565fb14b5a25856baeabdcf705c646f | [
"MIT"
] | null | null | null | """
-------------------------------------------------------
model.py
[program description]
-------------------------------------------------------
Author: Mohammed Perves
ID: 170143440
Email: moha3440@mylaurier.ca
__updated__ = "2018-06-20"
-------------------------------------------------------
"""
... | 33.715447 | 133 | 0.621654 | import csv
import numpy as np
from sklearn.svm import SVR
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn import preprocessing
import stock_data
from sklearn.externals import joblib
scaler = preprocessing.StandardScaler()
dates = []
prices = []
def normalize_data(dat... | true | true |
f747d19302bf185d6dda85b34436250f6acaa655 | 307 | py | Python | iptocc/exceptions.py | roniemartinez/IPToCC | c60bc68952a699b6d3b1b7c491458ac5d214191d | [
"MIT"
] | 7 | 2019-05-13T09:29:20.000Z | 2020-03-31T13:43:32.000Z | iptocc/exceptions.py | Code-ReaQtor/IPToCC | c60bc68952a699b6d3b1b7c491458ac5d214191d | [
"MIT"
] | 6 | 2018-05-22T18:44:54.000Z | 2018-10-17T14:13:28.000Z | iptocc/exceptions.py | Code-ReaQtor/IPToCC | c60bc68952a699b6d3b1b7c491458ac5d214191d | [
"MIT"
] | 2 | 2018-05-22T19:21:33.000Z | 2018-05-23T05:18:54.000Z | #!/usr/bin/env python
# __author__ = "Ronie Martinez"
# __copyright__ = "Copyright 2020, Ronie Martinez"
# __credits__ = ["Ronie Martinez"]
# __maintainer__ = "Ronie Martinez"
# __email__ = "ronmarti18@gmail.com"
class CountryCodeNotFound(Exception):
pass
class CountryNotFound(Exception):
pass
| 20.466667 | 50 | 0.732899 |
class CountryCodeNotFound(Exception):
pass
class CountryNotFound(Exception):
pass
| true | true |
f747d45cb1c7cc3ea60fb29bfbff803ba51bb9e1 | 3,405 | py | Python | tests/test_env.py | bothub-it/python-decouple | 2f36cdbbff46d5f9142bf52b454959c06934a06b | [
"MIT"
] | null | null | null | tests/test_env.py | bothub-it/python-decouple | 2f36cdbbff46d5f9142bf52b454959c06934a06b | [
"MIT"
] | null | null | null | tests/test_env.py | bothub-it/python-decouple | 2f36cdbbff46d5f9142bf52b454959c06934a06b | [
"MIT"
] | null | null | null | # coding: utf-8
import os
import sys
from mock import patch
import pytest
from decouple import Config, RepositoryEnv, UndefinedValueError
# Useful for very coarse version differentiation.
PY3 = sys.version_info[0] == 3
if PY3:
from io import StringIO
else:
from io import BytesIO as StringIO
ENVFILE = '''
K... | 25.992366 | 77 | 0.728928 |
import os
import sys
from mock import patch
import pytest
from decouple import Config, RepositoryEnv, UndefinedValueError
PY3 = sys.version_info[0] == 3
if PY3:
from io import StringIO
else:
from io import BytesIO as StringIO
ENVFILE = '''
KeyTrue=True
KeyOne=1
KeyYes=yes
KeyOn=on
KeyY=y
KeyFalse=False
... | true | true |
f747d57939fb2c75c85b0a984efbbab992590454 | 8,663 | py | Python | Scripts/schemaMatch.py | alishiba14/Neural-Class-Alignement-for-OSM-and-KG- | 0c7d15e27fe85287043273f187c9aff3d8c438ae | [
"MIT"
] | null | null | null | Scripts/schemaMatch.py | alishiba14/Neural-Class-Alignement-for-OSM-and-KG- | 0c7d15e27fe85287043273f187c9aff3d8c438ae | [
"MIT"
] | null | null | null | Scripts/schemaMatch.py | alishiba14/Neural-Class-Alignement-for-OSM-and-KG- | 0c7d15e27fe85287043273f187c9aff3d8c438ae | [
"MIT"
] | 1 | 2021-05-19T17:37:25.000Z | 2021-05-19T17:37:25.000Z | #!/usr/bin/env python
# coding: utf-8
from sklearn.model_selection import KFold
import pandas as pd
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from skmultilearn.problem_transform import LabelPowerset
from imblearn.over_sampling import RandomOverSampler
from keras.models import Model
f... | 30.29021 | 237 | 0.680134 |
from sklearn.model_selection import KFold
import pandas as pd
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from skmultilearn.problem_transform import LabelPowerset
from imblearn.over_sampling import RandomOverSampler
from keras.models import Model
from keras.losses import binary_cross... | true | true |
f747d706189e80120928b70bc4ece1fa1ee686f0 | 2,944 | py | Python | applications/ShallowWaterApplication/python_scripts/testing/empty_solver_for_testing.py | ma6yu/Kratos | 02380412f8a833a2cdda6791e1c7f9c32e088530 | [
"BSD-4-Clause"
] | null | null | null | applications/ShallowWaterApplication/python_scripts/testing/empty_solver_for_testing.py | ma6yu/Kratos | 02380412f8a833a2cdda6791e1c7f9c32e088530 | [
"BSD-4-Clause"
] | null | null | null | applications/ShallowWaterApplication/python_scripts/testing/empty_solver_for_testing.py | ma6yu/Kratos | 02380412f8a833a2cdda6791e1c7f9c32e088530 | [
"BSD-4-Clause"
] | null | null | null | # Importing the Kratos Library
import KratosMultiphysics as KM
from KratosMultiphysics.python_solver import PythonSolver
# Import applications
import KratosMultiphysics.ShallowWaterApplication as SW
def CreateSolver(model, custom_settings):
return EmptySolverForTesting(model, custom_settings)
class EmptySolverFo... | 40.328767 | 128 | 0.662704 |
import KratosMultiphysics as KM
from KratosMultiphysics.python_solver import PythonSolver
import KratosMultiphysics.ShallowWaterApplication as SW
def CreateSolver(model, custom_settings):
return EmptySolverForTesting(model, custom_settings)
class EmptySolverForTesting(PythonSolver):
def __init__(self, mode... | true | true |
f747d71498aaa6ffc1e7217ebf5c98c7f0cb1eb3 | 39,875 | py | Python | kombu/transport/redis.py | hfern/kombu | d92af45cc0b2754b94a1920f445b8b3d84e85057 | [
"BSD-3-Clause"
] | null | null | null | kombu/transport/redis.py | hfern/kombu | d92af45cc0b2754b94a1920f445b8b3d84e85057 | [
"BSD-3-Clause"
] | null | null | null | kombu/transport/redis.py | hfern/kombu | d92af45cc0b2754b94a1920f445b8b3d84e85057 | [
"BSD-3-Clause"
] | null | null | null | """Redis transport."""
from __future__ import absolute_import, unicode_literals
import numbers
import socket
from bisect import bisect
from collections import namedtuple
from contextlib import contextmanager
from time import time
from vine import promise
from kombu.exceptions import InconsistencyError, VersionMisma... | 35.350177 | 79 | 0.596288 | from __future__ import absolute_import, unicode_literals
import numbers
import socket
from bisect import bisect
from collections import namedtuple
from contextlib import contextmanager
from time import time
from vine import promise
from kombu.exceptions import InconsistencyError, VersionMismatch
from kombu.five imp... | true | true |
f747d93d246f06e9bef7cf0a7e7c4c6e048cabef | 8,926 | py | Python | spyder/api/widgets/menus.py | skjerns/spyder | c130a2e2f8782d8a27886da100e70e1e47d903f5 | [
"MIT"
] | null | null | null | spyder/api/widgets/menus.py | skjerns/spyder | c130a2e2f8782d8a27886da100e70e1e47d903f5 | [
"MIT"
] | null | null | null | spyder/api/widgets/menus.py | skjerns/spyder | c130a2e2f8782d8a27886da100e70e1e47d903f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder API menu widgets.
"""
# Standard library imports
import sys
from typing import Optional, Union, TypeVar
# Third party imports
from qtpy.QtWidgets import ... | 33.182156 | 79 | 0.565987 |
import sys
from typing import Optional, Union, TypeVar
from qtpy.QtWidgets import QAction, QMenu
from spyder.utils.qthelpers import add_actions, SpyderAction
MENU_SEPARATOR = None
T = TypeVar('T', bound='SpyderMenu')
class OptionsMenuSections:
Top = 'top_section'
Bottom = 'bottom_section'
... | true | true |
f747d96022a88d61078249831b76ed1d6d523d49 | 21,749 | py | Python | cinder/test.py | scottwedge/cinder | 7fc6cf116b95ed9545763a49189ab0502816e161 | [
"Apache-2.0"
] | null | null | null | cinder/test.py | scottwedge/cinder | 7fc6cf116b95ed9545763a49189ab0502816e161 | [
"Apache-2.0"
] | 3 | 2020-03-02T01:36:30.000Z | 2021-12-13T20:27:46.000Z | cinder/test.py | scottwedge/cinder | 7fc6cf116b95ed9545763a49189ab0502816e161 | [
"Apache-2.0"
] | 1 | 2020-03-02T01:32:26.000Z | 2020-03-02T01:32:26.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 38.630551 | 79 | 0.622465 |
import copy
import logging
import os
import sys
import uuid
from eventlet import tpool
import fixtures
import mock
from oslo_concurrency import lockutils
from oslo_config import fixture as config_fixture
from oslo_log.fixture import logging_error as log_fixture
import oslo_messaging
from oslo_messaging... | true | true |
f747db9480139fa29147a1166d5efa9bb6ba24b8 | 297 | py | Python | pyjac/tests/test_utils.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 24 | 2017-03-14T05:14:18.000Z | 2022-03-30T06:35:47.000Z | pyjac/tests/test_utils.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 34 | 2017-01-18T18:56:11.000Z | 2022-02-08T15:46:13.000Z | pyjac/tests/test_utils.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 21 | 2017-02-04T11:25:56.000Z | 2022-02-14T13:57:13.000Z | # Python 2 compatibility
from __future__ import print_function
from __future__ import division
import sys
from .. import utils
class TestUtils(object):
"""
"""
def test_imported(self):
"""Ensure utils module imported.
"""
assert 'pyjac.utils' in sys.modules
| 18.5625 | 43 | 0.670034 |
from __future__ import print_function
from __future__ import division
import sys
from .. import utils
class TestUtils(object):
def test_imported(self):
assert 'pyjac.utils' in sys.modules
| true | true |
f747db9f161b6f34890be57acb5a18f5f945bd5a | 738 | py | Python | ciphey/basemods/Checkers/human.py | blackcat-917/Ciphey | d24deea87cec2dea2e04ec3859b9e77e121d192a | [
"MIT"
] | 1 | 2021-11-28T17:55:04.000Z | 2021-11-28T17:55:04.000Z | ciphey/basemods/Checkers/human.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 2 | 2021-04-06T18:32:08.000Z | 2021-06-02T04:02:31.000Z | ciphey/basemods/Checkers/human.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 1 | 2021-03-09T02:33:23.000Z | 2021-03-09T02:33:23.000Z | from typing import Dict, Optional
from ciphey.iface import Checker, Config, ParamSpec, registry
@registry.register
class HumanChecker(Checker[str]):
@staticmethod
def getParams() -> Optional[Dict[str, ParamSpec]]:
pass
def check(self, text: str) -> Optional[str]:
with self._config().paus... | 27.333333 | 73 | 0.602981 | from typing import Dict, Optional
from ciphey.iface import Checker, Config, ParamSpec, registry
@registry.register
class HumanChecker(Checker[str]):
@staticmethod
def getParams() -> Optional[Dict[str, ParamSpec]]:
pass
def check(self, text: str) -> Optional[str]:
with self._config().paus... | true | true |
f747dbabb57b6c846ef5fd7992dc342810e75e3f | 3,737 | py | Python | src/modules/qlib/src/qlib/utils/logging.py | ads-ad-itcenter/qunomon.forked | 48d532692d353fe2d3946f62b227f834f9349034 | [
"Apache-2.0"
] | 16 | 2020-11-18T05:43:55.000Z | 2021-11-27T14:43:26.000Z | src/modules/qlib/src/qlib/utils/logging.py | aistairc/qunomon | d4e9c5cb569b16addfbe6c33c73812065065a1df | [
"Apache-2.0"
] | 1 | 2022-03-23T07:55:54.000Z | 2022-03-23T13:24:11.000Z | src/modules/qlib/src/qlib/utils/logging.py | ads-ad-itcenter/qunomon.forked | 48d532692d353fe2d3946f62b227f834f9349034 | [
"Apache-2.0"
] | 3 | 2021-02-12T01:56:31.000Z | 2022-03-23T02:45:02.000Z | # Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved.
# !/usr/bin/env python3.6
# coding=utf-8
import inspect
import logging
from functools import wraps
from pathlib import Path
from datetime import datetime
from pytz import timezone
# グローバル変数 ログ保存フォルダパス
g_lo... | 24.266234 | 112 | 0.569708 |
import inspect
import logging
from functools import wraps
from pathlib import Path
from datetime import datetime
from pytz import timezone
g_log_dir = Path('./logs')
def set_log_dir(dir: str) -> None:
global g_log_dir
g_log_dir = Path(dir)
def get_log_path() -> str:
jst_datetime = datetime.now().a... | true | true |
f747dbb60f964892743537d4f5584aa5ed6b68e8 | 3,930 | py | Python | autoelective/config.py | 12f23eddde/PKUAutoElective | 1a7094ea14a90fb23a3bd33d013bf5a46127394f | [
"MIT"
] | 1 | 2019-12-09T10:01:08.000Z | 2019-12-09T10:01:08.000Z | autoelective/config.py | 12f23eddde/PKUAutoElective | 1a7094ea14a90fb23a3bd33d013bf5a46127394f | [
"MIT"
] | null | null | null | autoelective/config.py | 12f23eddde/PKUAutoElective | 1a7094ea14a90fb23a3bd33d013bf5a46127394f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# filename: config.py
# modified: 2019-09-10
__all__ = ["AutoElectiveConfig"]
import os
from configparser import RawConfigParser
from .utils import Singleton
from .const import CONFIG_INI
class BaseConfig(object, metaclass=Singleton):
CONFIG_FILE = ""
ALLOW_NO... | 26.02649 | 114 | 0.652672 |
__all__ = ["AutoElectiveConfig"]
import os
from configparser import RawConfigParser
from .utils import Singleton
from .const import CONFIG_INI
class BaseConfig(object, metaclass=Singleton):
CONFIG_FILE = ""
ALLOW_NO_VALUE = True
def __init__(self):
if self.__class__ is __class__:
... | true | true |
f747dc1fd5929b03fe42c04109db7f7018edfcd5 | 2,260 | py | Python | graph4nlp/pytorch/modules/prediction/classification/link_prediction/ConcatFeedForwardNN.py | stjordanis/graph4nlp | c6ebde32bc77d3a7b78f86a93f19b1c057963ffa | [
"Apache-2.0"
] | 1 | 2021-06-06T15:23:11.000Z | 2021-06-06T15:23:11.000Z | graph4nlp/pytorch/modules/prediction/classification/link_prediction/ConcatFeedForwardNN.py | stjordanis/graph4nlp | c6ebde32bc77d3a7b78f86a93f19b1c057963ffa | [
"Apache-2.0"
] | null | null | null | graph4nlp/pytorch/modules/prediction/classification/link_prediction/ConcatFeedForwardNN.py | stjordanis/graph4nlp | c6ebde32bc77d3a7b78f86a93f19b1c057963ffa | [
"Apache-2.0"
] | 1 | 2021-11-01T08:41:26.000Z | 2021-11-01T08:41:26.000Z | from torch import nn
import torch
from ..base import LinkPredictionBase
from .ConcatFeedForwardNNLayer import ConcatFeedForwardNNLayer
class ConcatFeedForwardNN(LinkPredictionBase):
r"""Specific class for link prediction task.
Parameters
----------
input_size : int
The length of inp... | 32.285714 | 95 | 0.613274 | from torch import nn
import torch
from ..base import LinkPredictionBase
from .ConcatFeedForwardNNLayer import ConcatFeedForwardNNLayer
class ConcatFeedForwardNN(LinkPredictionBase):
def __init__(self, input_size, hidden_size,num_class,activation=nn.ReLU()):
super(ConcatFeedForwardNN, self).__init_... | true | true |
f747dd63473b4989e5310f058a83b3e5cd0300cb | 1,102 | py | Python | test/test_marshall_enum.py | tofarr/marshy | 0eb9620f42e3492a8d3275911879d2ed4c226e37 | [
"MIT"
] | 1 | 2022-02-26T20:34:32.000Z | 2022-02-26T20:34:32.000Z | test/test_marshall_enum.py | tofarr/marshy | 0eb9620f42e3492a8d3275911879d2ed4c226e37 | [
"MIT"
] | null | null | null | test/test_marshall_enum.py | tofarr/marshy | 0eb9620f42e3492a8d3275911879d2ed4c226e37 | [
"MIT"
] | null | null | null | from enum import Enum
from unittest import TestCase
from marshy import dump, load, get_default_context
from marshy.errors import MarshallError
from marshy.factory.enum_marshaller_factory import EnumMarshallerFactory
class VehicleTypes(Enum):
CAR = 'car'
TRUCK = 'truck'
BIKE = 'bike'
class TestMarshallE... | 31.485714 | 106 | 0.711434 | from enum import Enum
from unittest import TestCase
from marshy import dump, load, get_default_context
from marshy.errors import MarshallError
from marshy.factory.enum_marshaller_factory import EnumMarshallerFactory
class VehicleTypes(Enum):
CAR = 'car'
TRUCK = 'truck'
BIKE = 'bike'
class TestMarshallE... | true | true |
f747dd680888d4c445a1f7ec7e18877a9b854f4b | 646 | py | Python | examples/jit/reduction_simple.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 6,180 | 2016-11-01T14:22:30.000Z | 2022-03-31T08:39:20.000Z | examples/jit/reduction_simple.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 6,281 | 2016-12-22T07:42:31.000Z | 2022-03-31T19:57:02.000Z | examples/jit/reduction_simple.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 829 | 2017-02-23T05:46:12.000Z | 2022-03-27T17:40:03.000Z | import cupy
from cupyx import jit
@jit.rawkernel()
def reduction(x, y, size):
tid = jit.threadIdx.x
ntid = jit.blockDim.x
value = cupy.float32(0)
for i in range(tid, size, ntid):
value += x[i]
smem = jit.shared_memory(cupy.float32, 1024)
smem[tid] = value
jit.syncthreads()
... | 19 | 56 | 0.592879 | import cupy
from cupyx import jit
@jit.rawkernel()
def reduction(x, y, size):
tid = jit.threadIdx.x
ntid = jit.blockDim.x
value = cupy.float32(0)
for i in range(tid, size, ntid):
value += x[i]
smem = jit.shared_memory(cupy.float32, 1024)
smem[tid] = value
jit.syncthreads()
... | true | true |
f747de00d445f65ca51260e126fe9231de366ce5 | 6,871 | py | Python | seismiqb/src/controllers/extender.py | gazprom-neft/seismiqb | d4906d41c79407c99cfa6f91d6005c0e453d1138 | [
"Apache-2.0"
] | 73 | 2019-10-08T08:50:12.000Z | 2022-03-23T20:18:02.000Z | seismiqb/src/controllers/extender.py | gazprom-neft/seismiqb | d4906d41c79407c99cfa6f91d6005c0e453d1138 | [
"Apache-2.0"
] | 69 | 2019-09-06T14:00:57.000Z | 2022-03-30T13:02:54.000Z | seismiqb/src/controllers/extender.py | gazprom-neft/seismiqb | d4906d41c79407c99cfa6f91d6005c0e453d1138 | [
"Apache-2.0"
] | 28 | 2019-11-04T18:40:07.000Z | 2022-03-23T16:18:54.000Z | """ A holder for horizon extension steps inherited from `.class:Enhancer` with:
- redifined get_mask_transform_ppl to thin out loaded mask
- making an iterative inference to cover the holes in a given horizon.
"""
import gc
from copy import copy
from pprint import pformat
from time import perf_counter
import n... | 38.172222 | 111 | 0.58434 | import gc
from copy import copy
from pprint import pformat
from time import perf_counter
import numpy as np
import torch
from .enhancer import Enhancer
from ..labels import Horizon
from ..samplers import ExtensionGrid
from ...batchflow import Pipeline, Config, Notifier, Monitor
from ...batchflow import B, F, C, V, ... | true | true |
f747de2aba2819688e0835aff9cf22c8921e3126 | 2,203 | py | Python | main.py | YannHyaric/evolutionary-computation | af7778fd1b5d60a1e5630b483b55257adac0bbc6 | [
"MIT"
] | null | null | null | main.py | YannHyaric/evolutionary-computation | af7778fd1b5d60a1e5630b483b55257adac0bbc6 | [
"MIT"
] | null | null | null | main.py | YannHyaric/evolutionary-computation | af7778fd1b5d60a1e5630b483b55257adac0bbc6 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import matplotlib.pyplot as plt
from ppa.ppa import prey_predator_algorithm
from ppa.config import Config
from acs.objective import fitness, fitness_population
from acs.instance import Instance, print_instance
def read_files(instance_config_filename, config_filename):
if instance_co... | 31.927536 | 193 | 0.746709 | import sys
import numpy as np
import matplotlib.pyplot as plt
from ppa.ppa import prey_predator_algorithm
from ppa.config import Config
from acs.objective import fitness, fitness_population
from acs.instance import Instance, print_instance
def read_files(instance_config_filename, config_filename):
if instance_co... | true | true |
f747de2ae9b40a37fb660aa8247f1c067486a850 | 1,123 | py | Python | backend/telegram/methods/chats/get_updated_dialog.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/telegram/methods/chats/get_updated_dialog.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/telegram/methods/chats/get_updated_dialog.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | from typing import Optional
from db.scaffold import Scaffold
from telegram import models as tg_models
from pyrogram import types
class GetUpdatedDialog(Scaffold):
def get_updated_dialog(
self,
*,
raw_chat: "types.Chat",
db_account: "tg_models.TelegramAccount",
... | 27.390244 | 69 | 0.58415 | from typing import Optional
from db.scaffold import Scaffold
from telegram import models as tg_models
from pyrogram import types
class GetUpdatedDialog(Scaffold):
def get_updated_dialog(
self,
*,
raw_chat: "types.Chat",
db_account: "tg_models.TelegramAccount",
... | true | true |
f747df7edf7d3a495ba30fce45767a92cb1cf39e | 15,685 | py | Python | src/sage/algebras/lie_algebras/affine_lie_algebra.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/algebras/lie_algebras/affine_lie_algebra.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/algebras/lie_algebras/affine_lie_algebra.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | """
Affine Lie Algebras
AUTHORS:
- Travis Scrimshaw (2013-05-03): Initial version
"""
#*****************************************************************************
# Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it u... | 31.495984 | 94 | 0.533248 |
from sage.misc.cachefunc import cached_method
from sage.structure.element import parent
from sage.categories.lie_algebras import LieAlgebras
from sage.algebras.lie_algebras.lie_algebra import LieAlgebra, FinitelyGeneratedLieAlgebra
from sage.algebras.lie_algebras.lie_algebra_element import UntwistedAffineLi... | true | true |
f747e0297bbf4671f82eea855cba69e30d337db5 | 19,980 | py | Python | python/hsfs/training_dataset.py | berthoug/feature-store-api | 85c23ae08c7de65acd79a3b528fa72c07e52a272 | [
"Apache-2.0"
] | null | null | null | python/hsfs/training_dataset.py | berthoug/feature-store-api | 85c23ae08c7de65acd79a3b528fa72c07e52a272 | [
"Apache-2.0"
] | null | null | null | python/hsfs/training_dataset.py | berthoug/feature-store-api | 85c23ae08c7de65acd79a3b528fa72c07e52a272 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020 Logical Clocks AB
#
# 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... | 34.507772 | 141 | 0.61952 |
import json
import warnings
from typing import Optional, Union, Any, Dict, List, TypeVar
import humps
import pandas as pd
import numpy as np
from hsfs import util, engine, training_dataset_feature
from hsfs.statistics_config import StatisticsConfig
from hsfs.storage_connector import StorageConnector
f... | true | true |
f747e130d98068d6467cd62abad3de24899012f4 | 20,751 | py | Python | bookmark/controllers.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | bookmark/controllers.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | bookmark/controllers.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | # bookmark/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import BookmarkItemList, BookmarkItemManager
from ballot.models import CANDIDATE, MEASURE, OFFICE
from candidate.models import CandidateCampaignManager
from django.http import HttpResponse
import json
from measure.mode... | 49.882212 | 132 | 0.6418 |
from .models import BookmarkItemList, BookmarkItemManager
from ballot.models import CANDIDATE, MEASURE, OFFICE
from candidate.models import CandidateCampaignManager
from django.http import HttpResponse
import json
from measure.models import ContestMeasureManager
from office.models import ContestOfficeManager
from v... | true | true |
f747e1b31093eec038e1eca15148176bcd438b34 | 715 | py | Python | ArraysStrings/easy/validMountainArray.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | ArraysStrings/easy/validMountainArray.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | ArraysStrings/easy/validMountainArray.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | from typing import List
class Solution_mine: # pass, O(N), but maybe not concise?
def validMountainArray(self, arr: List[int]) -> bool:
if len(arr) < 3:
return False
i = 0
increasing_count = 0
increasing = True
while i + 1 <= len(arr) - 1:
if increasin... | 34.047619 | 57 | 0.46014 | from typing import List
class Solution_mine:
def validMountainArray(self, arr: List[int]) -> bool:
if len(arr) < 3:
return False
i = 0
increasing_count = 0
increasing = True
while i + 1 <= len(arr) - 1:
if increasing:
if arr[i] == arr[... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.