hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
127342322ff0b09fda00cbb8a72a2a1cd9398ea0 | 9,244 | py | Python | tests/profiling/test_profiler.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/profiling/test_profiler.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/profiling/test_profiler.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import logging
import time
import mock
import pytest
import ddtrace
from ddtrace.profiling import collector
from ddtrace.profiling import event
from ddtrace.profiling import exporter
from ddtrace.profiling import profiler
from ddtrace.profiling.collector import stack
from ddtrace.profiling.exporter import http
def ... | 29.346032 | 115 | 0.658806 |
21181bc95df67916d7160425fd7d119de6defab6 | 10,702 | py | Python | featuretools/synthesis/dfs.py | chidauri/featuretools | 1fd1df0765ab7c0af7c495496ea787345a9cab11 | [
"BSD-3-Clause"
] | 3 | 2019-09-29T15:10:13.000Z | 2019-10-03T08:39:14.000Z | featuretools/synthesis/dfs.py | chidauri/featuretools | 1fd1df0765ab7c0af7c495496ea787345a9cab11 | [
"BSD-3-Clause"
] | null | null | null | featuretools/synthesis/dfs.py | chidauri/featuretools | 1fd1df0765ab7c0af7c495496ea787345a9cab11 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
from featuretools.computational_backends import calculate_feature_matrix
from featuretools.entityset import EntitySet
from featuretools.synthesis.deep_feature_synthesis import DeepFeatureSynthesis
from featuretools.utils import entry_point
@entry_point('featuretools_dfs')
def dfs(entities=None,
... | 46.530435 | 116 | 0.572229 |
e77503f3ae9948ee66bc3fa6b2d7824107a871c8 | 8,727 | py | Python | gesso/gesso/util/util.py | machineeeee/builder-python | a01415ef8675e5a11afaa0fe33f794f8ab2a98dc | [
"Apache-2.0"
] | null | null | null | gesso/gesso/util/util.py | machineeeee/builder-python | a01415ef8675e5a11afaa0fe33f794f8ab2a98dc | [
"Apache-2.0"
] | null | null | null | gesso/gesso/util/util.py | machineeeee/builder-python | a01415ef8675e5a11afaa0fe33f794f8ab2a98dc | [
"Apache-2.0"
] | null | null | null | import os, sys
import psutil
import socket
import json, yaml
import time
import netifaces
import logging
import pkg_resources
from tinydb import TinyDB, Query
# -----------------------------------------------------------------------------
# Process Management
# ---------------------------------------------------------... | 31.167857 | 147 | 0.674115 |
19c2d0246a600d9130a2bd6a5df5269287abf29a | 3,394 | py | Python | sphinx_toolbox/__init__.py | arisp99/sphinx-toolbox | 2987080e2d65c0dd2d392dcf7f1f5a904a9231f5 | [
"MIT"
] | null | null | null | sphinx_toolbox/__init__.py | arisp99/sphinx-toolbox | 2987080e2d65c0dd2d392dcf7f1f5a904a9231f5 | [
"MIT"
] | null | null | null | sphinx_toolbox/__init__.py | arisp99/sphinx-toolbox | 2987080e2d65c0dd2d392dcf7f1f5a904a9231f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# __init__.py
"""
Box of handy tools for Sphinx.
"""
#
# Copyright © 2020-2021 Dominic Davis-Foster <dominic@davis-foster.co.uk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | 32.018868 | 81 | 0.767531 |
2ae75d843c7941aaafebce473fd22cdf76871531 | 7,992 | py | Python | backtest/strategy.py | Christakou/backtest | fa97f50b36a1d56fe667250169ed50a8d9121c3c | [
"MIT"
] | null | null | null | backtest/strategy.py | Christakou/backtest | fa97f50b36a1d56fe667250169ed50a8d9121c3c | [
"MIT"
] | null | null | null | backtest/strategy.py | Christakou/backtest | fa97f50b36a1d56fe667250169ed50a8d9121c3c | [
"MIT"
] | null | null | null | import datetime
from backtest.marketdata import MarketData
from dataclasses import dataclass, field
import math
@dataclass
class TradeAction:
"""
Data class to store trades
"""
symbol: str
date: str
type: str
quantity: int
price: float
value: float = field(init=False)
def __post... | 39.564356 | 140 | 0.613864 |
b385d4627af10b48784d69a9abab1deaf6bd60a1 | 24,950 | py | Python | bigplanet/bigplanet/bigplot.py | decaelus/vplanet | f59bd59027f725cc12a2115e8d5df58784c53477 | [
"MIT"
] | null | null | null | bigplanet/bigplanet/bigplot.py | decaelus/vplanet | f59bd59027f725cc12a2115e8d5df58784c53477 | [
"MIT"
] | null | null | null | bigplanet/bigplanet/bigplot.py | decaelus/vplanet | f59bd59027f725cc12a2115e8d5df58784c53477 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import data_extraction as de
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import itertools
"""
ROUTINES FOR REGULARLY GRIDDED DATA
The below functions only work/make sens... | 33.178191 | 117 | 0.593788 |
a9631319f119cc6367821445a0f1dd9249689e05 | 15,631 | py | Python | python/GafferSceneUI/CameraUI.py | pier-robot/gaffer | 9267f2ba3822b14430d8a283c745261110b0f570 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneUI/CameraUI.py | pier-robot/gaffer | 9267f2ba3822b14430d8a283c745261110b0f570 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneUI/CameraUI.py | pier-robot/gaffer | 9267f2ba3822b14430d8a283c745261110b0f570 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# ... | 31.324649 | 230 | 0.700915 |
34a40a9086bfeace560adc4a09e74bd072e8db2f | 26,048 | py | Python | kuryr_kubernetes/controller/handlers/lbaas.py | dulek/kuryr-kubernetes | d76a9dad18320ecd57b7735aed34806aa07f4091 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/controller/handlers/lbaas.py | dulek/kuryr-kubernetes | d76a9dad18320ecd57b7735aed34806aa07f4091 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/controller/handlers/lbaas.py | dulek/kuryr-kubernetes | d76a9dad18320ecd57b7735aed34806aa07f4091 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 42.771757 | 79 | 0.592291 |
ee4a0e51685717fa0958c574883a770944ed91be | 1,683 | py | Python | gksolite/patterns.py | daseith/workshop-collaborative_software | 697e7dd941d0107b495a3884410be49ef931c46b | [
"MIT"
] | null | null | null | gksolite/patterns.py | daseith/workshop-collaborative_software | 697e7dd941d0107b495a3884410be49ef931c46b | [
"MIT"
] | 6 | 2018-08-29T13:26:27.000Z | 2018-08-29T13:35:50.000Z | gksolite/patterns.py | daseith/workshop-collaborative_software | 697e7dd941d0107b495a3884410be49ef931c46b | [
"MIT"
] | 12 | 2018-08-29T11:31:02.000Z | 2018-08-29T11:32:53.000Z | import random
def pad(literal):
if not literal:
return " \n "
lines = ['', *literal.splitlines(), '']
width = max(len(line) for line in lines)
return '\n'.join(' ' + line.ljust(width) + ' ' for line in lines)
def create_random_literal():
number_lines = random.randint(1, 10)
number_... | 15.026786 | 110 | 0.385621 |
e5de6985beac654bb327c4266e63e08d8a566ff3 | 613 | py | Python | python/strings/score-of-parenthesis.py | prakashsellathurai/a-grim-loth | 656e6eea8e6c1761f2705519ea05d6ddb1d4beb7 | [
"MIT"
] | 4 | 2021-06-26T17:18:47.000Z | 2022-02-02T15:02:27.000Z | python/strings/score-of-parenthesis.py | prakashsellathurai/a-grim-loth | 656e6eea8e6c1761f2705519ea05d6ddb1d4beb7 | [
"MIT"
] | 8 | 2021-06-29T07:00:32.000Z | 2021-12-01T11:26:22.000Z | python/strings/score-of-parenthesis.py | prakashsellathurai/a-grim-loth | 656e6eea8e6c1761f2705519ea05d6ddb1d4beb7 | [
"MIT"
] | 3 | 2021-07-14T14:42:08.000Z | 2021-12-07T19:36:53.000Z | import unittest
def scoreOfParentheses(s: str) -> int:
ans = bal = 0
for i, x in enumerate(s):
if x == "(":
bal += 1
else:
bal -= 1
if s[i - 1] == "(":
ans += 1 << bal
return ans
class TestStringMethods(unittest.TestCase):
def test... | 22.703704 | 59 | 0.533442 |
e8753859cf6ab8072efea8af64e569449de648c8 | 755 | py | Python | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/t/too/too_many_boolean_expressions.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/t/too/too_many_boolean_expressions.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/t/too/too_many_boolean_expressions.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """Checks for if statements containing too many boolean expressions"""
# pylint: disable=invalid-name, comparison-with-itself, chained-comparison, condition-evals-to-constant
x = y = z = 5
if x > -5 and x < 5 and y > -5 and y < 5 and z > -5 and z < 5: # [too-many-boolean-expressions]
pass
elif True and False and... | 35.952381 | 103 | 0.651656 |
5685e0057b191a5ffaed8dd71d44c3e2ad44e6d9 | 293 | py | Python | tests/tests/assign_attr.py | yu-i9/mini_python | d62b9040f8427057a20d18340a27bdf2dfc8c22e | [
"MIT"
] | 2 | 2018-06-22T07:07:03.000Z | 2018-08-03T04:26:43.000Z | tests/tests/assign_attr.py | yu-i9/mini_python | d62b9040f8427057a20d18340a27bdf2dfc8c22e | [
"MIT"
] | null | null | null | tests/tests/assign_attr.py | yu-i9/mini_python | d62b9040f8427057a20d18340a27bdf2dfc8c22e | [
"MIT"
] | null | null | null | class Test:
def test(self):
h = Hoge()
h.initialize()
def generator():
return h
return generator
class Hoge:
def initialize(self):
self.x = 42
generator = Test().test()
generator().y = 2
assert generator().x + generator().y == 44
| 17.235294 | 42 | 0.542662 |
4f451a125184de0090d98a38ce32cc5cd4c5ce2a | 14,766 | py | Python | tests/python/relay/test_external_codegen.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/relay/test_external_codegen.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2,863 | 2017-08-17T19:55:50.000Z | 2019-11-04T17:18:41.000Z | tests/python/relay/test_external_codegen.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.014634 | 99 | 0.644657 |
52e186a0b8eee3d9c652f5001a0c976023058786 | 6,152 | py | Python | vmtkScripts/vmtksurfacethickness.py | michelebucelli/vmtk | 738bd1d152e8836847ab4d75f7e8360bd574e724 | [
"Apache-2.0"
] | 1 | 2021-09-25T12:02:25.000Z | 2021-09-25T12:02:25.000Z | vmtkScripts/vmtksurfacethickness.py | michelebucelli/vmtk | 738bd1d152e8836847ab4d75f7e8360bd574e724 | [
"Apache-2.0"
] | 1 | 2022-02-10T14:33:24.000Z | 2022-02-10T14:33:24.000Z | vmtkScripts/vmtksurfacethickness.py | michelebucelli/vmtk | 738bd1d152e8836847ab4d75f7e8360bd574e724 | [
"Apache-2.0"
] | 1 | 2021-02-18T10:11:50.000Z | 2021-02-18T10:11:50.000Z | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfaceclipper.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.9 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is di... | 43.020979 | 210 | 0.669376 |
d33af2fe1e2b34fc88f48f9426ff04a4dab7e153 | 400 | py | Python | SimCalorimetry/EcalTrigPrimProducers/python/ecalTrigPrimSpikeESProducer_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | SimCalorimetry/EcalTrigPrimProducers/python/ecalTrigPrimSpikeESProducer_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | SimCalorimetry/EcalTrigPrimProducers/python/ecalTrigPrimSpikeESProducer_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
# esmodule creating records + corresponding empty essource
EcalTrigPrimSpikeESProducer = cms.ESProducer("EcalTrigPrimSpikeESProducer",
TCCZeroingThreshold = cms.untracked.uint32(1023)
)
tpspikeparms = cms.ESSource("EmptyESSource",
recordName = cms.string('EcalTPGSpike... | 28.571429 | 75 | 0.7725 |
2902f84e98556a9af67edc55142569e02f1b0205 | 171 | py | Python | open_data/insert_delivery_place_indication.py | Homyakin/ZakupkiParser | 9fdfbb96ff128a90165ffe6f48c0f3915dcd747a | [
"MIT"
] | 12 | 2019-09-25T19:00:54.000Z | 2022-01-24T13:10:54.000Z | open_data/insert_delivery_place_indication.py | hbhbr/ZakupkiParser | 1e9c03d0ce4c4e23ae70514ce163ba53c2963231 | [
"MIT"
] | 2 | 2020-04-15T18:08:47.000Z | 2020-10-14T12:01:12.000Z | open_data/insert_delivery_place_indication.py | hbhbr/ZakupkiParser | 1e9c03d0ce4c4e23ae70514ce163ba53c2963231 | [
"MIT"
] | 4 | 2019-04-21T16:57:44.000Z | 2021-11-10T14:57:05.000Z | import insert_from_file
def insert():
table = 'delivery_place_indication'
columns = ['code', 'name']
insert_from_file.insert(table, table, columns, columns)
| 21.375 | 59 | 0.71345 |
159e5da38e57bb109fb084de3ba94dc7accf728a | 3,272 | py | Python | google/ads/googleads/v4/errors/types/url_field_error.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/errors/types/url_field_error.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/errors/types/url_field_error.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.355556 | 74 | 0.716687 |
c9678b02d89fe52bf9df19ed28d47556085b9e9b | 8,748 | py | Python | forum/migrations/0002_auto__chg_field_node_updated_on__chg_field_reply_updated_on__chg_field.py | chiehtu/kissaten | a7aad01de569107d5fd5ed2cd781bca6e5750871 | [
"MIT"
] | null | null | null | forum/migrations/0002_auto__chg_field_node_updated_on__chg_field_reply_updated_on__chg_field.py | chiehtu/kissaten | a7aad01de569107d5fd5ed2cd781bca6e5750871 | [
"MIT"
] | null | null | null | forum/migrations/0002_auto__chg_field_node_updated_on__chg_field_reply_updated_on__chg_field.py | chiehtu/kissaten | a7aad01de569107d5fd5ed2cd781bca6e5750871 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Node.updated_on'
db.alter_column(u'forum_node', 'updated_on', self.gf('django.db.models.f... | 68.34375 | 187 | 0.598994 |
e66d984fda430aa4cf6096d001629155e25aba08 | 810 | py | Python | product/migrations/0003_product_quantity_alter_category_id_alter_product_id.py | Vee245/dukapepedj | 8525166b38c8f74dc8d62a2fdf1905c32793efcd | [
"MIT"
] | null | null | null | product/migrations/0003_product_quantity_alter_category_id_alter_product_id.py | Vee245/dukapepedj | 8525166b38c8f74dc8d62a2fdf1905c32793efcd | [
"MIT"
] | null | null | null | product/migrations/0003_product_quantity_alter_category_id_alter_product_id.py | Vee245/dukapepedj | 8525166b38c8f74dc8d62a2fdf1905c32793efcd | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-18 08:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0002_product'),
]
operations = [
migrations.AddField(
model_name='product',
name='quantity',
... | 27.931034 | 111 | 0.592593 |
b452208042b2fd00a242db8f4af45ca34c4f9984 | 847 | py | Python | notes_api/serializers.py | Sakkadas/Notes | e438f58957ca1737ca714b5619abf76535236f66 | [
"MIT"
] | 2 | 2021-09-14T13:37:59.000Z | 2021-09-17T20:52:11.000Z | notes_api/serializers.py | Sakkadas/Notes | e438f58957ca1737ca714b5619abf76535236f66 | [
"MIT"
] | null | null | null | notes_api/serializers.py | Sakkadas/Notes | e438f58957ca1737ca714b5619abf76535236f66 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from notes.models import Note, Comment
class NoteSerializer(serializers.ModelSerializer):
class Meta:
model = Note
fields = (
'author', 'title',
'summary', 'created',
'updated', 'slug', 'source',
'anonymous', 't... | 24.2 | 56 | 0.531287 |
37e1842a1e705379df91b8dbd32c79706b751060 | 2,051 | py | Python | shopyo/models.py | hazeliao/shopyo | fddcfd11f7fac843bf29a8421589afb9b5f22703 | [
"MIT"
] | null | null | null | shopyo/models.py | hazeliao/shopyo | fddcfd11f7fac843bf29a8421589afb9b5f22703 | [
"MIT"
] | null | null | null | shopyo/models.py | hazeliao/shopyo | fddcfd11f7fac843bf29a8421589afb9b5f22703 | [
"MIT"
] | 1 | 2020-02-20T19:53:45.000Z | 2020-02-20T19:53:45.000Z | #from flask_sqlalchemy import SQLAlchemy
from werkzeug.security import generate_password_hash, check_password_hash
from addon import db
#from app import db
from flask_login import UserMixin
#db = SQLAlchemy()
class Users(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.String(10), primary_key=... | 28.887324 | 73 | 0.694295 |
7340257f29f79c8f2e517b2b4f7d6c72389dd875 | 2,131 | py | Python | tests/test_computing_client.py | NagasawaRiow/py_nifcloud | cfb937a32a1214a554ba956d23a4131a56f65641 | [
"MIT"
] | 4 | 2017-10-29T12:17:46.000Z | 2017-11-04T16:55:14.000Z | tests/test_computing_client.py | NagasawaRiow/py_nifcloud | cfb937a32a1214a554ba956d23a4131a56f65641 | [
"MIT"
] | 9 | 2017-10-30T04:46:33.000Z | 2020-03-31T03:23:25.000Z | tests/test_computing_client.py | NagasawaRiow/py_nifcloud | cfb937a32a1214a554ba956d23a4131a56f65641 | [
"MIT"
] | 3 | 2017-10-29T12:54:30.000Z | 2018-09-24T10:14:46.000Z | # -*- encoding:utf-8 -*-
import unittest
from py_nifcloud import ComputingClient
from bs4 import BeautifulSoup
class TestComputingClientCreatePrivateLan(unittest.TestCase):
soup_response = None
sut = None
@classmethod
def setUpClass(cls):
cls.sut = ComputingClient(region_name="jp-... | 33.296875 | 109 | 0.696856 |
391da0177e1f9d75b0acc3b39e358227aaafb211 | 118,271 | py | Python | src/sqlfluff/dialects/dialect_ansi.py | aviv/sqlfluff | f0be898b9fadf8950eefd4ff9e9713d3f3d9264f | [
"MIT"
] | null | null | null | src/sqlfluff/dialects/dialect_ansi.py | aviv/sqlfluff | f0be898b9fadf8950eefd4ff9e9713d3f3d9264f | [
"MIT"
] | null | null | null | src/sqlfluff/dialects/dialect_ansi.py | aviv/sqlfluff | f0be898b9fadf8950eefd4ff9e9713d3f3d9264f | [
"MIT"
] | null | null | null | """The core ANSI dialect.
This is the core SQL grammar. We'll probably extend this or make it pluggable
for other dialects. Here we encode the structure of the language.
There shouldn't be any underlying "machinery" here, that should all
be defined elsewhere.
A lot of the inspiration for this sql grammar is taken fr... | 32.244002 | 102 | 0.583651 |
6ee89f1ae37b1877dfdc45c22a0e2829de13a380 | 2,948 | py | Python | pibrew/models.py | MrLeeh/pibrew | a2dc764e1ebfc5945d542e8f3e3b18251223974b | [
"MIT"
] | null | null | null | pibrew/models.py | MrLeeh/pibrew | a2dc764e1ebfc5945d542e8f3e3b18251223974b | [
"MIT"
] | null | null | null | pibrew/models.py | MrLeeh/pibrew | a2dc764e1ebfc5945d542e8f3e3b18251223974b | [
"MIT"
] | null | null | null | from . import db
from utils import s_to_hms, hms_to_s
class OrderableMixin:
# TODO: implement testing
order = db.Column(db.Integer, index=True)
def _get_model_class(self):
for c in db.Model._decl_class_registry.values():
if (hasattr(c, '__tablename__') and
c.__ta... | 29.188119 | 80 | 0.611601 |
edd057810862e9b45592c01aea58e9494fbf7d26 | 113 | py | Python | nft_generator/command/version.py | nft-generator/nft_generator | e2e17a204054a39eaf5d904d0956542e11155360 | [
"MIT"
] | 6 | 2021-12-05T10:00:28.000Z | 2022-01-09T02:22:46.000Z | nft_generator/command/version.py | nft-generator/nft_generator | e2e17a204054a39eaf5d904d0956542e11155360 | [
"MIT"
] | null | null | null | nft_generator/command/version.py | nft-generator/nft_generator | e2e17a204054a39eaf5d904d0956542e11155360 | [
"MIT"
] | 5 | 2021-12-05T14:35:37.000Z | 2022-01-13T17:02:10.000Z | import click
from nft_generator import __version__
@click.command()
def version():
print(__version__)
| 12.555556 | 37 | 0.734513 |
6d16d84f070ed0a9cc38ff77ebd670d3de9e514b | 409 | py | Python | src/jk_argparsing/textprimitives/__init__.py | jkpubsrc/python-module-jk-argsparsing | 9ef4b907c67fd1df5bd8c378df46ba527ebc2a83 | [
"Apache-2.0"
] | null | null | null | src/jk_argparsing/textprimitives/__init__.py | jkpubsrc/python-module-jk-argsparsing | 9ef4b907c67fd1df5bd8c378df46ba527ebc2a83 | [
"Apache-2.0"
] | null | null | null | src/jk_argparsing/textprimitives/__init__.py | jkpubsrc/python-module-jk-argsparsing | 9ef4b907c67fd1df5bd8c378df46ba527ebc2a83 | [
"Apache-2.0"
] | null | null | null |
__version__ = "0.2021.9.10"
from .XLineFragment import XLineFragment
from .columnLayouterL2R import columnLayouterL2R
from .ITextBlock import ITextBlock
from .TextBlock import TextBlock
from .TextBlockSequence import TextBlockSequence
from .TextGridBlock import TextGridBlock
from .TextPrefixBlock import TextPr... | 22.722222 | 48 | 0.848411 |
86c658d051dd3e28e7bfecdccc237396528753ca | 9,077 | py | Python | catalyst/utils/config.py | vaklyuenkov/catalyst | 402294aa5b27784d23cee2b8fff5a1ed26dec8a8 | [
"Apache-2.0"
] | 1 | 2019-11-29T11:23:13.000Z | 2019-11-29T11:23:13.000Z | catalyst/utils/config.py | vaklyuenkov/catalyst | 402294aa5b27784d23cee2b8fff5a1ed26dec8a8 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/config.py | vaklyuenkov/catalyst | 402294aa5b27784d23cee2b8fff5a1ed26dec8a8 | [
"Apache-2.0"
] | null | null | null | import copy
import json
import os
import platform
import shutil
import subprocess
import sys
import re
from collections import OrderedDict
from logging import getLogger
from pathlib import Path
from typing import List, Any, Dict, Union
import safitty
import yaml
from catalyst import utils
from catalyst.utils.tensorbo... | 29.858553 | 79 | 0.585546 |
bb9dd9f051edcad29be8229ad4954aaeed2c4745 | 16,217 | py | Python | src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_annotations_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_annotations_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_annotations_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"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 may ... | 49.898462 | 197 | 0.663995 |
40d45d7dd6ffc8f2dc4937acc7380fe153027fe2 | 1,110 | py | Python | program2solution/generatordriver.py | dpocheng/Python-Data-Structure-of-Python | 66b99fa41f831e8c3089e4e2fd664a7ef3268e5e | [
"Apache-2.0"
] | null | null | null | program2solution/generatordriver.py | dpocheng/Python-Data-Structure-of-Python | 66b99fa41f831e8c3089e4e2fd664a7ef3268e5e | [
"Apache-2.0"
] | null | null | null | program2solution/generatordriver.py | dpocheng/Python-Data-Structure-of-Python | 66b99fa41f831e8c3089e4e2fd664a7ef3268e5e | [
"Apache-2.0"
] | null | null | null | from generator import lets, transform, running_count, n_with_pad, sequence, alternate
for i in transform('abCdeFg',str.upper):
print(i,end=' ')
print()
for i in transform(lets('abCdeFg'),str.upper):
print(i,end=' ')
print()
for i in running_count('bananastand',lambda x : x in 'aeiou'): # i... | 19.137931 | 86 | 0.581081 |
6d5f4cc54d13ce3abdf7fad62f8a6679715e0d5e | 7,038 | py | Python | docs/conf.py | peopledoc/django-pipeline | 59865e1387a2b785a3948244639d1827fd4f2c99 | [
"MIT"
] | null | null | null | docs/conf.py | peopledoc/django-pipeline | 59865e1387a2b785a3948244639d1827fd4f2c99 | [
"MIT"
] | null | null | null | docs/conf.py | peopledoc/django-pipeline | 59865e1387a2b785a3948244639d1827fd4f2c99 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Pipeline documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 30 17:47:55 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 32.284404 | 80 | 0.720233 |
5b9cccf42399e80bc7cfa831f6ef74365b8c8910 | 315 | py | Python | AirTrafficDevTool/tutorial.py | tegginamaniss/AirTrafficDevTool | fa19efbcffa8c2d2cc30c194b29d8ca6dee6131a | [
"MIT"
] | null | null | null | AirTrafficDevTool/tutorial.py | tegginamaniss/AirTrafficDevTool | fa19efbcffa8c2d2cc30c194b29d8ca6dee6131a | [
"MIT"
] | null | null | null | AirTrafficDevTool/tutorial.py | tegginamaniss/AirTrafficDevTool | fa19efbcffa8c2d2cc30c194b29d8ca6dee6131a | [
"MIT"
] | null | null | null | """This file is to demonstrate the use of the modules"""
# Overview
from AirTrafficDevTool.overview import Overview
view = Overview(input_file='sample.yaml', save_plots=True)
print(view.output_names())
# SSD Individual
from AirTrafficDevTool.ssd_individual import SSDi
# SSD
from AirTrafficDevTool.ssd import SSD | 26.25 | 58 | 0.803175 |
be07692a1ccb7cead63490a42a2abd60dc80bb81 | 809 | py | Python | setup.py | RileyGibbs/django-emailmgr | 82dae79aceab20ac2146103067d31b01ee51731a | [
"BSD-3-Clause"
] | null | null | null | setup.py | RileyGibbs/django-emailmgr | 82dae79aceab20ac2146103067d31b01ee51731a | [
"BSD-3-Clause"
] | null | null | null | setup.py | RileyGibbs/django-emailmgr | 82dae79aceab20ac2146103067d31b01ee51731a | [
"BSD-3-Clause"
] | null | null | null | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-emailmgr',
version='2.0',
description = "An email manager for Django user",
long_description = read('README'),
author='Val L33',
author_email='val@n... | 32.36 | 70 | 0.592089 |
02d5d8440b26cdaeeaeb58dc283e1052d6445168 | 8,196 | py | Python | ml-agents/mlagents/trainers/ppo/optimizer_torch.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | 1 | 2021-12-02T23:22:56.000Z | 2021-12-02T23:22:56.000Z | ml-agents/mlagents/trainers/ppo/optimizer_torch.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/ppo/optimizer_torch.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, cast
from mlagents.torch_utils import torch
from mlagents.trainers.buffer import AgentBuffer
from mlagents_envs.timers import timed
from mlagents.trainers.policy.torch_policy import TorchPolicy
from mlagents.trainers.optimizer.torch_optimizer import TorchOptimizer
from mlagents.trainers.setti... | 39.028571 | 99 | 0.634578 |
36865a60e5da71a98f55744c640c23823aa034b9 | 39,268 | py | Python | plasmapy/particles/ionization_state_collection.py | LeoMurphyWM24/PlasmaPy | 2dbfd24209e33259a90ceb293b93e89144636db0 | [
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-1-Clause",
"BSD-3-Clause"
] | null | null | null | plasmapy/particles/ionization_state_collection.py | LeoMurphyWM24/PlasmaPy | 2dbfd24209e33259a90ceb293b93e89144636db0 | [
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-1-Clause",
"BSD-3-Clause"
] | null | null | null | plasmapy/particles/ionization_state_collection.py | LeoMurphyWM24/PlasmaPy | 2dbfd24209e33259a90ceb293b93e89144636db0 | [
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-1-Clause",
"BSD-3-Clause"
] | null | null | null | """
A class for storing ionization state data for multiple elements or
isotopes.
"""
__all__ = ["IonizationStateCollection"]
import astropy.units as u
import numpy as np
from numbers import Integral, Real
from typing import Dict, List, Optional, Tuple, Union
from plasmapy.particles.atomic import atomic_number
from p... | 38.802372 | 94 | 0.568223 |
4b7cc2b46c19cd5ad1fdb65d12dd3e7ebd988ebb | 6,258 | py | Python | functions/system.py | codions-forks/flask-nginx-rtmp-manager | 9088c44616a2e94f6771216af6f22c241064e321 | [
"MIT"
] | 1 | 2021-09-26T05:32:00.000Z | 2021-09-26T05:32:00.000Z | functions/system.py | codions-forks/flask-nginx-rtmp-manager | 9088c44616a2e94f6771216af6f22c241064e321 | [
"MIT"
] | null | null | null | functions/system.py | codions-forks/flask-nginx-rtmp-manager | 9088c44616a2e94f6771216af6f22c241064e321 | [
"MIT"
] | null | null | null | from threading import Thread
from functools import wraps
import subprocess
import os
import datetime
import smtplib
from flask import flash
from html.parser import HTMLParser
import ipaddress
import json
import secrets
import logging
from globals import globalvars
from classes.shared import db
from classes import set... | 33.645161 | 179 | 0.654842 |
090eb1865b187c74496f41effefc6916f93a697d | 11,420 | py | Python | socketio/transports.py | fuhrysteve/gevent-socketio | ec5cd40a9eae06f16ac657a03656bc90f82cdf41 | [
"BSD-3-Clause"
] | 1 | 2015-05-15T18:30:43.000Z | 2015-05-15T18:30:43.000Z | socketio/transports.py | fuhrysteve/gevent-socketio | ec5cd40a9eae06f16ac657a03656bc90f82cdf41 | [
"BSD-3-Clause"
] | null | null | null | socketio/transports.py | fuhrysteve/gevent-socketio | ec5cd40a9eae06f16ac657a03656bc90f82cdf41 | [
"BSD-3-Clause"
] | null | null | null | import gevent
try:
from urllib.parse import unquote_plus, parse_qs
except ImportError:
from urllib.parse import unquote_plus
from urlparse import parse_qs
from geventwebsocket import WebSocketError
from gevent.queue import Empty
class BaseTransport(object):
"""Base class for all transports. Mostly wra... | 35.576324 | 114 | 0.565762 |
43f5bbfe883669bf821bf99a6cb8bd21d72f8220 | 1,233 | py | Python | python/pmmlserver/pmmlserver/test_model.py | ittus/kserve | 922a9b7e8a9a86b5ae65faf4ce863927873fd456 | [
"Apache-2.0"
] | 1,146 | 2019-03-27T21:14:34.000Z | 2021-09-22T08:36:46.000Z | python/pmmlserver/pmmlserver/test_model.py | ittus/kserve | 922a9b7e8a9a86b5ae65faf4ce863927873fd456 | [
"Apache-2.0"
] | 1,803 | 2019-03-27T22:16:02.000Z | 2021-09-22T15:27:44.000Z | python/pmmlserver/pmmlserver/test_model.py | ittus/kserve | 922a9b7e8a9a86b5ae65faf4ce863927873fd456 | [
"Apache-2.0"
] | 573 | 2019-03-27T21:14:58.000Z | 2021-09-20T21:15:52.000Z | # Copyright 2021 The KServe Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 34.25 | 89 | 0.675588 |
f51b11ec3975eca1ee743510963bc64358482ed9 | 3,432 | py | Python | app/api/v2/schemas.py | webclinic017/ark-invest-api | 3edc46421e7e9ed44465c264e24f359be48f8212 | [
"MIT"
] | 1 | 2021-09-25T07:17:42.000Z | 2021-09-25T07:17:42.000Z | app/api/v2/schemas.py | webclinic017/ark-invest-api | 3edc46421e7e9ed44465c264e24f359be48f8212 | [
"MIT"
] | null | null | null | app/api/v2/schemas.py | webclinic017/ark-invest-api | 3edc46421e7e9ed44465c264e24f359be48f8212 | [
"MIT"
] | null | null | null | import datetime
from typing import List, Optional
from pydantic import BaseModel
class V2_FundProfileData(BaseModel):
symbol: str
name: str
description: str
fund_type: str
inception_date: datetime.date
cusip: str
isin: str
website: str
class Config:
orm_mode = True
clas... | 18.754098 | 47 | 0.668415 |
4de430bb582372dbc051d46c086b4cb9c0f0ecac | 28,385 | py | Python | nipype/interfaces/mrtrix/preprocess.py | eort/nipype | 04d0159686a8d656905e9e06110287c6c60c1523 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mrtrix/preprocess.py | eort/nipype | 04d0159686a8d656905e9e06110287c6c60c1523 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mrtrix/preprocess.py | eort/nipype | 04d0159686a8d656905e9e06110287c6c60c1523 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpat... | 30.488722 | 309 | 0.606799 |
ab3f94dae95bd31ba97f85594ef76e1fe21cace3 | 9,543 | py | Python | nexus/examples/qmcpack/graphene/graphene.py | markdewing/qmcpack | 4bd3e10ceb0faf8d2b3095338da5a56eda0dc1ba | [
"NCSA"
] | null | null | null | nexus/examples/qmcpack/graphene/graphene.py | markdewing/qmcpack | 4bd3e10ceb0faf8d2b3095338da5a56eda0dc1ba | [
"NCSA"
] | null | null | null | nexus/examples/qmcpack/graphene/graphene.py | markdewing/qmcpack | 4bd3e10ceb0faf8d2b3095338da5a56eda0dc1ba | [
"NCSA"
] | 1 | 2019-07-23T17:44:39.000Z | 2019-07-23T17:44:39.000Z | #! /usr/bin/env python
from nexus import settings,job,run_project
from nexus import generate_physical_system
from nexus import generate_pwscf
from nexus import generate_pw2qmcpack
from nexus import generate_qmcpack
from nexus import loop,linear,vmc,dmc
# general settings for nexus
settings(
pseudo_dir = '../p... | 42.039648 | 81 | 0.529184 |
d21e6ed26c7087518edd8a20cecc1c634d7382b1 | 8,637 | py | Python | python/cm/unit_tests/test_config_group.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 16 | 2019-11-28T18:05:21.000Z | 2021-12-08T18:09:18.000Z | python/cm/unit_tests/test_config_group.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 1,127 | 2019-11-29T08:57:25.000Z | 2022-03-31T20:21:32.000Z | python/cm/unit_tests/test_config_group.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 10 | 2019-11-28T18:05:06.000Z | 2022-01-13T06:16:40.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 38.905405 | 100 | 0.569179 |
0c6a664f45e026f0f3f989ce2b33e292675e978c | 4,190 | py | Python | litex_things/deps/litex_boards/litex_boards/official/targets/genesys2.py | bjonnh/fomu-playground | 9f95ed7b28d15ce219d09c16c2c8d6b5594adceb | [
"0BSD"
] | null | null | null | litex_things/deps/litex_boards/litex_boards/official/targets/genesys2.py | bjonnh/fomu-playground | 9f95ed7b28d15ce219d09c16c2c8d6b5594adceb | [
"0BSD"
] | null | null | null | litex_things/deps/litex_boards/litex_boards/official/targets/genesys2.py | bjonnh/fomu-playground | 9f95ed7b28d15ce219d09c16c2c8d6b5594adceb | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
# This file is Copyright (c) 2019 Florent Kermarrec <florent@enjoy-digital.fr>
# License: BSD
import argparse
from migen import *
from litex_boards.platforms import genesys2
from litex.soc.cores.clock import *
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder i... | 37.410714 | 104 | 0.608831 |
94442a6d5035396531eddb30b9580ab4f6026b49 | 27,999 | py | Python | interfaces/python/test/nodes_test.py | shawncal/ELL | aa491f053692f985c79335d2f3f95de754ff1349 | [
"MIT"
] | 1 | 2020-09-18T04:38:45.000Z | 2020-09-18T04:38:45.000Z | interfaces/python/test/nodes_test.py | awesomemachinelearning/ELL | cb897e3aec148a1e9bd648012b5f53ab9d0dd20c | [
"MIT"
] | null | null | null | interfaces/python/test/nodes_test.py | awesomemachinelearning/ELL | cb897e3aec148a1e9bd648012b5f53ab9d0dd20c | [
"MIT"
] | 1 | 2020-07-30T11:34:56.000Z | 2020-07-30T11:34:56.000Z | import json
import math
import os
from testing import Testing
import numpy as np
import ell_helper # noqa: F401
import ell
script_path = os.path.dirname(os.path.abspath(__file__))
def test_with_serialization(testing, map, test_name, callback, context):
result = []
for i in range(3):
if i > 0:
... | 38.941586 | 119 | 0.674203 |
3f147fc74aec5b868a4015b4bc99ca7f6003c542 | 5,379 | py | Python | django_api_example/settings_base.py | amrox/django-api-example | 6c68e43078bb5e858ddea84d44a943ec9d7808b4 | [
"MIT"
] | 17 | 2015-03-31T20:23:08.000Z | 2021-06-08T00:46:57.000Z | django_api_example/settings_base.py | amrox/django-api-example | 6c68e43078bb5e858ddea84d44a943ec9d7808b4 | [
"MIT"
] | null | null | null | django_api_example/settings_base.py | amrox/django-api-example | 6c68e43078bb5e858ddea84d44a943ec9d7808b4 | [
"MIT"
] | 4 | 2015-05-18T14:24:52.000Z | 2022-02-18T06:52:52.000Z | # Django settings for django_api_example project.
import os.path
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Ad... | 33 | 115 | 0.693252 |
8a2dee5bfed3d8d61e54a95a785b30048285a1a5 | 6,407 | py | Python | cppguts/dumpcpp.py | tierra-colada/cppguts | 473e1462e11a1d081e9a4dad7efb3867ba02355c | [
"MIT"
] | 1 | 2021-09-19T21:58:08.000Z | 2021-09-19T21:58:08.000Z | cppguts/dumpcpp.py | tierra-colada/cppguts | 473e1462e11a1d081e9a4dad7efb3867ba02355c | [
"MIT"
] | null | null | null | cppguts/dumpcpp.py | tierra-colada/cppguts | 473e1462e11a1d081e9a4dad7efb3867ba02355c | [
"MIT"
] | null | null | null | import argparse
import os
from clang.cindex import Cursor, Index
from pprint import pprint
def get_diag_info(diag):
return {'severity': diag.severity,
'location': diag.location,
'category_name': diag.category_name,
'spelling': diag.spelling,
'ranges': d... | 46.766423 | 131 | 0.60309 |
3a9984bd826a0ce3b8534176ddb02bec546e7833 | 5,527 | py | Python | configs/representation/ssb/ssb_r18_nc_sgd_cos_30e_r2_1x8x2_k400.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | configs/representation/ssb/ssb_r18_nc_sgd_cos_30e_r2_1x8x2_k400.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | configs/representation/ssb/ssb_r18_nc_sgd_cos_30e_r2_1x8x2_k400.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | # model settings
temperature = 0.2
with_norm = True
query_dim = 128
model = dict(
type='SimSiamBaseTracker',
backbone=dict(
type='ResNet',
pretrained=None,
depth=18,
out_indices=(3, ),
# strides=(1, 2, 1, 1),
norm_cfg=dict(type='SyncBN', requires_grad=True),
... | 30.535912 | 78 | 0.619323 |
8b33edc80fef290692a878d9a4b1dbc2a57acf8c | 25,404 | py | Python | model/ner_model.py | riedlma/sequence_tagging | abe8c4b7ec38e5e4f2ce64d4ec6a33f3dbb87d62 | [
"Apache-2.0"
] | 22 | 2018-05-09T14:12:10.000Z | 2021-03-21T15:24:55.000Z | model/ner_model.py | riedlma/sequence_tagging | abe8c4b7ec38e5e4f2ce64d4ec6a33f3dbb87d62 | [
"Apache-2.0"
] | null | null | null | model/ner_model.py | riedlma/sequence_tagging | abe8c4b7ec38e5e4f2ce64d4ec6a33f3dbb87d62 | [
"Apache-2.0"
] | 5 | 2018-05-11T08:29:47.000Z | 2021-03-04T06:13:12.000Z | import numpy as np
import os, sys
import tensorflow as tf
from .data_utils import minibatches, pad_sequences, get_chunks,get_oov_embeddings
from .data_utils import load_vocab_rev, load_vocab
from .general_utils import Progbar
from .base_model import BaseModel
class NERModel(BaseModel):
"""Specialized class of M... | 52.271605 | 3,156 | 0.41458 |
45eb30b727474e06ad7de8f47bece42b357feb19 | 68,596 | py | Python | benchmarks/SimResults/micro_pinned_train_combos/cmpA_astarlbmtontoh264ref/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | benchmarks/SimResults/micro_pinned_train_combos/cmpA_astarlbmtontoh264ref/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | benchmarks/SimResults/micro_pinned_train_combos/cmpA_astarlbmtontoh264ref/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | 75.050328 | 124 | 0.681979 |
92705ecb114f5e0c4f32e4be35fb292b5120fb75 | 602 | py | Python | 01-algorithmic-design-and-techniques/week-2/fibonacci-partial-sum.py | andrewnachtigal/UCSD-Algorithms | 25acae36752e37fab74b8e331db554af704ccf4c | [
"MIT"
] | null | null | null | 01-algorithmic-design-and-techniques/week-2/fibonacci-partial-sum.py | andrewnachtigal/UCSD-Algorithms | 25acae36752e37fab74b8e331db554af704ccf4c | [
"MIT"
] | null | null | null | 01-algorithmic-design-and-techniques/week-2/fibonacci-partial-sum.py | andrewnachtigal/UCSD-Algorithms | 25acae36752e37fab74b8e331db554af704ccf4c | [
"MIT"
] | null | null | null | #!/user/bin/python
'''Fibonacci Partial Sum - Last Digit
Given two non-negative integers, find the last digit of a partial sum
of Fibonacci numbers, i.e.,
find last digit of: Fm + Fm+1 + ... + Fn
'''
import sys
def fibonacci_partial_sum_naive(from_, to):
sum = 0
current = 0
next = 1
for i in... | 18.8125 | 69 | 0.611296 |
f6ef363ba118ca050db9b2fdcfa2f3e9df13dbe9 | 31 | py | Python | thanakan/slip/__init__.py | CircleOnCircles/thanakan | 459e798029143187aa2f2fb5580d0aeb5352b12e | [
"MIT"
] | 8 | 2021-03-09T09:41:34.000Z | 2022-03-05T05:54:42.000Z | thanakan/slip/__init__.py | CircleOnCircles/thanakan | 459e798029143187aa2f2fb5580d0aeb5352b12e | [
"MIT"
] | 60 | 2021-03-12T07:35:19.000Z | 2022-03-31T05:29:23.000Z | thanakan/slip/__init__.py | CircleOnCircles/thanakan | 459e798029143187aa2f2fb5580d0aeb5352b12e | [
"MIT"
] | 3 | 2021-07-11T15:25:40.000Z | 2021-12-01T10:53:01.000Z | from .qrcode import SlipQRData
| 15.5 | 30 | 0.83871 |
0a2a1b7b050fb15735b93cbcd742eba216962b0e | 939 | py | Python | bot/cogs/manage_classes.py | svengeance/ClemBot | 42e739f64fe8b3ad1daa72fda0e5bef0de59519f | [
"MIT"
] | null | null | null | bot/cogs/manage_classes.py | svengeance/ClemBot | 42e739f64fe8b3ad1daa72fda0e5bef0de59519f | [
"MIT"
] | null | null | null | bot/cogs/manage_classes.py | svengeance/ClemBot | 42e739f64fe8b3ad1daa72fda0e5bef0de59519f | [
"MIT"
] | null | null | null | import logging
import discord
import discord.ext.commands as commands
log = logging.getLogger(__name__)
class ManageClasses(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
@commands.command()
async def hello(self, ctx, *, member: discord.Member = None):
... | 30.290323 | 83 | 0.652822 |
46d47a992972098d735fe0b79d3b7341e7701307 | 22,212 | py | Python | 07_train/archive/extras/bert/pytorch-finetune/train_scripts/utils_glue.py | dpai/workshop | d4936da77dac759ba2bac95a9584fde8e86c6b2b | [
"Apache-2.0"
] | 2,327 | 2020-03-01T09:47:34.000Z | 2021-11-25T12:38:42.000Z | 07_train/archive/extras/bert/pytorch-finetune/train_scripts/utils_glue.py | trideau/Data-Science-with-AWS-Workshop | 7dbe7989fa99e88544da8bf262beec907c536093 | [
"Apache-2.0"
] | 209 | 2020-03-01T17:14:12.000Z | 2021-11-08T20:35:42.000Z | 07_train/archive/extras/bert/pytorch-finetune/train_scripts/utils_glue.py | trideau/Data-Science-with-AWS-Workshop | 7dbe7989fa99e88544da8bf262beec907c536093 | [
"Apache-2.0"
] | 686 | 2020-03-03T17:24:51.000Z | 2021-11-25T23:39:12.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 35.768116 | 106 | 0.58617 |
222aa63dd3280e2f15b4bb5aac8ca37523cd63b4 | 3,542 | py | Python | models/vgg_nobn_quant.py | ShihuiYin/QNN | b12223e5617e64509a9269228dec4d1a45342274 | [
"MIT"
] | null | null | null | models/vgg_nobn_quant.py | ShihuiYin/QNN | b12223e5617e64509a9269228dec4d1a45342274 | [
"MIT"
] | null | null | null | models/vgg_nobn_quant.py | ShihuiYin/QNN | b12223e5617e64509a9269228dec4d1a45342274 | [
"MIT"
] | null | null | null | '''VGG11/13/16/19 in Pytorch. Always proceed activation layer with batchnorm such that we can fuse these two'''
import torch
import torch.nn as nn
from .quant import QuantizeConv2d, QuantizeLinear, QuantizeActLayer, BatchNorm2d, BatchNorm1d
cfg = {
'VGG': [128, 128, 'M', 256, 256, 'M', 512, 512, 'M'],
'VGGS': ... | 41.670588 | 120 | 0.530774 |
aee8eb337c0339fc53c6c7c9b926b3eb0e057ae3 | 1,720 | py | Python | setup.py | sommersoft/Adafruit_CircuitPython_BLE | f50290be4cfb40b56ed10b99b9111bde27cf4923 | [
"MIT"
] | null | null | null | setup.py | sommersoft/Adafruit_CircuitPython_BLE | f50290be4cfb40b56ed10b99b9111bde27cf4923 | [
"MIT"
] | null | null | null | setup.py | sommersoft/Adafruit_CircuitPython_BLE | f50290be4cfb40b56ed10b99b9111bde27cf4923 | [
"MIT"
] | null | null | null | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the lon... | 28.196721 | 71 | 0.683721 |
ff00d063978daddf4e8c9aba9e0d3a536ab2a132 | 178 | py | Python | biocoder/routing.py | east301/biocoder-server | e7b937e99608fa18675c972ec4377d946896cbb1 | [
"Apache-2.0"
] | null | null | null | biocoder/routing.py | east301/biocoder-server | e7b937e99608fa18675c972ec4377d946896cbb1 | [
"Apache-2.0"
] | null | null | null | biocoder/routing.py | east301/biocoder-server | e7b937e99608fa18675c972ec4377d946896cbb1 | [
"Apache-2.0"
] | null | null | null | #
# (c) 2016 biocoder developers
#
# This file is part of biocoder,
# released under Apache License Version 2.0 (http://www.apache.org/licenses/LICENCE).
#
channel_routing = []
| 19.777778 | 85 | 0.719101 |
c0f9f45dd68c58852456825b235538a3813bdb5f | 2,752 | py | Python | pyredner/transform.py | pableeto/redner | 0d76e5a77bf1cc64d83571c6c92a64a64e901efb | [
"MIT"
] | null | null | null | pyredner/transform.py | pableeto/redner | 0d76e5a77bf1cc64d83571c6c92a64a64e901efb | [
"MIT"
] | null | null | null | pyredner/transform.py | pableeto/redner | 0d76e5a77bf1cc64d83571c6c92a64a64e901efb | [
"MIT"
] | null | null | null | import math
import numpy as np
import tensorflow as tf
import torch
def radians(deg):
return (math.pi / 180.0) * deg
def normalize(v):
return v / torch.norm(v)
def gen_look_at_matrix(pos, look, up):
d = normalize(look - pos)
right = normalize(torch.cross(d, normalize(up)))
new_up = normalize(torc... | 33.560976 | 90 | 0.49782 |
adcb40b51f54d78c62e5118ddeece7fe0dec36b8 | 660 | py | Python | Scripts/rst2pseudoxml.py | akshat0703/Topsis-Akshat-101917081 | c2c4e6598eeff7666d0c325df2a0bdb7c279a172 | [
"MIT"
] | null | null | null | Scripts/rst2pseudoxml.py | akshat0703/Topsis-Akshat-101917081 | c2c4e6598eeff7666d0c325df2a0bdb7c279a172 | [
"MIT"
] | null | null | null | Scripts/rst2pseudoxml.py | akshat0703/Topsis-Akshat-101917081 | c2c4e6598eeff7666d0c325df2a0bdb7c279a172 | [
"MIT"
] | null | null | null | #!C:\Users\hp\Desktop\Assignment-4\Topsis-Akshat-101917081\Scripts\python.exe
# $Id: rst2pseudoxml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing pseudo-XML.... | 27.5 | 77 | 0.74697 |
a8391f883dfeeecffd335f24b60be82612615d10 | 8,906 | py | Python | Code/Igor&Kostia/tfidf_by_st_features.py | ChenglongChen/Kaggle_Homedepot | 55c1033d0af3b6cf2f033fe4bcf3e1e0ffda3445 | [
"MIT"
] | 465 | 2016-04-27T13:17:36.000Z | 2020-05-15T11:05:13.000Z | Code/Igor&Kostia/tfidf_by_st_features.py | CharlotteSean/Kaggle_HomeDepot | 55c1033d0af3b6cf2f033fe4bcf3e1e0ffda3445 | [
"MIT"
] | 1 | 2016-10-15T04:33:54.000Z | 2016-10-15T04:33:54.000Z | Code/Igor&Kostia/tfidf_by_st_features.py | CharlotteSean/Kaggle_HomeDepot | 55c1033d0af3b6cf2f033fe4bcf3e1e0ffda3445 | [
"MIT"
] | 230 | 2016-04-30T06:35:17.000Z | 2019-12-04T08:23:22.000Z | # -*- coding: utf-8 -*-
"""
Code for calculating some similar to TFIDF features for all docs related to the same unique search term.
Competition: HomeDepot Search Relevance
Author: Kostia Omelianchuk
Team: Turing test
"""
from config_IgorKostia import *
import numpy as np
import pandas as pd
from sklearn.ensemble imp... | 26.4273 | 104 | 0.588817 |
37b897768f815c01fd1959412b4cef509944d10d | 12,179 | py | Python | electrum_mars/gui/kivy/uix/dialogs/tx_dialog.py | marscoin/electrum-mars | e95274b0ad959bdb02226c988303339a24acb8bf | [
"MIT"
] | 3 | 2021-08-15T08:05:00.000Z | 2021-11-21T21:35:10.000Z | electrum_mars/gui/kivy/uix/dialogs/tx_dialog.py | marscoin/electrum-mars | e95274b0ad959bdb02226c988303339a24acb8bf | [
"MIT"
] | 1 | 2021-12-02T08:04:05.000Z | 2021-12-02T08:04:05.000Z | electrum_mars/gui/kivy/uix/dialogs/tx_dialog.py | marscoin/electrum-mars | e95274b0ad959bdb02226c988303339a24acb8bf | [
"MIT"
] | null | null | null | import copy
from datetime import datetime
from typing import NamedTuple, Callable, TYPE_CHECKING
from functools import partial
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label... | 36.032544 | 134 | 0.579112 |
3eaf0ab922df10034e59896da1d5bcdb6a5efb45 | 3,403 | py | Python | tests/conftest.py | bcsummers/falcon-provider-audit | abb0d6ce85a60d345f6bb2b8ecf845a134ddd1b8 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | bcsummers/falcon-provider-audit | abb0d6ce85a60d345f6bb2b8ecf845a134ddd1b8 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | bcsummers/falcon-provider-audit | abb0d6ce85a60d345f6bb2b8ecf845a134ddd1b8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Testing conf module."""
# standard library
import os
import threading
# third-party
import pytest
from falcon import testing
from .Custom.app import app_db_1, app_dual_1, app_dual_2
from .Syslog.syslog_server import TestSyslogServers
# the log directory for all test cases
_LOG_DIRECTORY = ... | 29.336207 | 98 | 0.740817 |
e9ced684f486fa28f952dbdea3c27e36c4ecf5e4 | 2,310 | py | Python | tests/remoteexecution/remotecache.py | samkenxstream/buildstream | 2164ac3ad2854eea30f85af6af2bc8a0b8754f3f | [
"Apache-2.0"
] | null | null | null | tests/remoteexecution/remotecache.py | samkenxstream/buildstream | 2164ac3ad2854eea30f85af6af2bc8a0b8754f3f | [
"Apache-2.0"
] | null | null | null | tests/remoteexecution/remotecache.py | samkenxstream/buildstream | 2164ac3ad2854eea30f85af6af2bc8a0b8754f3f | [
"Apache-2.0"
] | null | null | null | # Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
import copy
import os
import pytest
from buildstream.exceptions import ErrorDomain
from buildstream._testing import cli_remote_execution as cli # pylint: disable=unused-import
from buildstream._testin... | 36.666667 | 107 | 0.707359 |
9b1daac0e039f4267204b40e358883476e26e960 | 5,015 | py | Python | app/business/transfer.py | justincc/RDSDS-Server | ed59110a9e56d19944c87464f682ce49111ad1e4 | [
"Apache-2.0"
] | null | null | null | app/business/transfer.py | justincc/RDSDS-Server | ed59110a9e56d19944c87464f682ce49111ad1e4 | [
"Apache-2.0"
] | 1 | 2020-08-11T10:48:16.000Z | 2020-08-11T10:48:16.000Z | app/business/transfer.py | justincc/RDSDS-Server | ed59110a9e56d19944c87464f682ce49111ad1e4 | [
"Apache-2.0"
] | 2 | 2020-10-13T14:22:59.000Z | 2020-11-13T16:50:54.000Z | from fastapi import APIRouter
from fastapi.encoders import jsonable_encoder
from starlette.requests import Request
from starlette.responses import JSONResponse
from app.models.transfer import TransferBase, TransferType, TransferResponse
from app.models.objects import Error
from app.business import globus
from ap... | 47.761905 | 116 | 0.689332 |
91c649ccc1c9491021a73489985d22fa34fa5f3f | 6,158 | py | Python | simulation/env_46.py | liaojh1998/cross-modal-concept2robot | 2a00937eb2ac02cbe3d5d5fa0f5868e85d194f6e | [
"MIT"
] | 4 | 2021-08-04T08:14:36.000Z | 2022-03-14T05:59:46.000Z | simulation/env_46.py | liaojh1998/cross-modal-concept2robot | 2a00937eb2ac02cbe3d5d5fa0f5868e85d194f6e | [
"MIT"
] | null | null | null | simulation/env_46.py | liaojh1998/cross-modal-concept2robot | 2a00937eb2ac02cbe3d5d5fa0f5868e85d194f6e | [
"MIT"
] | 2 | 2021-08-28T13:19:31.000Z | 2021-09-17T17:48:41.000Z | #!/usr/bin/env python3
import time
import math
from datetime import datetime
from time import sleep
import numpy as np
import random
import cv2
import os
import argparse
import torch
from scipy.spatial.transform import Rotation as R
import sys
sys.path.append('./')
from env import Engine
from utils_env import get_v... | 38.974684 | 168 | 0.676194 |
784f0e2030f337f291d829957902c2bde6918091 | 9,087 | py | Python | config/settings/common.py | aachi/kickass | 5668991440fbd759cde6e0e18956fa7706eb075a | [
"BSD-3-Clause"
] | null | null | null | config/settings/common.py | aachi/kickass | 5668991440fbd759cde6e0e18956fa7706eb075a | [
"BSD-3-Clause"
] | null | null | null | config/settings/common.py | aachi/kickass | 5668991440fbd759cde6e0e18956fa7706eb075a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django settings for kickass project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_lit... | 35.22093 | 98 | 0.608452 |
b178d6caeef110570ec2cbf8c6e2ef29c11582d5 | 407 | py | Python | djangoauthtrial/wsgi.py | sankalpmukim/django-auth-trial | 40d2a0eabb91acf666fffdb9c6456228d55c0882 | [
"MIT"
] | null | null | null | djangoauthtrial/wsgi.py | sankalpmukim/django-auth-trial | 40d2a0eabb91acf666fffdb9c6456228d55c0882 | [
"MIT"
] | null | null | null | djangoauthtrial/wsgi.py | sankalpmukim/django-auth-trial | 40d2a0eabb91acf666fffdb9c6456228d55c0882 | [
"MIT"
] | null | null | null | """
WSGI config for djangoauthtrial project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJAN... | 23.941176 | 78 | 0.793612 |
72d4e2a24dabe187754e76e665c6623d6bd0b741 | 266 | py | Python | Codechef/October Challenge 2019/Operations on a Matrix/test_ops_on_matrix.py | Goyatuzo/HackerRank | ad836faa7e8ecfe751a72027e1312ae3ee19f4ca | [
"MIT"
] | null | null | null | Codechef/October Challenge 2019/Operations on a Matrix/test_ops_on_matrix.py | Goyatuzo/HackerRank | ad836faa7e8ecfe751a72027e1312ae3ee19f4ca | [
"MIT"
] | 4 | 2016-03-19T05:13:29.000Z | 2021-05-10T16:42:42.000Z | Codechef/October Challenge 2019/Operations on a Matrix/test_ops_on_matrix.py | Goyatuzo/Challenges | ad836faa7e8ecfe751a72027e1312ae3ee19f4ca | [
"MIT"
] | null | null | null | import unittest
from ops_on_matrix import ops_on_matrix
class TestPhonePrices(unittest.TestCase):
def test_example(self):
res = ops_on_matrix(2, 2, [[1, 1], [1, 2], [2, 1]])
self.assertEqual(2, res)
if __name__ == '__main__':
unittest.main() | 22.166667 | 59 | 0.669173 |
c9a75997adf61ab0102fb908095a473d831246b1 | 484 | py | Python | src/tokens/migrations/0003_token_category.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | src/tokens/migrations/0003_token_category.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | src/tokens/migrations/0003_token_category.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.4 on 2018-08-19 15:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tokens', '0002_tokenfind'),
]
operations = [
migrations.AddField(
model_name='token',
name='category',
f... | 24.2 | 123 | 0.609504 |
8406c805ac7c97388df1ca683b3ee42b61123c7b | 15,987 | py | Python | jasy/script/output/Compressor.py | sebastian-software/jasy | 9740ed33f0836ab2dd3e00ab4fae4049f9908072 | [
"MIT"
] | 2 | 2015-05-27T19:30:49.000Z | 2015-12-10T16:55:14.000Z | jasy/script/output/Compressor.py | sebastian-software/jasy | 9740ed33f0836ab2dd3e00ab4fae4049f9908072 | [
"MIT"
] | 2 | 2015-03-16T09:15:58.000Z | 2015-04-07T19:05:47.000Z | jasy/script/output/Compressor.py | sebastian-software/jasy | 9740ed33f0836ab2dd3e00ab4fae4049f9908072 | [
"MIT"
] | 2 | 2017-07-18T20:08:05.000Z | 2021-01-04T10:46:14.000Z | #
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 Sebastian Werner
#
import re
import sys
import json
from jasy.script.tokenize.Lang import keywords
from jasy.script.parse.Lang import expressions, futureReserved
high_unicode = re.compile(r"\\u[2-9A-Fa-f][0-9A-Fa-f]{3}")
ascii_en... | 28.396092 | 143 | 0.544818 |
9cbb38bdf233e5d3a9a6b473ab62287cd3208cc8 | 488 | py | Python | packages/python/plotly/plotly/validators/layout/legend/_orientation.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/legend/_orientation.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/legend/_orientation.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class OrientationValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="orientation", parent_name="layout.legend", **kwargs
):
super(OrientationValidator, self).__init__(
plotly_name=plotly_name,
... | 32.533333 | 78 | 0.641393 |
0e49f0f0b2f8c827bafe5c6efbc01b4f33ec7669 | 1,369 | py | Python | .github/workflows/check-links/crawler.py | gabriel-milan/mais | d3f2dd70cd7574b021bde569ea31dcebcd5bb313 | [
"MIT"
] | null | null | null | .github/workflows/check-links/crawler.py | gabriel-milan/mais | d3f2dd70cd7574b021bde569ea31dcebcd5bb313 | [
"MIT"
] | null | null | null | .github/workflows/check-links/crawler.py | gabriel-milan/mais | d3f2dd70cd7574b021bde569ea31dcebcd5bb313 | [
"MIT"
] | null | null | null | from scrapy.item import Field, Item
from scrapy.linkextractors import LinkExtractor
from scrapy.selector import Selector
from scrapy.spiders import CrawlSpider, Rule
class LinkStatus(Item):
url = Field()
status = Field()
referer = Field()
link_text = Field()
class LinkSpider(CrawlSpider):
name =... | 29.12766 | 84 | 0.636961 |
e06852fcb342842702b5ff66f224a0ee96fd17d5 | 10,085 | py | Python | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/sdk/devtestlabs/models/lab_virtual_machine.py | saurabsa/azure-cli-old | f77477a98c9aa9cb55daf5b0d2f410d1455a9225 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/sdk/devtestlabs/models/lab_virtual_machine.py | saurabsa/azure-cli-old | f77477a98c9aa9cb55daf5b0d2f410d1455a9225 | [
"MIT"
] | 2 | 2021-03-25T21:38:56.000Z | 2021-11-15T17:46:45.000Z | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/sdk/devtestlabs/models/lab_virtual_machine.py | Visual-Studio-China/azure-cli-int | 48c7c7f371a0ecc4ebfd4dcfdc72764beddf5c31 | [
"MIT"
] | null | null | null | # 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.
# -----------------------------------------------------... | 54.22043 | 734 | 0.694497 |
498dbbaaee18f85664b1a62549c3bb8ef6617e0c | 2,885 | py | Python | lib/models/MobileNetCoco14_5.py | yukihiko/human-pose-estimation.pytorch | 187f60ac2088f91b9a48d9e5f4c2b1053a9f32bf | [
"MIT"
] | 2 | 2019-04-30T12:31:32.000Z | 2019-11-25T16:39:07.000Z | lib/models/MobileNetCoco14_5.py | yukihiko/human-pose-estimation.pytorch | 187f60ac2088f91b9a48d9e5f4c2b1053a9f32bf | [
"MIT"
] | null | null | null | lib/models/MobileNetCoco14_5.py | yukihiko/human-pose-estimation.pytorch | 187f60ac2088f91b9a48d9e5f4c2b1053a9f32bf | [
"MIT"
] | 4 | 2019-12-05T06:26:57.000Z | 2021-12-16T05:17:39.000Z | # -*- coding: utf-8 -*-
import torch.nn as nn
import torch.nn.functional as F
import sys
class MobileNetCoco14_5(nn.Module):
def __init__(self):
super(MobileNetCoco14_5, self).__init__()
self.col = 14
self.Nj = 17
def conv_bn(inp, oup, stride):
return nn... | 31.358696 | 75 | 0.498787 |
69e8e89dd29f505643e8bddc8e961636722b3acb | 2,875 | py | Python | 14_orf/solution2_str_partition.py | LongNguyen1984/biofx_python | b8d45dc38d968674c6b641051b73f8ed1503b1e4 | [
"MIT"
] | 1 | 2021-04-21T07:15:27.000Z | 2021-04-21T07:15:27.000Z | 14_orf/solution2_str_partition.py | LongNguyen1984/biofx_python | b8d45dc38d968674c6b641051b73f8ed1503b1e4 | [
"MIT"
] | null | null | null | 14_orf/solution2_str_partition.py | LongNguyen1984/biofx_python | b8d45dc38d968674c6b641051b73f8ed1503b1e4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" Open Reading Frames """
import argparse
import sys
from typing import List, NamedTuple, TextIO
from Bio import Seq, SeqIO
class Args(NamedTuple):
""" Command-line arguments """
file: TextIO
# --------------------------------------------------
def get_args() -> Args:
""" Get c... | 25.900901 | 78 | 0.472348 |
4f1404accf429af8352ca762f5a5dc845d9bdc98 | 1,365 | py | Python | metaflow/plugins/resources_decorator.py | celsiustx/metaflow | 53b72aac978c429ced680ebbd222c1056425ad9c | [
"Apache-2.0"
] | 1 | 2022-01-07T22:32:27.000Z | 2022-01-07T22:32:27.000Z | metaflow/plugins/resources_decorator.py | celsiustx/metaflow | 53b72aac978c429ced680ebbd222c1056425ad9c | [
"Apache-2.0"
] | null | null | null | metaflow/plugins/resources_decorator.py | celsiustx/metaflow | 53b72aac978c429ced680ebbd222c1056425ad9c | [
"Apache-2.0"
] | null | null | null | from metaflow.decorators import StepDecorator
class ResourcesDecorator(StepDecorator):
"""
Step decorator to specify the resources needed when executing this step.
This decorator passes this information along to container orchestrator
(AWS Batch, Kubernetes, etc.) when requesting resources to exe... | 29.042553 | 77 | 0.620513 |
f6289ea02abf57a1f1805530e7d77c100730aa15 | 14,329 | py | Python | esphomeyaml/components/mqtt.py | dotlambda/esphomeyaml | 4f5389998fee8e61520c48a4a4e2ddb960649f01 | [
"MIT"
] | 2 | 2020-12-03T17:38:24.000Z | 2021-03-10T04:11:44.000Z | esphomeyaml/components/mqtt.py | dreed47/esphomeyaml | 9890a51c5136c356c2cc7f14a3ab8fe547bbb72a | [
"MIT"
] | null | null | null | esphomeyaml/components/mqtt.py | dreed47/esphomeyaml | 9890a51c5136c356c2cc7f14a3ab8fe547bbb72a | [
"MIT"
] | null | null | null | from collections import OrderedDict
import re
import voluptuous as vol
from esphomeyaml import automation
from esphomeyaml.automation import ACTION_REGISTRY
from esphomeyaml.components import logger
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_AVAILABILITY, CONF_BIRTH_MESSAGE, CONF_BR... | 42.144118 | 100 | 0.708842 |
ac49500f41a47dc691542f61a5f1b2145a57336b | 1,798 | py | Python | xero_python/accounting/models/expense_claims.py | parasharrk/xero-python | e8416f3bd893520a343af014f5bb65acbf1f4f13 | [
"MIT"
] | null | null | null | xero_python/accounting/models/expense_claims.py | parasharrk/xero-python | e8416f3bd893520a343af014f5bb65acbf1f4f13 | [
"MIT"
] | null | null | null | xero_python/accounting/models/expense_claims.py | parasharrk/xero-python | e8416f3bd893520a343af014f5bb65acbf1f4f13 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Accounting API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 2.4.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_pytho... | 27.242424 | 124 | 0.650167 |
3700c7b43efdcd17931ea3a087e71418f8a69e7d | 3,280 | py | Python | elegantrl/agents/AgentDoubleDQN.py | ihopethiswillfi/ElegantRL-1 | b81052a0bc6802443eb0f653c69158396b613b00 | [
"Apache-2.0"
] | null | null | null | elegantrl/agents/AgentDoubleDQN.py | ihopethiswillfi/ElegantRL-1 | b81052a0bc6802443eb0f653c69158396b613b00 | [
"Apache-2.0"
] | null | null | null | elegantrl/agents/AgentDoubleDQN.py | ihopethiswillfi/ElegantRL-1 | b81052a0bc6802443eb0f653c69158396b613b00 | [
"Apache-2.0"
] | null | null | null | import torch
from elegantrl.agents.net import QNetTwin, QNetTwinDuel
from elegantrl.agents.AgentDQN import AgentDQN
class AgentDoubleDQN(AgentDQN):
"""
Bases: ``AgentDQN``
Double Deep Q-Network algorithm. “Deep Reinforcement Learning with Double Q-learning”. H. V. Hasselt et al.. 2015.
:param net_di... | 44.931507 | 118 | 0.660976 |
b350b0f3d038718146bf8480f50e822a50002c19 | 100 | py | Python | sparcc_fast/__init__.py | shafferm/fast_sparCC | 8e753ed1250be0185faffccdfcdbd4f5da44a756 | [
"BSD-3-Clause"
] | 6 | 2018-06-10T14:55:04.000Z | 2022-03-31T07:23:44.000Z | sparcc_fast/__init__.py | shafferm/fast_sparCC | 8e753ed1250be0185faffccdfcdbd4f5da44a756 | [
"BSD-3-Clause"
] | 1 | 2020-12-17T12:21:32.000Z | 2020-12-17T12:21:32.000Z | sparcc_fast/__init__.py | shafferm/fast_sparCC | 8e753ed1250be0185faffccdfcdbd4f5da44a756 | [
"BSD-3-Clause"
] | 3 | 2019-07-02T10:04:59.000Z | 2020-10-07T21:06:02.000Z | __author__ = 'shafferm'
from run_sparcc import sparcc_correlation, sparcc_correlation_w_bootstraps
| 25 | 74 | 0.87 |
190b5ed7e91bcb95be3cbd2de8bd7bebde40fc9b | 2,801 | py | Python | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/node_item.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/node_item.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/node_item.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class NodeItem:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attrib... | 24.356522 | 79 | 0.514816 |
67b8f6fe443662366125d3992ea9f5e6b987b48c | 5,084 | py | Python | Thesis@3.9.1/Lib/site-packages/setuptools/glob.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | 1 | 2020-07-14T08:40:59.000Z | 2020-07-14T08:40:59.000Z | Thesis@3.9.1/Lib/site-packages/setuptools/glob.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | Thesis@3.9.1/Lib/site-packages/setuptools/glob.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.
Changes include:
* `yield from` and PEP3102 `*` removed.
* Hidden files are not ignored.
"""
import os
import re
import fnmatch
__all__ = ["glob", "iglob", "escape"]
def glob(pathname, recursive=False):
"""Return a list of paths matching... | 29.051429 | 78 | 0.636703 |
31c3be3901f8245b2ac0146316cf13b964525a6a | 6,018 | py | Python | modules/feedback/tests/unit/test_feedback_score_fields.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | modules/feedback/tests/unit/test_feedback_score_fields.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | 11 | 2019-11-12T23:26:45.000Z | 2021-06-10T17:37:23.000Z | modules/feedback/tests/unit/test_feedback_score_fields.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | import pytest
from modules.feedback.models.score_fields.regression_reference_score import RegressionReferenceScore
from tasks.models import Task
from modules.feedback.models.score_fields import (
VotingScore, ReferenceScore,
NERReferenceScore)
@pytest.mark.django_db
def test_reference_score(task_with_items,... | 34.193182 | 100 | 0.698903 |
effa16bd99ab71b273d82d0014908be2e033a74e | 1,126 | py | Python | google/cloud/bigquery_storage_v1/gapic/enums.py | vam-google/python-bigquery-storage | e988834a2e7397a7a543ac95ae52a573c1699d21 | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery_storage_v1/gapic/enums.py | vam-google/python-bigquery-storage | e988834a2e7397a7a543ac95ae52a573c1699d21 | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery_storage_v1/gapic/enums.py | vam-google/python-bigquery-storage | e988834a2e7397a7a543ac95ae52a573c1699d21 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 30.432432 | 79 | 0.709591 |
b1864d1a335a0ef371f66c61d51de0231f3c1ec0 | 7,003 | py | Python | bin/helpers/bactopia-prepare.py | oschwengers/bactopia | b18169d0395f6db3887c5d3c6a1bd75f63755a34 | [
"MIT"
] | 1 | 2020-09-19T11:17:40.000Z | 2020-09-19T11:17:40.000Z | bin/helpers/bactopia-prepare.py | oschwengers/bactopia | b18169d0395f6db3887c5d3c6a1bd75f63755a34 | [
"MIT"
] | null | null | null | bin/helpers/bactopia-prepare.py | oschwengers/bactopia | b18169d0395f6db3887c5d3c6a1bd75f63755a34 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
"""
usage: bactopia prepare [-h] [-f STR] [-a STR] [--fastq_seperator STR]
[--fastq_pattern STR] [--assembly_pattern STR]
[--long_reads] [--version]
STR
bactopia prepare - Read a directory and prepare a FOFN of
FASTQs/FASTA... | 37.25 | 145 | 0.567185 |
ad0b67e438bd7acafabe45336f183d89bbc6d20f | 372 | py | Python | sample/create_table/sample_create_table_from_dataframe.py | jph00/SimpleSQLite | aef4a3e416e4c578c2017cfbdc11d3afa67fcdc3 | [
"MIT"
] | 4 | 2018-03-25T19:47:28.000Z | 2020-07-09T14:10:52.000Z | sample/create_table/sample_create_table_from_dataframe.py | jph00/SimpleSQLite | aef4a3e416e4c578c2017cfbdc11d3afa67fcdc3 | [
"MIT"
] | null | null | null | sample/create_table/sample_create_table_from_dataframe.py | jph00/SimpleSQLite | aef4a3e416e4c578c2017cfbdc11d3afa67fcdc3 | [
"MIT"
] | 1 | 2019-03-08T11:45:53.000Z | 2019-03-08T11:45:53.000Z | #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from simplesqlite import SimpleSQLite
import pandas
con = SimpleSQLite("pandas_df.sqlite")
con.create_table_from_dataframe(pandas.DataFrame(
[
[0, 0.1, "a"],
[1, 1.1, "bb"],
[2, 2.2, "ccc"],
],
columns... | 18.6 | 49 | 0.629032 |
166a2ec41332f3236358ddd7f4e738b0a7979e98 | 648 | py | Python | mayan/apps/metadata/widgets.py | O2Graphics/Mayan-EDMS | e11e6f47240f3c536764be66828dbe6428dceb41 | [
"Apache-2.0"
] | null | null | null | mayan/apps/metadata/widgets.py | O2Graphics/Mayan-EDMS | e11e6f47240f3c536764be66828dbe6428dceb41 | [
"Apache-2.0"
] | 5 | 2021-03-19T22:56:45.000Z | 2022-03-12T00:08:43.000Z | mayan/apps/metadata/widgets.py | halsten/mayan-edms | 10372daede6e6dea0bea67eb98767e3be6fbf86f | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.utils.html import format_html_join
def get_metadata_string(document):
"""
Return a formated representation of a document's metadata values
"""
return format_html_join(
'\n', '<div class="metadata-display" style="word-break: break-all; overfl... | 36 | 174 | 0.665123 |
bd88c4ead660018084624b5cf1c336eed98e14ce | 1,312 | py | Python | python/qibuild/actions/list_binaries.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qibuild/actions/list_binaries.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qibuild/actions/list_binaries.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
"""
List every binaries in the given worktree.
Mainly useful to auto-complete ``qibuild run``.
"""
from __future__ import a... | 31.238095 | 84 | 0.662348 |
07f7f0d68a4949396eec3705fc09f9bea89cffe4 | 1,073 | py | Python | setup.py | stsievert/adadamp | 58baaec11510fa5918cb5808012ff251ee2ed2bb | [
"BSD-3-Clause"
] | 3 | 2020-07-17T16:11:46.000Z | 2021-02-20T01:36:39.000Z | setup.py | stsievert/adadamp | 58baaec11510fa5918cb5808012ff251ee2ed2bb | [
"BSD-3-Clause"
] | 13 | 2020-04-24T19:43:04.000Z | 2021-04-14T18:13:27.000Z | setup.py | stsievert/adadamp | 58baaec11510fa5918cb5808012ff251ee2ed2bb | [
"BSD-3-Clause"
] | 2 | 2020-03-24T22:13:43.000Z | 2021-05-04T23:10:17.000Z | from os.path import exists
from setuptools import setup, find_packages
# install_requires = [
# "torch >= 0.14.0",
# "toolz >= 0.8.2",
# "scikit-learn >= 0.18.0",
# "scipy >= 0.13.0",
# "numpy >= 1.8.0",
# ]
def _get_version() -> str:
with open("adadamp/__init__.py", "r") as f:
raw = f.readlines(... | 26.170732 | 75 | 0.648649 |
429cdf74106122ad0fc0fbaa241242a082615f3d | 4,504 | py | Python | cuml_bench/df_clsf.py | cbigit/scikit-learn_bench | c94ca9489cbdccb20545d40b89a2a25de1fe26d2 | [
"Apache-2.0"
] | null | null | null | cuml_bench/df_clsf.py | cbigit/scikit-learn_bench | c94ca9489cbdccb20545d40b89a2a25de1fe26d2 | [
"Apache-2.0"
] | null | null | null | cuml_bench/df_clsf.py | cbigit/scikit-learn_bench | c94ca9489cbdccb20545d40b89a2a25de1fe26d2 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:/... | 43.728155 | 85 | 0.609014 |
de8e3dd4c5bf1a61b4188e134889d06e3d63c788 | 2,305 | py | Python | playground/graph_cost.py | Moecker/gpx | e7c5c18395ac980baf8d5b95742b3a52438bc0c3 | [
"MIT"
] | null | null | null | playground/graph_cost.py | Moecker/gpx | e7c5c18395ac980baf8d5b95742b3a52438bc0c3 | [
"MIT"
] | null | null | null | playground/graph_cost.py | Moecker/gpx | e7c5c18395ac980baf8d5b95742b3a52438bc0c3 | [
"MIT"
] | null | null | null | from collections import defaultdict
from functools import partial
import logging
import pprint
import graph_simple
class CostGraph(graph_simple.Graph):
def __init__(self, _):
self._graph = defaultdict(partial(defaultdict, int))
def __repr__(self):
return "{}({})".format(self.__class__.__name... | 35.461538 | 88 | 0.554881 |
77b3c0f07476e27862164feef2b62c5a25650752 | 13,388 | py | Python | maistra/vendor/com_googlesource_chromium_v8/wee8/third_party/depot_tools/tests/gerrit_util_test.py | maistra-bot/proxy | 05a551df62d90e96c24afc649f2755983d020b5b | [
"Apache-2.0"
] | 1 | 2021-11-22T05:43:42.000Z | 2021-11-22T05:43:42.000Z | maistra/vendor/com_googlesource_chromium_v8/wee8/third_party/depot_tools/tests/gerrit_util_test.py | maistra-bot/proxy | 05a551df62d90e96c24afc649f2755983d020b5b | [
"Apache-2.0"
] | null | null | null | maistra/vendor/com_googlesource_chromium_v8/wee8/third_party/depot_tools/tests/gerrit_util_test.py | maistra-bot/proxy | 05a551df62d90e96c24afc649f2755983d020b5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env vpython3
# coding=utf-8
# Copyright (c) 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import unicode_literals
import base64
import json
import o... | 34.416452 | 79 | 0.636316 |
036064d54911b0f9522f9a327ee821658cff29ec | 3,028 | py | Python | packages/python/plotly/plotly/graph_objs/choropleth/_selected.py | eranws/plotly.py | 5b0e8d3ccab55fe1a6e4ba123cfc9d718a9ffc5a | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/choropleth/_selected.py | eranws/plotly.py | 5b0e8d3ccab55fe1a6e4ba123cfc9d718a9ffc5a | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/choropleth/_selected.py | eranws/plotly.py | 5b0e8d3ccab55fe1a6e4ba123cfc9d718a9ffc5a | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Selected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choropleth"
_path_str = "choropleth.selected"
_valid_props = {"marker"}
# marker
... | 28.299065 | 82 | 0.537318 |
25142c1c900b9655bff83bd3ddd75629f4f5ee35 | 296 | py | Python | odoo/custom/src/private/l10n_th_ecosoft/__init__.py | ecosoft-odoo/ecosoft | 28ea9169c7b6b7e28351db8a8de594f5ee7ee869 | [
"BSL-1.0"
] | 1 | 2021-02-13T12:43:38.000Z | 2021-02-13T12:43:38.000Z | odoo/custom/src/private/l10n_th_ecosoft/__init__.py | ecosoft-odoo/ecosoft | 28ea9169c7b6b7e28351db8a8de594f5ee7ee869 | [
"BSL-1.0"
] | 1 | 2021-01-13T07:25:32.000Z | 2021-01-13T07:25:32.000Z | odoo/custom/src/private/l10n_th_ecosoft/__init__.py | ecosoft-odoo/ecosoft | 28ea9169c7b6b7e28351db8a8de594f5ee7ee869 | [
"BSL-1.0"
] | null | null | null | # Part of Odoo. See LICENSE file for full copyright and licensing details.
def _preserve_tag_on_taxes(cr, registry):
from odoo.addons.account.models.chart_template import (
preserve_existing_tags_on_taxes,
)
preserve_existing_tags_on_taxes(cr, registry, "l10n_th_ecosoft")
| 29.6 | 74 | 0.77027 |
4a474e993dc686e11b36821bf378fe31b1a44389 | 1,342 | py | Python | Python/dic.py | lzz5235/Code-Segment | e10a172972ea75151f77929dfe105729600c854e | [
"MIT"
] | 4 | 2017-04-28T09:27:28.000Z | 2018-03-26T09:20:06.000Z | Python/dic.py | lzz5235/Code-Segment | e10a172972ea75151f77929dfe105729600c854e | [
"MIT"
] | null | null | null | Python/dic.py | lzz5235/Code-Segment | e10a172972ea75151f77929dfe105729600c854e | [
"MIT"
] | 2 | 2020-07-04T02:46:21.000Z | 2021-09-13T11:29:14.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 12 15:05:41 2015
@author: lzz
"""
def load_dic(filename):
f = open(filename)
word_dic = set()
max_length = 1
for line in f:
word = unicode(line.strip(),'utf-8')
word_dic.add(word)
if len(word) > max_length:
... | 22.366667 | 67 | 0.537258 |
39f8ca5753299fdb8503160d0d0d2e7f20ed7882 | 20,303 | py | Python | psqlextra/manager/manager.py | SoprisApps/django-postgres-extra | e0eb6b2ec5b0ef72555aa8ecc187fda1277c0ba5 | [
"MIT"
] | null | null | null | psqlextra/manager/manager.py | SoprisApps/django-postgres-extra | e0eb6b2ec5b0ef72555aa8ecc187fda1277c0ba5 | [
"MIT"
] | 1 | 2018-12-11T15:12:56.000Z | 2018-12-11T15:12:56.000Z | psqlextra/manager/manager.py | SoprisApps/django-postgres-extra | e0eb6b2ec5b0ef72555aa8ecc187fda1277c0ba5 | [
"MIT"
] | null | null | null | from typing import Dict, List, Union, Tuple
import django
from django.conf import settings
from django.db import models, transaction
from django.db.models.sql import UpdateQuery
from django.db.models.sql.constants import CURSOR
from django.db.models.fields import NOT_PROVIDED
from django.core.exceptions import Imprope... | 34.88488 | 116 | 0.614835 |
6b8790b90f60acf66d180f13807d91cbe4359269 | 8,032 | py | Python | vimfiles/bundle/vim-python/submodules/pylama/pylama/config.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | vimfiles/bundle/vim-python/submodules/pylama/pylama/config.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | vimfiles/bundle/vim-python/submodules/pylama/pylama/config.py | ciskoinch8/vimrc | 5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """Parse arguments from command line and configuration files."""
import fnmatch
import os
import sys
import re
import logging
from argparse import ArgumentParser
from . import __version__
from .libs.inirama import Namespace
from .lint.extensions import LINTERS
#: A default checkers
DEFAULT_LINTERS = 'pycodestyle', '... | 28.99639 | 79 | 0.638944 |
7560d50f305e65cb2cd4d5cb7720cc0e7682f435 | 2,275 | py | Python | asignacion3maxmin/app/__init__.py | jawmuk/uip-prog3 | c21f226ea64636a9826dad9b82f1c837b95e6398 | [
"MIT"
] | null | null | null | asignacion3maxmin/app/__init__.py | jawmuk/uip-prog3 | c21f226ea64636a9826dad9b82f1c837b95e6398 | [
"MIT"
] | null | null | null | asignacion3maxmin/app/__init__.py | jawmuk/uip-prog3 | c21f226ea64636a9826dad9b82f1c837b95e6398 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Este programa agarra dos variables y cuenta las veces que fue llamada la misma
'''
maxCalled = 0
minCalled = 0
def max_val(a, b):
#''''Returns the maximum of the specified arguments.
''' Esta parte dice cual es el numero mayor entre los 2 numeros ingresados
:p... | 16.977612 | 121 | 0.592527 |
c01d6c513fd7014cdf01e2c67c5aabb00b04fc65 | 1,650 | py | Python | tests/test_factory.py | provinzkraut/redlock-plus | 9773204ea686aa9e7faaf3dedf8fb79347f56347 | [
"MIT"
] | 2 | 2021-09-21T15:04:06.000Z | 2022-01-01T16:13:02.000Z | tests/test_factory.py | provinzkraut/redlock-plus | 9773204ea686aa9e7faaf3dedf8fb79347f56347 | [
"MIT"
] | null | null | null | tests/test_factory.py | provinzkraut/redlock-plus | 9773204ea686aa9e7faaf3dedf8fb79347f56347 | [
"MIT"
] | 1 | 2021-09-21T15:10:35.000Z | 2021-09-21T15:10:35.000Z | import pytest
from redlock_plus import LockFactory, InsufficientNodesError
import redlock_plus
def test_create(fake_redis_client):
factory = LockFactory(
[fake_redis_client(), fake_redis_client(), fake_redis_client()]
)
lock = factory("test_factory_create", ttl=500, retry_times=5, retry_delay=10... | 28.448276 | 82 | 0.725455 |
29467cc54e6cdf19a2bbba67ccd99db070bb9860 | 6,721 | py | Python | main/settings.py | gurupratap-matharu/polls | 5484a1f639b2ccd5e0a676f24cf0e23b6b2d0639 | [
"MIT"
] | null | null | null | main/settings.py | gurupratap-matharu/polls | 5484a1f639b2ccd5e0a676f24cf0e23b6b2d0639 | [
"MIT"
] | 66 | 2020-08-25T02:03:25.000Z | 2021-09-22T19:33:34.000Z | main/settings.py | gurupratap-matharu/polls | 5484a1f639b2ccd5e0a676f24cf0e23b6b2d0639 | [
"MIT"
] | null | null | null | """
Django settings for main project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from pat... | 26.565217 | 103 | 0.685315 |
7935f6220b27247c03af3e847259d4720629901f | 948 | py | Python | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/test.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | null | null | null | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/test.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | 5 | 2021-04-08T22:02:15.000Z | 2022-02-10T14:53:45.000Z | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/separate_package/find_module_no_info_analyze_name_main_3/test.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | null | null | null | import unittest
from hstest.check_result import CheckResult, correct
from hstest.dynamic.dynamic_test import dynamic_test
from hstest.stage_test import StageTest
from hstest.testing.tested_program import TestedProgram
class FindModuleNoInfoAnalyzeImports(StageTest):
@dynamic_test
def test(self):
main... | 27.882353 | 91 | 0.646624 |
6c6c3c4f205109ad75fe7d1f70c6ef7a4a25b890 | 1,825 | py | Python | exercises/en/solution_03_20a.py | hfboyce/MCL-DSCI-571-machine-learning | 25757369491ac547daa94ff1143ca7389d433a6e | [
"MIT"
] | 1 | 2020-11-23T03:19:18.000Z | 2020-11-23T03:19:18.000Z | exercises/en/solution_03_20a.py | hfboyce/MCL-DSCI-571-machine-learning | 25757369491ac547daa94ff1143ca7389d433a6e | [
"MIT"
] | 13 | 2020-10-02T16:48:24.000Z | 2020-12-09T18:58:21.000Z | exercises/en/solution_03_20a.py | hfboyce/MCL-DSCI-571-machine-learning | 25757369491ac547daa94ff1143ca7389d433a6e | [
"MIT"
] | 2 | 2020-10-28T19:43:42.000Z | 2021-03-30T22:57:47.000Z | import pandas as pd
import altair as alt
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split, cross_validate
# Loading in the data
bball_df = pd.read_csv('data/bball.csv')
bball_df = bball_df[(bball_df['position'] =='G') | (bball_df['position'] =='F')]
# Define X and y... | 43.452381 | 84 | 0.598904 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.