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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fe449994f53472b230d2f9d84c31e756770c4c13 | 419 | py | Python | users/migrations/0002_auto_20201018_1256.py | DerrickOdhiambo/Instagram | ef3a27bdb8616bd786c6e7f6f10083c13d5dea1a | [
"MIT"
] | null | null | null | users/migrations/0002_auto_20201018_1256.py | DerrickOdhiambo/Instagram | ef3a27bdb8616bd786c6e7f6f10083c13d5dea1a | [
"MIT"
] | null | null | null | users/migrations/0002_auto_20201018_1256.py | DerrickOdhiambo/Instagram | ef3a27bdb8616bd786c6e7f6f10083c13d5dea1a | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-18 12:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='profile_picture',
... | 22.052632 | 86 | 0.608592 |
2f37beaa99a9a46d70dca76df131ddc16bcfbed6 | 3,537 | py | Python | gammapy/irf/tests/test_psf_table.py | Jaleleddine/gammapy | de9195df40fa5bbf8840cda4e7cd5e8cc5eaadbb | [
"BSD-3-Clause"
] | null | null | null | gammapy/irf/tests/test_psf_table.py | Jaleleddine/gammapy | de9195df40fa5bbf8840cda4e7cd5e8cc5eaadbb | [
"BSD-3-Clause"
] | 1 | 2017-02-22T23:12:30.000Z | 2017-02-22T23:12:30.000Z | gammapy/irf/tests/test_psf_table.py | Jaleleddine/gammapy | de9195df40fa5bbf8840cda4e7cd5e8cc5eaadbb | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_allclose
from astropy import units as u
from astropy.coordinates import Angle
from gammapy.irf import EnergyDependentTablePSF, TablePSF
from gammapy.utils.testing import mpl_plot_check, requires_data, req... | 33.056075 | 86 | 0.650269 |
f3470c52775e20951e18ac19d475807fbd390857 | 865 | py | Python | monasca_api/hacking/checks.py | zhangjianweibj/monasca-api | 26133aefe413546f91aaa13c981fe93a69dfc2eb | [
"Apache-2.0"
] | null | null | null | monasca_api/hacking/checks.py | zhangjianweibj/monasca-api | 26133aefe413546f91aaa13c981fe93a69dfc2eb | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | monasca_api/hacking/checks.py | zhangjianweibj/monasca-api | 26133aefe413546f91aaa13c981fe93a69dfc2eb | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2017 FUJITSU LIMITED
#
# 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 writ... | 27.903226 | 75 | 0.724855 |
59d739d1fba1b64c88d0bdb5d8fb3efc1b420d01 | 2,337 | py | Python | plata/contact/forms.py | andrei-datcu/plata | ad9dab8364d37d29eb3ac2b77b3aab70a87a85b2 | [
"BSD-3-Clause"
] | null | null | null | plata/contact/forms.py | andrei-datcu/plata | ad9dab8364d37d29eb3ac2b77b3aab70a87a85b2 | [
"BSD-3-Clause"
] | null | null | null | plata/contact/forms.py | andrei-datcu/plata | ad9dab8364d37d29eb3ac2b77b3aab70a87a85b2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from plata.shop import forms as shop_forms
from plata.shop.models import Order
class CheckoutForm(shop_forms.BaseCheckoutForm):
class Meta:
fields = ["notes", "email"... | 35.409091 | 80 | 0.606333 |
0b103c920667fe668a0f969599a4a87f93dcf293 | 3,007 | py | Python | python/modules/trustping.py | sercher/indy-agent | 86c3cd751c28b4e777d1b854d22d509165e7c193 | [
"Apache-2.0"
] | 1 | 2019-12-10T11:37:16.000Z | 2019-12-10T11:37:16.000Z | python/modules/trustping.py | sercher/indy-agent | 86c3cd751c28b4e777d1b854d22d509165e7c193 | [
"Apache-2.0"
] | null | null | null | python/modules/trustping.py | sercher/indy-agent | 86c3cd751c28b4e777d1b854d22d509165e7c193 | [
"Apache-2.0"
] | 1 | 2018-05-31T15:56:00.000Z | 2018-05-31T15:56:00.000Z | import aiohttp
import aiohttp_jinja2
import jinja2
import base64
import json
import time
import uuid
from indy import did, wallet, pairwise, crypto, non_secrets
from helpers import str_to_bytes, serialize_bytes_json, bytes_to_str
from router.simple_router import SimpleRouter
import serializer.json_serializer as Serial... | 30.373737 | 87 | 0.634519 |
65d4071693d5143670b2641744ea73c38084b804 | 5,329 | py | Python | benchmarks/python_e2e/main.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | benchmarks/python_e2e/main.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | benchmarks/python_e2e/main.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 35.291391 | 79 | 0.581723 |
77538d170ae6c71f56d733df8ecf8e14fb2ae930 | 269 | py | Python | python/exercise/fibonacci.py | kindrabbit/programming | 2c9b7e24e33ecc174c2efb51727b3886ebc00acf | [
"Apache-2.0"
] | 1 | 2021-01-24T02:07:34.000Z | 2021-01-24T02:07:34.000Z | python/exercise/fibonacci.py | kindrabbit/programming | 2c9b7e24e33ecc174c2efb51727b3886ebc00acf | [
"Apache-2.0"
] | null | null | null | python/exercise/fibonacci.py | kindrabbit/programming | 2c9b7e24e33ecc174c2efb51727b3886ebc00acf | [
"Apache-2.0"
] | null | null | null | def fibonacci(number):
first = 1
second = 1
current = second
print(first)
while current < number:
print(current)
current = first + second
first = second
second = current
# print(fibonacci(10))
print(fibonacci(1000)) | 19.214286 | 32 | 0.594796 |
2b5162cc55e702fee48d2ac48c30f762fd87e1ee | 128 | py | Python | app/snippets/admin.py | eibrahimarisoy/drf-quickstart- | 8827845d55cae1d19292d33631b176af183b3783 | [
"MIT"
] | null | null | null | app/snippets/admin.py | eibrahimarisoy/drf-quickstart- | 8827845d55cae1d19292d33631b176af183b3783 | [
"MIT"
] | 4 | 2021-03-19T01:49:49.000Z | 2021-06-10T18:54:04.000Z | app/snippets/admin.py | eibrahimarisoy/drf-quickstart- | 8827845d55cae1d19292d33631b176af183b3783 | [
"MIT"
] | null | null | null | from django.contrib import admin
from snippets.models import Snippet
# Register your models here.
admin.site.register(Snippet)
| 21.333333 | 35 | 0.820313 |
868dfa35cdde2af791e11bbe54bd878b9677dc9c | 3,401 | py | Python | corehq/apps/case_importer/tracking/case_upload_tracker.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/case_importer/tracking/case_upload_tracker.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/case_importer/tracking/case_upload_tracker.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | import time
from django.db import transaction
from memoized import memoized
from corehq.apps.case_importer.exceptions import ImporterRefError
from corehq.apps.case_importer.tracking.exceptions import TimedOutWaitingForCaseUploadRecord
from corehq.apps.case_importer.tracking.filestorage import (
persistent_file_s... | 33.019417 | 102 | 0.697148 |
361f504586aa17fe98efb37bbb3c0c43f4bd5691 | 10,758 | py | Python | sdk/python/pulumi_azure_native/alertsmanagement/action_rule_by_name.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/alertsmanagement/action_rule_by_name.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/alertsmanagement/action_rule_by_name.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 43.379032 | 488 | 0.653653 |
07573a2e08aa0357dc6e65c58e8f8a7f62e4f48e | 11,144 | py | Python | ml-agents/mlagents/trainers/policy/nn_policy.py | pipiczistvan/ml-agents | 49568ca4ffe0ce05553962835830f40683fe5e85 | [
"Apache-2.0"
] | 2 | 2020-12-01T20:46:13.000Z | 2021-03-07T16:17:45.000Z | ml-agents/mlagents/trainers/policy/nn_policy.py | pipiczistvan/ml-agents | 49568ca4ffe0ce05553962835830f40683fe5e85 | [
"Apache-2.0"
] | 1 | 2020-06-08T20:59:46.000Z | 2020-06-08T20:59:46.000Z | ml-agents/mlagents/trainers/policy/nn_policy.py | pipiczistvan/ml-agents | 49568ca4ffe0ce05553962835830f40683fe5e85 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Optional, List
from mlagents.tf_utils import tf
from mlagents_envs.timers import timed
from mlagents_envs.base_env import DecisionSteps
from mlagents.trainers.brain import BrainParameters
from mlagents.trainers.models import EncoderType
from mlagents.trainers.models import ModelUtils
from ... | 40.376812 | 115 | 0.618719 |
ef54efc2df4f6744f9f565d17fe07ce7e5dd4a4f | 1,621 | py | Python | credentials.py | vugutsa/Password-locker | 231dcdbc1f3c2f95605367f3a4b1f245462b777c | [
"Unlicense"
] | 1 | 2021-03-29T14:11:22.000Z | 2021-03-29T14:11:22.000Z | credentials.py | vugutsa/Password-locker | 231dcdbc1f3c2f95605367f3a4b1f245462b777c | [
"Unlicense"
] | null | null | null | credentials.py | vugutsa/Password-locker | 231dcdbc1f3c2f95605367f3a4b1f245462b777c | [
"Unlicense"
] | null | null | null | class Credentials:
"""
Class that generates new instances of credentials
"""
credentials_list = [] # Empty credentials list
def __init__(self,handle,user_name1,password1):
# docstring removed for simplicity
self.handle = handle
self.user_name1 = user_name1
self.passw... | 27.474576 | 80 | 0.592227 |
b03e2aa976fb8040c6db577ca84d8e8c48ee4a52 | 5,031 | py | Python | blowfish.py | mhearne-usgs/handcrypt | fd4aa0f89258d9a01cbcdd53f9cd03e19e6367ee | [
"MIT"
] | 2 | 2017-09-28T18:30:49.000Z | 2021-04-23T22:39:26.000Z | blowfish.py | mhearne-usgs/handcrypt | fd4aa0f89258d9a01cbcdd53f9cd03e19e6367ee | [
"MIT"
] | null | null | null | blowfish.py | mhearne-usgs/handcrypt | fd4aa0f89258d9a01cbcdd53f9cd03e19e6367ee | [
"MIT"
] | 1 | 2015-10-20T07:45:22.000Z | 2015-10-20T07:45:22.000Z | #!/usr/bin/env python
import bfconstants
def u64(x):
return x & 0xffffffffffffffff
class Blowfish(object):
P = []
S = []
Key = []
def __init__(self,key):
self.Key = self.make64(key)
self.initializeArrays()
def make64(self,plaintext):
rem = len(plaintext) % 4
if... | 27.79558 | 106 | 0.458358 |
3367a881529bd83444d8fdd35f3c472927de5a01 | 3,354 | py | Python | Lang/Python/py_base/13_str.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | 5 | 2018-03-09T13:51:11.000Z | 2021-12-17T02:05:59.000Z | Lang/Python/py_base/13_str.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null | Lang/Python/py_base/13_str.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null | # 本文件中的示例都是str相关的操作
# 而对于bytes,很多Method都是类似的,用的时候可以类比,因此不再单独列出
#
def default():
# ---------------------------------------------------------------------------------
ss = 'str_test ->> hello world! I am July Baker! this is a great idea!\
1... 2... 3... ok! (^.^)好的'
print(len(ss))
# ---------------... | 20.9625 | 87 | 0.414132 |
c7502e0fa062cf3dc8a6b2a68a93a037e6e2d8ac | 874 | py | Python | sabermetrics/pitching.py | belgrades/sabermetrics | 1d8d980a269e643aac645e6432c0b16714f8e86e | [
"Apache-2.0"
] | 7 | 2016-09-27T20:47:47.000Z | 2020-08-15T18:18:06.000Z | sabermetrics/pitching.py | belgrades/sabermetrics | 1d8d980a269e643aac645e6432c0b16714f8e86e | [
"Apache-2.0"
] | null | null | null | sabermetrics/pitching.py | belgrades/sabermetrics | 1d8d980a269e643aac645e6432c0b16714f8e86e | [
"Apache-2.0"
] | null | null | null | """
.. module:: pitching
:platform: Unix, Windows
:synopsis: Pitching module for sabermetrics package containing some functions related to pitching only.
.. moduleauthor:: Fernando Crema <fcremaldc@gmail.com>
"""
def era(er, outs):
r"""Represents the number of earned runs a pitcher allows per nine innings ... | 27.3125 | 118 | 0.657895 |
3188cd98434d8325537fe660f15fff1b9617882d | 2,238 | py | Python | drivers/migrations/0001_initial.py | CaveBushman/carssoft | dee50e3dee8a22272a601e31f62afef95e951a8c | [
"MIT"
] | null | null | null | drivers/migrations/0001_initial.py | CaveBushman/carssoft | dee50e3dee8a22272a601e31f62afef95e951a8c | [
"MIT"
] | null | null | null | drivers/migrations/0001_initial.py | CaveBushman/carssoft | dee50e3dee8a22272a601e31f62afef95e951a8c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-28 14:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Address',
fields=[
... | 45.673469 | 126 | 0.597408 |
b1cf07e8a27b634f83ed8cc0aefc80b2f07b7f28 | 23,140 | py | Python | .venv/lib/python3.8/site-packages/numpy/polynomial/polyutils.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | .venv/lib/python3.8/site-packages/numpy/polynomial/polyutils.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | bot/lib/python3.7/site-packages/numpy/polynomial/polyutils.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """
Utility classes and functions for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
.. autosummary::
:toctree: generated/
PolyError base class for... | 29.033877 | 96 | 0.574287 |
42c9420896ebd7eb19fbd0c9cc217cc9f03060b2 | 1,686 | py | Python | admin/lib/__init__.py | thepatrick/smtp2web | 15ee20199134ce1edc97aa9094a7005ec0230dad | [
"Apache-2.0"
] | 1 | 2015-03-12T10:42:11.000Z | 2015-03-12T10:42:11.000Z | admin/lib/__init__.py | thepatrick/smtp2web | 15ee20199134ce1edc97aa9094a7005ec0230dad | [
"Apache-2.0"
] | null | null | null | admin/lib/__init__.py | thepatrick/smtp2web | 15ee20199134ce1edc97aa9094a7005ec0230dad | [
"Apache-2.0"
] | null | null | null | # Copyright 2008 arachnid AT notdot.net,
# 2010 Patrick Quinn-Graham
#
# 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... | 34.408163 | 79 | 0.716489 |
cfe25caa211e6e1b99c38f64c847336f23131ce2 | 6,816 | py | Python | tensor2tensor/rl/envs/tf_atari_wrappers.py | ankushagarwal/tensor2tensor | 42a788355a209f21bbf5fd52d56d514405e193a3 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/rl/envs/tf_atari_wrappers.py | ankushagarwal/tensor2tensor | 42a788355a209f21bbf5fd52d56d514405e193a3 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/rl/envs/tf_atari_wrappers.py | ankushagarwal/tensor2tensor | 42a788355a209f21bbf5fd52d56d514405e193a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 36.063492 | 101 | 0.691608 |
ca2313472e0279c870a7f1bd732a2822f4abf9d1 | 3,934 | py | Python | jesse/services/charts.py | jeremytregunna/jesse | 7e1d47282b7dbc5e44e643466a88b56592028c20 | [
"MIT"
] | null | null | null | jesse/services/charts.py | jeremytregunna/jesse | 7e1d47282b7dbc5e44e643466a88b56592028c20 | [
"MIT"
] | 1 | 2021-06-05T19:59:56.000Z | 2021-06-05T19:59:56.000Z | jesse/services/charts.py | jeremytregunna/jesse | 7e1d47282b7dbc5e44e643466a88b56592028c20 | [
"MIT"
] | null | null | null | import os
from datetime import datetime, timedelta
import arrow
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from pandas.plotting import register_matplotlib_converters
import jesse.helpers as jh
from jesse.config import config
from jesse.routes import router
from jesse.store import stor... | 33.338983 | 93 | 0.601932 |
4710f892495d24d43f0035fad895268ca85df3f2 | 7,796 | py | Python | Gerenciador.py | Suu021/Gerenciador-de-Eventos | 152a20466378a0b4c8f4683b8b1f18e7cb5b30dc | [
"MIT"
] | null | null | null | Gerenciador.py | Suu021/Gerenciador-de-Eventos | 152a20466378a0b4c8f4683b8b1f18e7cb5b30dc | [
"MIT"
] | null | null | null | Gerenciador.py | Suu021/Gerenciador-de-Eventos | 152a20466378a0b4c8f4683b8b1f18e7cb5b30dc | [
"MIT"
] | null | null | null | from json import dump, load
from os.path import isfile
# Função para salvar os dados em um json.
def salvar_dados(nomedojson, file):
with open(nomedojson, "w", encoding="utf-8") as dados:
return dump(file, dados, indent=2, separators=(",", ": "), ensure_ascii=False)
# Função para carregar os dados para ... | 44.295455 | 115 | 0.591714 |
eac4ad403b1fa1247595d825fbe0d2a529a13d27 | 2,093 | py | Python | losses/directional_derivative_loss.py | KingOnTheStar/pytorch-CycleGAN-and-pix2pix | 9016b98d09902975b49a07c394bb0d5066e2aa55 | [
"BSD-3-Clause"
] | null | null | null | losses/directional_derivative_loss.py | KingOnTheStar/pytorch-CycleGAN-and-pix2pix | 9016b98d09902975b49a07c394bb0d5066e2aa55 | [
"BSD-3-Clause"
] | null | null | null | losses/directional_derivative_loss.py | KingOnTheStar/pytorch-CycleGAN-and-pix2pix | 9016b98d09902975b49a07c394bb0d5066e2aa55 | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
import cv2 as cv
class DirectionalDerivativeLoss(nn.Module):
def __init__(self) -> None:
super(DirectionalDerivativeLoss, self).__init__()
def forward(self, img, directional_deri_img):
if img.shape[-3] != 1 or directional_deri_img.shape[-3... | 41.039216 | 114 | 0.586718 |
38a7ab60946741c2d62a98d087d81e2be48a541d | 1,123 | py | Python | main.py | IamRifki/flaired-post-notifier | 77bc06e9095e55af78d64ed813c3ff67c802be5d | [
"Unlicense"
] | 6 | 2020-08-15T05:22:03.000Z | 2021-10-02T15:26:23.000Z | main.py | IamRifki/flaired-post-notifier | 77bc06e9095e55af78d64ed813c3ff67c802be5d | [
"Unlicense"
] | 1 | 2021-07-02T15:12:49.000Z | 2021-07-02T15:15:16.000Z | main.py | IamRifki/flaired-post-notifier | 77bc06e9095e55af78d64ed813c3ff67c802be5d | [
"Unlicense"
] | null | null | null | from notify_run import Notify
from praw import Reddit
import config
reddit = Reddit(
client_id=config.reddit_client_id,
client_secret=config.reddit_client_secret,
user_agent=config.reddit_user_agent,
username=config.reddit_username,
password=config.reddit_password,
)
notify = Notify(endpoint=config... | 28.794872 | 76 | 0.750668 |
87936a67d7dda7db4fb2548edad069fa21d36ece | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | 3ugi/profiles-rest-api | 8131e702ec7d9c1afe8e7fcf2ca3092fd6927945 | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | 3ugi/profiles-rest-api | 8131e702ec7d9c1afe8e7fcf2ca3092fd6927945 | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | 3ugi/profiles-rest-api | 8131e702ec7d9c1afe8e7fcf2ca3092fd6927945 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-10-25 11:38
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
e0c13b759e81d5ede18ac12699c81f13256409ae | 788 | py | Python | profiles_api/migrations/0002_profilefeeditem.py | PythonDjangoJavascript/start-rest-api | f720d4adc8a7a9997b81411091993054c369a490 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | PythonDjangoJavascript/start-rest-api | f720d4adc8a7a9997b81411091993054c369a490 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | PythonDjangoJavascript/start-rest-api | f720d4adc8a7a9997b81411091993054c369a490 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2021-03-15 13:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.52 | 126 | 0.633249 |
23a650948d8f30d40228d78deab3522404903306 | 445 | py | Python | ProblemSolving/ModifiedKaprekarNumbers.py | KunyuHe/Hacker-Rank-Practice | b6ffae26fd5b11e7826b7c8aa4f197399ed3c93e | [
"Apache-2.0"
] | null | null | null | ProblemSolving/ModifiedKaprekarNumbers.py | KunyuHe/Hacker-Rank-Practice | b6ffae26fd5b11e7826b7c8aa4f197399ed3c93e | [
"Apache-2.0"
] | null | null | null | ProblemSolving/ModifiedKaprekarNumbers.py | KunyuHe/Hacker-Rank-Practice | b6ffae26fd5b11e7826b7c8aa4f197399ed3c93e | [
"Apache-2.0"
] | null | null | null | def kaprekarNumbers(p, q):
lst = []
for num in range(p, q+1):
sq = num**2
sq_str = str(sq)
cut = len(sq_str) // 2
try:
left, right = int(sq_str[:cut]), int(sq_str[cut:])
except:
left, right = 0, int(sq_str[cut:])
if left + right == num:
... | 22.25 | 62 | 0.469663 |
58d7149b95b13ea1618d23aec501b15667c69701 | 443 | py | Python | data/scripts/templates/object/tangible/lair/veermok/shared_lair_veermok.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/lair/veermok/shared_lair_veermok.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/lair/veermok/shared_lair_veermok.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/veermok/shared_lair_veermok.iff"
result.attribute_template_id ... | 26.058824 | 73 | 0.722348 |
55e07335f653ddf3903dbf97e24832fc919797f3 | 2,003 | py | Python | tests/garage/envs/wrappers/test_stack_frames_env.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | 1 | 2021-03-02T08:43:20.000Z | 2021-03-02T08:43:20.000Z | tests/garage/envs/wrappers/test_stack_frames_env.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | tests/garage/envs/wrappers/test_stack_frames_env.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | import gym.spaces
import numpy as np
import pytest
from garage.envs.wrappers import StackFrames
from tests.fixtures.envs.dummy import DummyDiscrete2DEnv
class TestStackFrames:
def setup_method(self):
self.n_frames = 4
self.env = DummyDiscrete2DEnv(random=False)
self.env_s = St... | 36.418182 | 79 | 0.627559 |
5144c89754b320795fca47e941d26c0e65313073 | 2,953 | py | Python | tests/testing_seg.py | gregbugaj/TextFuseNet | 94a5e566df94e255339e756693f194b18dac2d51 | [
"MIT"
] | null | null | null | tests/testing_seg.py | gregbugaj/TextFuseNet | 94a5e566df94e255339e756693f194b18dac2d51 | [
"MIT"
] | null | null | null | tests/testing_seg.py | gregbugaj/TextFuseNet | 94a5e566df94e255339e756693f194b18dac2d51 | [
"MIT"
] | null | null | null | import cv2
import torch
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import get_cfg
from detectron2.modeling import build_model
from detectron2.modeling.backbone import build_backbone
from detectron2.modeling.proposal_generator.build import build_proposal_generator
from detectron2.str... | 37.379747 | 100 | 0.709109 |
5b6b2e3c0236f9d31c67be245b6f5efd7aa80aed | 302 | py | Python | scripts/strip_markdown_links.py | xanarin/dotfiles | 46cfb33a3eaa73f97383f5795033d580644ac2f4 | [
"MIT"
] | null | null | null | scripts/strip_markdown_links.py | xanarin/dotfiles | 46cfb33a3eaa73f97383f5795033d580644ac2f4 | [
"MIT"
] | null | null | null | scripts/strip_markdown_links.py | xanarin/dotfiles | 46cfb33a3eaa73f97383f5795033d580644ac2f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import subprocess
def main():
input_url = sys.argv[1]
if input_url[-1] == ".":
input_url = input_url[:-1]
if input_url[-1] == ")":
input_url = input_url[:-1]
subprocess.call(["mimeo", input_url])
if __name__ == "__main__":
main()
| 20.133333 | 41 | 0.586093 |
b73c84217ea3aab553030018b4af54fd3e7ab5cf | 21,030 | py | Python | ibis/spark/client.py | proxodilka/ibis | cad629e942859238f30ddb1e9bbf36c259c87ac4 | [
"Apache-2.0"
] | 1 | 2021-06-15T07:28:59.000Z | 2021-06-15T07:28:59.000Z | ibis/spark/client.py | dollylipare/ibis | 9d1086d7d29c2d3760c8150d8641ab51799720cd | [
"Apache-2.0"
] | 1 | 2020-10-02T23:51:48.000Z | 2020-10-03T00:54:29.000Z | ibis/spark/client.py | intel-go/ibis | 1943b6065d2ba89c35856b2d9b8399f15af11c01 | [
"Apache-2.0"
] | 1 | 2020-10-01T18:48:01.000Z | 2020-10-01T18:48:01.000Z | import pandas as pd
import pyspark as ps
import regex as re
import toolz
from pkg_resources import parse_version
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.lineage as lin
import ibis.expr.operations as ops
import ibis.expr.schema as sch
import ibis.expr.types as ir
from ibis... | 27.562254 | 79 | 0.581265 |
08bf1c0b0ca8d0505389485fef2d45a44a6a4d55 | 15,126 | py | Python | modules/VTK/wrapping/tests/statismoTests/test_builders.py | skn123/statismo-1 | a380f33cf070d1c4ba624db8b0c6d946d2aecabf | [
"BSD-3-Clause"
] | 14 | 2020-04-28T17:24:01.000Z | 2021-07-20T11:54:59.000Z | modules/VTK/wrapping/tests/statismoTests/test_builders.py | latimagine/statismo | a380f33cf070d1c4ba624db8b0c6d946d2aecabf | [
"BSD-3-Clause"
] | 8 | 2020-01-22T09:05:00.000Z | 2021-06-29T10:10:24.000Z | modules/VTK/wrapping/tests/statismoTests/test_builders.py | latimagine/statismo | a380f33cf070d1c4ba624db8b0c6d946d2aecabf | [
"BSD-3-Clause"
] | 6 | 2020-03-11T19:41:06.000Z | 2021-09-07T12:57:20.000Z | #
# This file is part of the statismo library.
#
# Author: Marcel Luethi (marcel.luethi@unibas.ch)
#
# Copyright (c) 2011 University of Basel
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# ... | 45.697885 | 117 | 0.700978 |
5d1fb07c14315fe693a1f27b394249f142207e90 | 556 | py | Python | myia/models2/person_models.py | victorbrittoferreira/django_test | 37ffbf2e71a25daf7f87748b5ba474fde40f0146 | [
"MIT"
] | null | null | null | myia/models2/person_models.py | victorbrittoferreira/django_test | 37ffbf2e71a25daf7f87748b5ba474fde40f0146 | [
"MIT"
] | null | null | null | myia/models2/person_models.py | victorbrittoferreira/django_test | 37ffbf2e71a25daf7f87748b5ba474fde40f0146 | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models import fields
class Person(models.Model):
class Meta:
verbose_name = "Person"
verbose_name_plural = "People"
ordering = ["id"]
name = models.CharField(max_length=255, null=False, blank=False)
phone = models.CharField(max_length=15... | 26.47619 | 85 | 0.694245 |
78a5ca504501390f974fcc21c86da5ee227a518a | 5,403 | py | Python | models/model.py | flekschas/peax-avocado | e95fb2ee3d201472c17f73f8ed30a47ea11fdae8 | [
"Apache-2.0"
] | 1 | 2021-05-27T17:34:52.000Z | 2021-05-27T17:34:52.000Z | models/model.py | flekschas/peax-avocado | e95fb2ee3d201472c17f73f8ed30a47ea11fdae8 | [
"Apache-2.0"
] | null | null | null | models/model.py | flekschas/peax-avocado | e95fb2ee3d201472c17f73f8ed30a47ea11fdae8 | [
"Apache-2.0"
] | null | null | null | from avocado import Avocado
import json
import keras
import math
import numpy as np
import os
NUM_WINDOWS_PER_BATCH = 10000 # Random number, 10000 just seem to work fine on my laptop
RESOLUTION = 25 # Base resolution of the Avocado model
LATENT_DIM = 110 # Number of dimensions of the genome embedding
CHROM_SIZES = { #... | 31.412791 | 98 | 0.608736 |
2c254d84f5b263cebcad273fc5fabb9cfc32c209 | 10,334 | py | Python | qcodes/dataset/sqlite/database.py | pjramsey37/Qcodes | 9feb65baee4576ece1a7b7f38cf1be320d6abcb5 | [
"MIT"
] | null | null | null | qcodes/dataset/sqlite/database.py | pjramsey37/Qcodes | 9feb65baee4576ece1a7b7f38cf1be320d6abcb5 | [
"MIT"
] | null | null | null | qcodes/dataset/sqlite/database.py | pjramsey37/Qcodes | 9feb65baee4576ece1a7b7f38cf1be320d6abcb5 | [
"MIT"
] | null | null | null | """
This module provides means of connecting to a QCoDeS database file and
initialising it. Note that connecting/initialisation take into account
database version and possibly perform database upgrades.
"""
import io
import sqlite3
import sys
from os.path import expanduser, normpath
from typing import Union, Tuple, Opt... | 35.390411 | 127 | 0.67844 |
c70f4acde0df7438f68aa03dc3e82ebe9cd1f371 | 7,529 | py | Python | pymc/sampling_jax.py | anirudhacharya/pymc | eb5177a5bb97a437870727906fc52acf29dc53d2 | [
"Apache-2.0"
] | null | null | null | pymc/sampling_jax.py | anirudhacharya/pymc | eb5177a5bb97a437870727906fc52acf29dc53d2 | [
"Apache-2.0"
] | null | null | null | pymc/sampling_jax.py | anirudhacharya/pymc | eb5177a5bb97a437870727906fc52acf29dc53d2 | [
"Apache-2.0"
] | null | null | null | # pylint: skip-file
import os
import re
import sys
import warnings
from typing import Callable, List
from aesara.graph import optimize_graph
from aesara.tensor import TensorVariable
xla_flags = os.getenv("XLA_FLAGS", "")
xla_flags = re.sub(r"--xla_force_host_platform_device_count=.+\s", "", xla_flags).split()
os.env... | 29.876984 | 100 | 0.671005 |
785d936eaebb73c8c1ae07353a247b282136ca95 | 391 | py | Python | web_app/forms.py | blawok/Named_Entity_Recognition | 5c0293f14215d26d79cfc46d5547a7614db3a132 | [
"MIT"
] | 4 | 2020-06-09T13:24:23.000Z | 2021-03-30T06:52:02.000Z | web_app/forms.py | blawok/Named_Entity_Recognition | 5c0293f14215d26d79cfc46d5547a7614db3a132 | [
"MIT"
] | null | null | null | web_app/forms.py | blawok/Named_Entity_Recognition | 5c0293f14215d26d79cfc46d5547a7614db3a132 | [
"MIT"
] | 1 | 2020-09-14T21:18:59.000Z | 2020-09-14T21:18:59.000Z | from flask_wtf import FlaskForm
from wtforms import TextField, SubmitField
from wtforms.validators import DataRequired
class TextForm(FlaskForm):
"""
class that inherits from FlaskForm
used for getting values from user
"""
sentence_for_ner = TextField("Input sentence: ",
... | 27.928571 | 61 | 0.682864 |
27df47ff9086e91dfe0217d7add330acec1f5e91 | 1,336 | py | Python | test/test_bitbank.py | kamijiseiya/AbidoraKun | 20fc5dc19779b939b150c6a4ac3ac2a601ba48c8 | [
"MIT"
] | 2 | 2018-05-02T23:46:14.000Z | 2018-05-15T02:02:04.000Z | test/test_bitbank.py | kamijiseiya/cash-cow | 20fc5dc19779b939b150c6a4ac3ac2a601ba48c8 | [
"MIT"
] | 58 | 2018-05-01T05:02:18.000Z | 2018-08-03T14:41:29.000Z | test/test_bitbank.py | kamijiseiya/AbidoraKun | 20fc5dc19779b939b150c6a4ac3ac2a601ba48c8 | [
"MIT"
] | null | null | null | """exchanges.pyのテスト"""
import os # パスを操作するモジュール
import sys # パスを読み込むモジュール
sys.path.append(os.path.abspath(os.path.join('..'))) # 自作モジュールのパス指定
import unittest
from app.module.exchangess import bitbank
class TestBitbank(unittest.TestCase):
"""bitbank.pyのテストクラス"""
def test_currency_pair_xrp_jpy(self):
... | 32.585366 | 82 | 0.664671 |
2704472d2653727582ca03dbd5e10ab2f5c150ed | 174 | py | Python | atompack/constants.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | atompack/constants.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | atompack/constants.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | """Common constants used throughout the package."""
import numpy as np
DEG90 = np.pi / 2
"""90 degrees in radians."""
DEG120 = 2 * np.pi / 3
"""120 degrees in radians."""
| 17.4 | 51 | 0.649425 |
67e3181bb5c8f1b3698c09c8a06fb5a36a1e4a17 | 1,011 | py | Python | setup.py | Naim75o/decrypt | ceba3e2ea828c61357509f532dce912f90c060d0 | [
"MIT"
] | 1 | 2022-03-19T08:11:38.000Z | 2022-03-19T08:11:38.000Z | setup.py | Naim75o/decrypt | ceba3e2ea828c61357509f532dce912f90c060d0 | [
"MIT"
] | null | null | null | setup.py | Naim75o/decrypt | ceba3e2ea828c61357509f532dce912f90c060d0 | [
"MIT"
] | 3 | 2022-03-20T05:00:49.000Z | 2022-03-22T06:44:55.000Z | # Jangan Lupa Subscribe Yt Gw yak Bre !!
import os, sys
script_name = 'flame.py'
source_code = open(script_name).read()
path = sys.prefix
bin_path = path + '/bin/' + script_name[:-3]
lib_path = path + '/lib/python2.7/' + script_name
code_bin = '''#!/data/data/com.termux/files/usr/bin/python2
from mardis import main as ... | 29.735294 | 59 | 0.634026 |
821b281408f1c0d9dfafdaedfffa7de03a067a26 | 4,796 | py | Python | tc/cmds.py | keans/tc | f3d5f49ff59f056dbd1960148d3b888c2e530b4f | [
"MIT"
] | null | null | null | tc/cmds.py | keans/tc | f3d5f49ff59f056dbd1960148d3b888c2e530b4f | [
"MIT"
] | null | null | null | tc/cmds.py | keans/tc | f3d5f49ff59f056dbd1960148d3b888c2e530b4f | [
"MIT"
] | null | null | null | import datetime
import collections
import click
from .utils import format_timedelta, format_project, format_project_detail
from .projectmanager import ProjectManager
from .project import Project
def start_project(at, project, tags, description):
"""
start new project and mark it as current
"""
if at... | 24.849741 | 74 | 0.590075 |
8aa632d9286722d6f477a6b13464e4b532fedc83 | 1,646 | py | Python | models/utils/continual_model.py | albertozurli/mammoth | 849234afe084b4f707de5300e953a2a8c104ea36 | [
"MIT"
] | null | null | null | models/utils/continual_model.py | albertozurli/mammoth | 849234afe084b4f707de5300e953a2a8c104ea36 | [
"MIT"
] | null | null | null | models/utils/continual_model.py | albertozurli/mammoth | 849234afe084b4f707de5300e953a2a8c104ea36 | [
"MIT"
] | null | null | null | # Copyright 2020-present, Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, Simone Calderara.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch.nn as nn
from torch.optim import SGD
import torch
impor... | 32.27451 | 107 | 0.654921 |
6ee57019fd07456769cf8b58142eb8e0c1a664f7 | 1,296 | py | Python | src/prisma/binaries/constants.py | matyasrichter/prisma-client-py | 1b320ba32ff8c70c7481396e2ecf5a3fcbf4b5c7 | [
"Apache-2.0"
] | null | null | null | src/prisma/binaries/constants.py | matyasrichter/prisma-client-py | 1b320ba32ff8c70c7481396e2ecf5a3fcbf4b5c7 | [
"Apache-2.0"
] | 8 | 2022-03-03T02:26:41.000Z | 2022-03-30T12:39:20.000Z | src/prisma/binaries/constants.py | matyasrichter/prisma-client-py | 1b320ba32ff8c70c7481396e2ecf5a3fcbf4b5c7 | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
from pathlib import Path
from . import platform
__all__ = (
'PRISMA_URL',
'PRISMA_VERSION',
'ENGINE_URL',
'ENGINE_VERSION',
'GLOBAL_TEMP_DIR',
'PRISMA_CLI_NAME',
)
# TODO: if this version changes but the engine version
# doesn't change then the CLI is incorre... | 24 | 92 | 0.707562 |
31846cc6f92024db69649efadd909bfe5ff667a8 | 3,353 | py | Python | packages/snet_cli/snet_cli/_vendor/ledgerblue/runScript.py | keshrisohit/snet-cli | ab892845fc0f84f700b8638242148aec1eb9cfa2 | [
"MIT"
] | null | null | null | packages/snet_cli/snet_cli/_vendor/ledgerblue/runScript.py | keshrisohit/snet-cli | ab892845fc0f84f700b8638242148aec1eb9cfa2 | [
"MIT"
] | 1 | 2019-04-12T19:07:31.000Z | 2019-04-12T19:07:31.000Z | packages/snet_cli/snet_cli/_vendor/ledgerblue/runScript.py | keshrisohit/snet-cli | ab892845fc0f84f700b8638242148aec1eb9cfa2 | [
"MIT"
] | null | null | null | """
*******************************************************************************
* Ledger Blue
* (c) 2016 Ledger
*
* 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.... | 33.868687 | 117 | 0.691321 |
fd73413c66b89c77140491dbd2181dcfe77b1804 | 2,430 | py | Python | draw_DD.py | SmartDataLab/kmv-model | a485c0d77cd2bda775545f14f131d474edbe1b95 | [
"Apache-2.0"
] | null | null | null | draw_DD.py | SmartDataLab/kmv-model | a485c0d77cd2bda775545f14f131d474edbe1b95 | [
"Apache-2.0"
] | null | null | null | draw_DD.py | SmartDataLab/kmv-model | a485c0d77cd2bda775545f14f131d474edbe1b95 | [
"Apache-2.0"
] | null | null | null | from my_kmv import get_final_res_from_code
import matplotlib.pyplot as plt
import pickle as pk
mode = "v2"
code = "601398.SH"
midx = pk.load(open("data/midx.pk","rb"))
midy = pk.load(open("data/midy.pk","rb"))
import random
#a = np.polyfit(samplex, sampley, 3)
#b = np.poly1d(a)
def b(dd,midx,midy):
epsilon = ran... | 30.375 | 94 | 0.571605 |
83546676c251eb4ea35a19a0da2f1ae8caebfbc5 | 1,166 | py | Python | tools/lib.py | infant-cognition-tampere/saccade-prototypes | 684a3eafcffdf0ee2aff9d283e9973de5e56d75d | [
"MIT"
] | null | null | null | tools/lib.py | infant-cognition-tampere/saccade-prototypes | 684a3eafcffdf0ee2aff9d283e9973de5e56d75d | [
"MIT"
] | null | null | null | tools/lib.py | infant-cognition-tampere/saccade-prototypes | 684a3eafcffdf0ee2aff9d283e9973de5e56d75d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Helper functions
'''
def get_value_or_none(value):
value = float(value)
if value == -1.0:
return None
return value
def gazepoint_to_icl_pointlist_v1(gp):
x = get_value_or_none(gp['comb_x'])
y = get_value_or_none(gp['comb_y'])
return [x, y]
def gazepoint_to_... | 29.15 | 74 | 0.669811 |
47428c53026738cdffe2910ef0a79a6338d3f2e5 | 4,421 | py | Python | coworker/events/models.py | upstar77/spacemap | 1babcecabc42b325dc647294599c309d6bda1ad5 | [
"MIT"
] | null | null | null | coworker/events/models.py | upstar77/spacemap | 1babcecabc42b325dc647294599c309d6bda1ad5 | [
"MIT"
] | null | null | null | coworker/events/models.py | upstar77/spacemap | 1babcecabc42b325dc647294599c309d6bda1ad5 | [
"MIT"
] | null | null | null | from datetime import datetime
from django.urls import reverse
from django_prices.forms import PriceField
from location_field.models.spatial import LocationField
from pytz import timezone
from django.db import models
from django.conf import settings
from django.db.models.query import QuerySet
from django.utils.transl... | 30.280822 | 97 | 0.692603 |
70574fae4d87fe13ea606ca1d12ce5e54820ae7c | 9,116 | py | Python | on_box_config_copy.py | DimitriCapetz/on_box_config_copy | 39739503efc4d7714bd11872b8ebe2e149beda9d | [
"OLDAP-2.4"
] | null | null | null | on_box_config_copy.py | DimitriCapetz/on_box_config_copy | 39739503efc4d7714bd11872b8ebe2e149beda9d | [
"OLDAP-2.4"
] | null | null | null | on_box_config_copy.py | DimitriCapetz/on_box_config_copy | 39739503efc4d7714bd11872b8ebe2e149beda9d | [
"OLDAP-2.4"
] | null | null | null | #!/usr/bin/python
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaim... | 43.826923 | 131 | 0.677819 |
e71e96808970672b4b29642f169d834a320ed2c9 | 1,691 | py | Python | dealerships/manufacturers/ford/download_data.py | simon-wenmouth/dealerships | dc817ef13a09ae116818482b5b14310b88a1949b | [
"MIT"
] | 4 | 2015-06-05T15:43:42.000Z | 2020-01-16T09:03:41.000Z | dealerships/manufacturers/ford/download_data.py | simon-wenmouth/dealerships | dc817ef13a09ae116818482b5b14310b88a1949b | [
"MIT"
] | null | null | null | dealerships/manufacturers/ford/download_data.py | simon-wenmouth/dealerships | dc817ef13a09ae116818482b5b14310b88a1949b | [
"MIT"
] | 2 | 2020-01-16T09:04:07.000Z | 2021-12-02T00:07:14.000Z | #!/usr/bin/env python3
import os
import glob
import json
import errno
import requests
from zip_code_radius import solver
# create data directory (when missing)
directory_name=os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'data', 'ford'))
try:
os.makedirs(directory_name)
except OSErr... | 27.721311 | 115 | 0.659965 |
5ac593863a5ebf7b004c59353be97ac9eb27870a | 6,336 | py | Python | activity/activity_EmailDigest.py | elifesciences/elife-bot | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | [
"MIT"
] | 17 | 2015-02-10T07:10:29.000Z | 2021-05-14T22:24:45.000Z | activity/activity_EmailDigest.py | elifesciences/elife-bot | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | [
"MIT"
] | 459 | 2015-03-31T18:24:23.000Z | 2022-03-30T19:44:40.000Z | activity/activity_EmailDigest.py | elifesciences/elife-bot | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | [
"MIT"
] | 9 | 2015-04-18T16:57:31.000Z | 2020-10-30T11:49:13.000Z | import os
import json
import time
from digestparser import output
import digestparser.utils as digest_utils
from S3utility.s3_notification_info import parse_activity_data
from provider import digest_provider, download_helper, email_provider, utils
from activity.objects import Activity
class activity_EmailDigest(Activ... | 35.79661 | 88 | 0.65483 |
e55ff9b4126b0f0e6ee211583054f35a876ace28 | 230 | py | Python | support/__init__.py | Stonedestroyer/SinbadCogs | b5f8ac3fbcc739b747ee3bf37c0aced4fb85b176 | [
"MIT"
] | null | null | null | support/__init__.py | Stonedestroyer/SinbadCogs | b5f8ac3fbcc739b747ee3bf37c0aced4fb85b176 | [
"MIT"
] | null | null | null | support/__init__.py | Stonedestroyer/SinbadCogs | b5f8ac3fbcc739b747ee3bf37c0aced4fb85b176 | [
"MIT"
] | 1 | 2020-02-29T10:57:21.000Z | 2020-02-29T10:57:21.000Z | from __future__ import annotations
from redbot.core.bot import Red
from .core import Support
def setup(bot: Red):
if bot.user.id == 275047522026913793:
cog = Support(bot)
bot.add_cog(cog)
cog.init()
| 19.166667 | 41 | 0.669565 |
c80e26e8cd3bf532777a14e3901bc64e9d1a84cf | 16,557 | py | Python | scripts/elasticsearchloader/es_import_yaml.py | redpanda-cat/montage | a3a635da534ab78c481f984e305108c7dbeef89d | [
"MIT"
] | 3 | 2018-04-03T18:30:21.000Z | 2019-11-14T17:42:47.000Z | scripts/elasticsearchloader/es_import_yaml.py | redpanda-cat/montage | a3a635da534ab78c481f984e305108c7dbeef89d | [
"MIT"
] | 2 | 2021-07-02T18:35:29.000Z | 2021-08-09T20:43:16.000Z | scripts/elasticsearchloader/es_import_yaml.py | redpanda-cat/montage | a3a635da534ab78c481f984e305108c7dbeef89d | [
"MIT"
] | 3 | 2018-04-03T18:45:28.000Z | 2021-04-27T18:08:33.000Z | '''
Created on October 2014
@author: dmachev
'''
from __future__ import division
import logging
import argparse
import sys
import importlib
import yaml
import os
import re
import time
import copy
import traceback
from datetime import datetime
from prettytable import PrettyTable
from functools import reduce
from yaml... | 30.832402 | 93 | 0.568219 |
b1a407bab54b59aaf2dbeeff5382260539c1da58 | 10,560 | py | Python | mmdet/models/detectors/lvis_mask_rcnn.py | apulis/lvis | b7bc8e089d7e3fd1c4f8c8af0ade06f80c081275 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/lvis_mask_rcnn.py | apulis/lvis | b7bc8e089d7e3fd1c4f8c8af0ade06f80c081275 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/lvis_mask_rcnn.py | apulis/lvis | b7bc8e089d7e3fd1c4f8c8af0ade06f80c081275 | [
"Apache-2.0"
] | null | null | null | import mmcv
import numpy as np
import torch
import torch.nn as nn
from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from .. import builder
from ..registry import DETECTORS
from .base import BaseDetector
from .test_mixins import BBoxTestMixin, MaskTestMixin, RPNTestMixin
@DETECTO... | 40.152091 | 80 | 0.533902 |
f1bef384cdc1fab118ad54040362f8f405f34bc5 | 1,852 | py | Python | src/pretix/multidomain/models.py | NicsTr/pretix | e6d2380d9ed1836cc64a688b2be20d00a8500eab | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-25T00:11:00.000Z | 2020-04-25T00:11:00.000Z | src/pretix/multidomain/models.py | NicsTr/pretix | e6d2380d9ed1836cc64a688b2be20d00a8500eab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/multidomain/models.py | NicsTr/pretix | e6d2380d9ed1836cc64a688b2be20d00a8500eab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from django.core.cache import cache
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_scopes import scopes_disabled
from pretix.base.models import Event, Organizer
class KnownDomain(models.Model):
domainname = models.CharField(max_length=255, primary_key=True)
or... | 40.26087 | 117 | 0.678186 |
c66d71823c08c8a40e6ecbf171595160007ed9c4 | 359 | py | Python | 03 - Class Attributes/codesnippets/five_items.py | ThiagoPiovesan/OOP-Python | 02e2ae6efad87524c1a9ce50d7dac6ebfd392d4e | [
"MIT"
] | null | null | null | 03 - Class Attributes/codesnippets/five_items.py | ThiagoPiovesan/OOP-Python | 02e2ae6efad87524c1a9ce50d7dac6ebfd392d4e | [
"MIT"
] | null | null | null | 03 - Class Attributes/codesnippets/five_items.py | ThiagoPiovesan/OOP-Python | 02e2ae6efad87524c1a9ce50d7dac6ebfd392d4e | [
"MIT"
] | null | null | null | #--------------------------------------------------------------------#
# Save notations
# Created by: Jim
# Changed by: Thiago Piovesan
#--------------------------------------------------------------------#
item1 = Item("Phone", 100, 1)
item2 = Item("Laptop", 1000, 3)
item3 = Item("Cable", 10, 5)
item4 = Item("Mouse",... | 32.636364 | 70 | 0.389972 |
ef5804ecde9d82985e5adab5b61c344d36fffbfd | 93 | py | Python | flytekit/sdk/spark_types.py | igorvalko/flytekit | c125cd757c5439b17b185780c69184797db4c9a6 | [
"Apache-2.0"
] | null | null | null | flytekit/sdk/spark_types.py | igorvalko/flytekit | c125cd757c5439b17b185780c69184797db4c9a6 | [
"Apache-2.0"
] | null | null | null | flytekit/sdk/spark_types.py | igorvalko/flytekit | c125cd757c5439b17b185780c69184797db4c9a6 | [
"Apache-2.0"
] | null | null | null | import enum
class SparkType(enum.Enum):
PYTHON = 1
SCALA = 2
JAVA = 3
R = 4 | 11.625 | 27 | 0.55914 |
dd12b16f5bd9a5974d653c43f1fdbdde80c1aa21 | 40 | py | Python | tests/functions/bitor.py | MoonStarCZW/py2rb | 89b247717d33d780fbf143e1583bfe9252984da4 | [
"MIT"
] | 124 | 2017-08-19T05:37:16.000Z | 2022-03-08T18:24:18.000Z | tests/functions/bitor.py | MoonStarCZW/py2rb | 89b247717d33d780fbf143e1583bfe9252984da4 | [
"MIT"
] | 15 | 2017-12-16T05:59:31.000Z | 2022-02-08T02:51:17.000Z | tests/functions/bitor.py | MoonStarCZW/py2rb | 89b247717d33d780fbf143e1583bfe9252984da4 | [
"MIT"
] | 18 | 2017-09-25T11:57:04.000Z | 2022-02-19T17:33:48.000Z |
x = 123215
y = 3423
z = x | y
print(z)
| 6.666667 | 10 | 0.525 |
01c226b4393f02364e0974521a82852e8f97ccfc | 433 | py | Python | chap10_orthogonalization/QR.py | lastone9182/CodingtheMatrix | b0d67e26940e59e51a7e2760b734c7de50490e1a | [
"MIT"
] | 3 | 2018-01-11T07:48:06.000Z | 2020-04-27T20:49:02.000Z | chap10_orthogonalization/QR.py | lastone9182/CodingtheMatrix | b0d67e26940e59e51a7e2760b734c7de50490e1a | [
"MIT"
] | null | null | null | chap10_orthogonalization/QR.py | lastone9182/CodingtheMatrix | b0d67e26940e59e51a7e2760b734c7de50490e1a | [
"MIT"
] | 1 | 2021-01-26T07:25:48.000Z | 2021-01-26T07:25:48.000Z | # Copyright 2013 Philip N. Klein
from orthonormalization import aug_orthonormalize
from dictutil import dict2list, list2dict
from matutil import mat2coldict, coldict2mat
def factor(A):
col_labels = sorted(A.D[1], key=repr)
Acols = dict2list(mat2coldict(A),col_labels)
Qlist, Rlist = aug_orthonormalize(Acols... | 30.928571 | 49 | 0.745958 |
db463c115f10fe01d18f09ab1a65b06c1652abc6 | 399 | py | Python | django_site/wsgi.py | MUST-Quick-Fry/Face-Recognition-Sign-In-System | d1298f6c3d6f7da288fa736f8785d93fe1778703 | [
"MIT"
] | null | null | null | django_site/wsgi.py | MUST-Quick-Fry/Face-Recognition-Sign-In-System | d1298f6c3d6f7da288fa736f8785d93fe1778703 | [
"MIT"
] | null | null | null | django_site/wsgi.py | MUST-Quick-Fry/Face-Recognition-Sign-In-System | d1298f6c3d6f7da288fa736f8785d93fe1778703 | [
"MIT"
] | null | null | null | """
WSGI config for django_site 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.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
1fd3aaddced8682f4e6d925e12d8d3c6e96fc040 | 1,462 | py | Python | src/ScanRateConsideringQueueFeeder.py | wollud1969/modbusmaster | bcc6229bb6119928ac156226f48da7ece0b76343 | [
"MIT"
] | null | null | null | src/ScanRateConsideringQueueFeeder.py | wollud1969/modbusmaster | bcc6229bb6119928ac156226f48da7ece0b76343 | [
"MIT"
] | null | null | null | src/ScanRateConsideringQueueFeeder.py | wollud1969/modbusmaster | bcc6229bb6119928ac156226f48da7ece0b76343 | [
"MIT"
] | null | null | null | import threading
import datetime
from NotificationForwarder import AbstractNotificationReceiver
import logging
class ScanRateConsideringQueueFeeder(threading.Thread, AbstractNotificationReceiver):
def __init__(self, config, registers, queue):
super().__init__()
self.config = config
self.re... | 38.473684 | 103 | 0.602599 |
e92f23928198059e95bae1019676a3e0c6df9217 | 1,805 | py | Python | torch_geometric/datasets/__init__.py | shnhrtkyk/pytorch_geometric | b971fd2ebba10736e6398d6305757be2d81ca681 | [
"MIT"
] | 9 | 2020-03-29T08:18:29.000Z | 2022-01-05T02:36:08.000Z | torch_geometric/datasets/__init__.py | DerronXu/pytorch_geometric | 2ff3fc639b70e9f0fa4f7724d187bbdf7865f048 | [
"MIT"
] | null | null | null | torch_geometric/datasets/__init__.py | DerronXu/pytorch_geometric | 2ff3fc639b70e9f0fa4f7724d187bbdf7865f048 | [
"MIT"
] | 3 | 2020-03-25T19:36:57.000Z | 2022-03-19T07:24:51.000Z | from .karate import KarateClub
from .tu_dataset import TUDataset
from .planetoid import Planetoid
from .citation_full import CitationFull, CoraFull
from .coauthor import Coauthor
from .amazon import Amazon
from .ppi import PPI
from .reddit import Reddit
from .flickr import Flickr
from .yelp import Yelp
from .qm7 import... | 24.066667 | 53 | 0.73795 |
975af38a6e62479980466aac0b64f00ec1ab9fb4 | 656 | py | Python | runs/bro/10KB/src1-tgt1/icmp-par-icmp-iter00500.cfg.py | Largio/broeval | 89e831d07f066100afdd1a5b220f9f08f1c10b3d | [
"MIT"
] | null | null | null | runs/bro/10KB/src1-tgt1/icmp-par-icmp-iter00500.cfg.py | Largio/broeval | 89e831d07f066100afdd1a5b220f9f08f1c10b3d | [
"MIT"
] | null | null | null | runs/bro/10KB/src1-tgt1/icmp-par-icmp-iter00500.cfg.py | Largio/broeval | 89e831d07f066100afdd1a5b220f9f08f1c10b3d | [
"MIT"
] | null | null | null |
# Write results to this file
OUTFILE = 'runs/bro/10KB/src1-tgt1/icmp-par-icmp-iter00500.result.csv'
# Source computers for the request
SOURCE = ['10.0.0.1']
# Target machines for the requests (aka server)
TARGET = ['10.0.0.2']
# IDS Mode. (ATM: noids, min, max, http, ssl, ftp, icmp, mysql)
IDSMODE = 'icmp'
# Conne... | 24.296296 | 70 | 0.702744 |
6c2c282e9f2775f1184e6c1eab6494707436a174 | 87 | py | Python | modules.py | Duk4/Microsoft---Python-for-beginners | 9ed9114e39259ed79f2bbcbdeed70ecb48a777b4 | [
"MIT"
] | null | null | null | modules.py | Duk4/Microsoft---Python-for-beginners | 9ed9114e39259ed79f2bbcbdeed70ecb48a777b4 | [
"MIT"
] | null | null | null | modules.py | Duk4/Microsoft---Python-for-beginners | 9ed9114e39259ed79f2bbcbdeed70ecb48a777b4 | [
"MIT"
] | null | null | null | from helpers import display
display('Sample message')
display('Sample message', True)
| 17.4 | 31 | 0.781609 |
dee86dfdc9902bcb9d9a31db5b9e443ea119267b | 72,760 | py | Python | desktop/core/src/desktop/conf.py | pedro93/hue | 36d69d250e6fff6d257b3167ede2dc749fd982c5 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/conf.py | pedro93/hue | 36d69d250e6fff6d257b3167ede2dc749fd982c5 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/conf.py | pedro93/hue | 36d69d250e6fff6d257b3167ede2dc749fd982c5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
## -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 ... | 34.997595 | 312 | 0.652474 |
903ea2c23189c76a445867da0d7f6d699f7ddcec | 3,876 | py | Python | Assignment1/cs231n/classifiers/softmax.py | minlee077/CS231N_Assignment | 0ef2f0605dd54403801447d1be99932a5f6c7692 | [
"Apache-2.0"
] | null | null | null | Assignment1/cs231n/classifiers/softmax.py | minlee077/CS231N_Assignment | 0ef2f0605dd54403801447d1be99932a5f6c7692 | [
"Apache-2.0"
] | 13 | 2020-03-24T16:52:26.000Z | 2022-03-11T23:42:45.000Z | Assignment1/cs231n/classifiers/softmax.py | minlee077/CS231N_Assignment | 0ef2f0605dd54403801447d1be99932a5f6c7692 | [
"Apache-2.0"
] | 1 | 2019-03-09T09:12:25.000Z | 2019-03-09T09:12:25.000Z | import numpy as np
from random import shuffle
def softmax_loss_naive(W, X, y, reg):
"""
Softmax loss function, naive implementation (with loops)
Inputs have dimension D, there are C classes, and we operate on minibatches
of N examples.
Inputs:
- W: A numpy array of shape (D, C) containing weights.
- X:... | 36.224299 | 89 | 0.49484 |
765e46c09378140a0f605679ac8802d9895ed137 | 88,932 | py | Python | innexia/innexiaBot/modules/feds.py | MikeOwino/curly-garbanzo | 37027800724cb80c4035eac421421a7ceb1062a6 | [
"MIT"
] | null | null | null | innexia/innexiaBot/modules/feds.py | MikeOwino/curly-garbanzo | 37027800724cb80c4035eac421421a7ceb1062a6 | [
"MIT"
] | null | null | null | innexia/innexiaBot/modules/feds.py | MikeOwino/curly-garbanzo | 37027800724cb80c4035eac421421a7ceb1062a6 | [
"MIT"
] | null | null | null | import csv
import json
import os
import re
import time
import uuid
from io import BytesIO
import innexiaBot.modules.sql.feds_sql as sql
from innexiaBot import (
EVENT_LOGS,
LOGGER,
SUPPORT_CHAT,
OWNER_ID,
DRAGONS,
TIGERS,
WOLVES,
dispatcher,
)
from innexiaBot.modules.disable import Disa... | 35.946645 | 172 | 0.557493 |
df9a2bfa599b7d58117cea52799234dc76a14e49 | 15,676 | py | Python | pymatgen/util/convergence.py | nheinsdorf/pymatgen | 7437cc64fc8a850d4820ce5043c896a89bd0019a | [
"MIT"
] | 1 | 2022-03-24T04:12:16.000Z | 2022-03-24T04:12:16.000Z | pymatgen/util/convergence.py | nheinsdorf/pymatgen | 7437cc64fc8a850d4820ce5043c896a89bd0019a | [
"MIT"
] | null | null | null | pymatgen/util/convergence.py | nheinsdorf/pymatgen | 7437cc64fc8a850d4820ce5043c896a89bd0019a | [
"MIT"
] | null | null | null | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.import string
"""
function for calculating the convergence of an x, y data set
main api:
test_conv(xs, ys, name, tol)
tries to fit multiple functions to the x, y data
calculates which function fits best
for tol < 0
returns t... | 26.083195 | 115 | 0.480416 |
c10bdb646519a94f544d28d45c0ee4cf53baa424 | 7,153 | py | Python | jishaku/features/invocation.py | Anay0305/jishaku | 3909930517e65ee29d27f2650575bff709c407bf | [
"MIT"
] | null | null | null | jishaku/features/invocation.py | Anay0305/jishaku | 3909930517e65ee29d27f2650575bff709c407bf | [
"MIT"
] | null | null | null | jishaku/features/invocation.py | Anay0305/jishaku | 3909930517e65ee29d27f2650575bff709c407bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jishaku.features.invocation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The jishaku command invocation related commands.
:copyright: (c) 2021 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import contextlib
import inspect
import io
import pathlib
import re
import time
import typin... | 36.494898 | 126 | 0.624353 |
35613c557429cfdc3bf14d5f5e128b8b244b7578 | 17,511 | py | Python | plugins/modules/oci_identity_tag.py | rishimahajan/oci-ansible-collection | 3a0cfd55347466fcd8ab257d3d7c41d58f5469ab | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_identity_tag.py | rishimahajan/oci-ansible-collection | 3a0cfd55347466fcd8ab257d3d7c41d58f5469ab | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_identity_tag.py | rishimahajan/oci-ansible-collection | 3a0cfd55347466fcd8ab257d3d7c41d58f5469ab | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017, 2020 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 38.401316 | 158 | 0.62081 |
4c647321668b553db8ff17118470ad2b15d55cc4 | 3,375 | py | Python | var/spack/repos/builtin/packages/cbtf/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/cbtf/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/cbtf/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cbtf(CMakePackage):
"""CBTF project contains the base code for CBTF that supports creating... | 34.090909 | 75 | 0.576593 |
ead5956fac99bbc1a13877efc8ab6c29c25793a6 | 632 | py | Python | cent_core/center_loss.py | x6rulin/FaceRec | 9ab125c1267eb6013105a93c3435e098d304b963 | [
"MIT"
] | 2 | 2019-10-23T09:07:39.000Z | 2020-04-02T11:34:38.000Z | cent_core/center_loss.py | x6rulin/FaceRec | 9ab125c1267eb6013105a93c3435e098d304b963 | [
"MIT"
] | null | null | null | cent_core/center_loss.py | x6rulin/FaceRec | 9ab125c1267eb6013105a93c3435e098d304b963 | [
"MIT"
] | null | null | null | import torch
class CenterLoss(torch.nn.Module):
def __init__(self, cls_num, feat_num):
super(CenterLoss, self).__init__()
self.cls_num = cls_num
self.center = torch.nn.Parameter(torch.randn(cls_num, feat_num))
def forward(self, xs, ys):
center_exp = self.center.index_select(... | 35.111111 | 108 | 0.647152 |
6d19466ae17ca8c22ce30494da7405823a27f703 | 6,169 | py | Python | geo_agent/test/dijkstra_test.py | kevjp/openstreetmap-carto | be30cfe8d73f78cb4b5ba9acaaf42a942c70270d | [
"CC0-1.0"
] | null | null | null | geo_agent/test/dijkstra_test.py | kevjp/openstreetmap-carto | be30cfe8d73f78cb4b5ba9acaaf42a942c70270d | [
"CC0-1.0"
] | null | null | null | geo_agent/test/dijkstra_test.py | kevjp/openstreetmap-carto | be30cfe8d73f78cb4b5ba9acaaf42a942c70270d | [
"CC0-1.0"
] | null | null | null | import psycopg2
import numpy as np
import time
import pyproj
import geopy.distance
import math
# Connect to database
conn = psycopg2.connect(dbname = "london_routing", user = "kevinryan", host = "localhost")
curs = conn.cursor()
# snpwberry_close = (51.654277, -0.196017)
# waitrose = (51.655883, -0.203937)
# start ... | 59.893204 | 517 | 0.73999 |
5f7d8e3650799195b7b5cd8bc92ae4ae8badc44b | 1,136 | py | Python | stackstrap/commands/template/add.py | movermeyer/stackstrap | daa942ba83c2f3183628a4dc84e8ea221ff49eb6 | [
"Apache-2.0"
] | 3 | 2015-04-19T09:36:49.000Z | 2017-02-08T23:41:22.000Z | stackstrap/commands/template/add.py | movermeyer/stackstrap | daa942ba83c2f3183628a4dc84e8ea221ff49eb6 | [
"Apache-2.0"
] | 1 | 2021-03-25T21:27:19.000Z | 2021-03-25T21:27:19.000Z | stackstrap/commands/template/add.py | movermeyer/stackstrap | daa942ba83c2f3183628a4dc84e8ea221ff49eb6 | [
"Apache-2.0"
] | 2 | 2015-05-22T08:25:54.000Z | 2018-03-05T00:33:25.000Z | from stackstrap.commands import Command, CommandError
from stackstrap.template import Template
class Add(Command):
"Add a new template"
name = 'add'
def setup_parser(self, parser):
self.parser = parser
self.parser.add_argument(
'name',
metavar='NAME',
t... | 27.047619 | 97 | 0.547535 |
b165f04d767c471f12c3ca21bae8efadd1a1d0da | 1,175 | py | Python | examples/01-web/06-feed.py | kkoch986/pattern | db807c888dcd15f515afe31753c9b0345a11b542 | [
"BSD-3-Clause"
] | 2 | 2015-12-08T15:59:25.000Z | 2016-03-15T20:11:29.000Z | examples/01-web/06-feed.py | kkoch986/pattern | db807c888dcd15f515afe31753c9b0345a11b542 | [
"BSD-3-Clause"
] | null | null | null | examples/01-web/06-feed.py | kkoch986/pattern | db807c888dcd15f515afe31753c9b0345a11b542 | [
"BSD-3-Clause"
] | null | null | null | import os, sys; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Newsfeed, plaintext, URL
from pattern.db import date
# This example reads a given RSS or Atom newsfeed channel.
# Some sample newsfeeds to try out:
NATURE = "http://feeds.nature.com/nature/rss/current"
SCIENCE = "http://www.science... | 37.903226 | 87 | 0.72766 |
7b6cf419d06adc748de8784822efac321c96c8d3 | 47,938 | py | Python | vendor/github.com/openconfig/gnmi/testing/fake/proto/fake_pb2.py | noelbundick/pipeline-gnmi | 81af030d5c26bf2da4ffc07bb861c9670b8de0e0 | [
"Apache-2.0"
] | null | null | null | vendor/github.com/openconfig/gnmi/testing/fake/proto/fake_pb2.py | noelbundick/pipeline-gnmi | 81af030d5c26bf2da4ffc07bb861c9670b8de0e0 | [
"Apache-2.0"
] | null | null | null | vendor/github.com/openconfig/gnmi/testing/fake/proto/fake_pb2.py | noelbundick/pipeline-gnmi | 81af030d5c26bf2da4ffc07bb861c9670b8de0e0 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: testing/fake/proto/fake.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf impo... | 38.879157 | 3,750 | 0.73205 |
70fec686de1e857f304f8d22593684e0cb3d1fc6 | 3,380 | py | Python | google/cloud/securitycenter_v1p1beta1/types/organization_settings.py | Pglinsman/python-securitycenter | 4ba96b268d92eb57b816593b1fb968f269ed188e | [
"Apache-2.0"
] | null | null | null | google/cloud/securitycenter_v1p1beta1/types/organization_settings.py | Pglinsman/python-securitycenter | 4ba96b268d92eb57b816593b1fb968f269ed188e | [
"Apache-2.0"
] | null | null | null | google/cloud/securitycenter_v1p1beta1/types/organization_settings.py | Pglinsman/python-securitycenter | 4ba96b268d92eb57b816593b1fb968f269ed188e | [
"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... | 37.555556 | 109 | 0.67426 |
8fd3200fcc1f00e0f8e8e70b9f923a206b4d53dd | 3,210 | py | Python | configs/hpt-pretrain/chest_xray_kids/linear-eval/linear-eval-base.py | Berkeley-Data/OpenSelfSup | 221191b88d891de57725b149caf237ffef72e529 | [
"Apache-2.0"
] | null | null | null | configs/hpt-pretrain/chest_xray_kids/linear-eval/linear-eval-base.py | Berkeley-Data/OpenSelfSup | 221191b88d891de57725b149caf237ffef72e529 | [
"Apache-2.0"
] | 6 | 2021-03-11T05:35:54.000Z | 2021-04-03T22:25:11.000Z | configs/hpt-pretrain/chest_xray_kids/linear-eval/linear-eval-base.py | Berkeley-Data/OpenSelfSup | 221191b88d891de57725b149caf237ffef72e529 | [
"Apache-2.0"
] | 1 | 2021-07-04T00:47:46.000Z | 2021-07-04T00:47:46.000Z | _base_ = '../../../base.py'
# model settings
model = dict(
type='Classification',
pretrained=None,
with_sobel=False,
backbone=dict(
type='ResNet',
depth=50,
in_channels=3,
out_indices=[4], # 0: conv-1, x: stage-x
norm_cfg=dict(type='BN'),
frozen_stages=4)... | 26.528926 | 94 | 0.64704 |
aafa2e11b26e230db147088b5c6837573f7d99f2 | 4,695 | py | Python | model/loss/loss.py | Shank2358/NPMMR-Det | 414d148ff2ba5edbe870a8dafb6336845fb9ffbb | [
"Apache-2.0"
] | 27 | 2021-01-09T07:35:45.000Z | 2022-02-06T03:18:54.000Z | model/loss/loss.py | Shank2358/NPMMR-Det | 414d148ff2ba5edbe870a8dafb6336845fb9ffbb | [
"Apache-2.0"
] | 4 | 2021-07-20T07:16:03.000Z | 2022-03-29T14:22:59.000Z | model/loss/loss.py | Shank2358/NPMMR-Det | 414d148ff2ba5edbe870a8dafb6336845fb9ffbb | [
"Apache-2.0"
] | 1 | 2021-12-26T09:12:08.000Z | 2021-12-26T09:12:08.000Z | import sys
sys.path.append("../utils")
import torch
import torch.nn as nn
from utils import utils_basic
import config.cfg_npmmrdet_dior as cfg
class FocalLoss(nn.Module):
def __init__(self, gamma=2.0, alpha=1.0, reduction="mean"):
super(FocalLoss, self).__init__()
self.__gamma = gamma
self.... | 48.402062 | 137 | 0.610224 |
b495d9b74bb756755af4822b49629a7e323a9704 | 4,468 | py | Python | app.py | praneet-away/Flood-Monitoring | 0b6eec6549a065280123d631f0e2ea79eb57793a | [
"MIT"
] | 1 | 2021-12-19T04:00:38.000Z | 2021-12-19T04:00:38.000Z | app.py | praneet-away/Flood-Monitoring | 0b6eec6549a065280123d631f0e2ea79eb57793a | [
"MIT"
] | 1 | 2020-12-03T14:10:04.000Z | 2020-12-03T14:10:04.000Z | app.py | praneet-away/Flood-Monitoring | 0b6eec6549a065280123d631f0e2ea79eb57793a | [
"MIT"
] | 2 | 2020-08-15T22:23:36.000Z | 2020-12-16T00:49:06.000Z | """Web app."""
import flask
from flask import Flask, render_template, request, redirect, url_for
import pickle
import base64
from training import prediction
import requests
app = flask.Flask(__name__)
data = [{'name':'Delhi', "sel": "selected"}, {'name':'Mumbai', "sel": ""}, {'name':'Kolkata', "sel": ""}, {'name':'Ba... | 46.061856 | 358 | 0.583259 |
272bd1740f010368edd22695e485b74a6860d188 | 45,636 | py | Python | sqlalchemy/dialects/oracle/base.py | sauloal/PiCastPy | c907a5ba72ccd576b2c7ae78af25abb741327cee | [
"MIT"
] | 5 | 2015-01-18T01:47:56.000Z | 2016-01-30T14:58:58.000Z | sqlalchemy/dialects/oracle/base.py | sauloal/PiCastPy | c907a5ba72ccd576b2c7ae78af25abb741327cee | [
"MIT"
] | null | null | null | sqlalchemy/dialects/oracle/base.py | sauloal/PiCastPy | c907a5ba72ccd576b2c7ae78af25abb741327cee | [
"MIT"
] | null | null | null | # oracle/base.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: oracle
:name: Oracle
Oracle version 8 through current (11g at... | 37.935162 | 111 | 0.60621 |
90c898d9c7d63d8289d2edc01007bff3f9cc279f | 5,296 | py | Python | fastreid/evaluation/rank_cylib/test_cython.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 71 | 2021-03-12T07:43:43.000Z | 2022-03-30T03:28:16.000Z | fastreid/evaluation/rank_cylib/test_cython.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 8 | 2021-04-06T03:02:58.000Z | 2022-02-16T14:05:47.000Z | fastreid/evaluation/rank_cylib/test_cython.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 7 | 2021-04-19T02:55:58.000Z | 2021-11-11T12:39:09.000Z | import sys
import timeit
import numpy as np
import os.path as osp
sys.path.insert(0, osp.dirname(osp.abspath(__file__)) + '/../../..')
from fastreid.evaluation import evaluate_rank
from fastreid.evaluation import evaluate_roc
"""
Test the speed of cython-based evaluation code. The speed improvements
can be much bigg... | 43.768595 | 129 | 0.71469 |
00f620df608a27c217d05b28bfc85f737409a751 | 1,130 | py | Python | retroarch/playlist.py | charlee/retroarch-scripts | cfbc45d77584657448b1608a42c9b1e179015bf9 | [
"MIT"
] | null | null | null | retroarch/playlist.py | charlee/retroarch-scripts | cfbc45d77584657448b1608a42c9b1e179015bf9 | [
"MIT"
] | null | null | null | retroarch/playlist.py | charlee/retroarch-scripts | cfbc45d77584657448b1608a42c9b1e179015bf9 | [
"MIT"
] | null | null | null | import os
import json
from .common import abspath
from .thumbnail import Thumbnail
class Playlist:
def __init__(self, root, name):
self.root = abspath(root)
self.name = name
self.path = os.path.join(self.root, 'playlists', name)
if os.path.exists(self.path):
with open... | 26.904762 | 67 | 0.525664 |
c70a085a8480b0fc0aac22a40c835870b3cdb610 | 7,396 | py | Python | medis/Detector/pipeline.py | RupertDodkins/medis | bdb1f00fb93506da2a1f251bc6780e70e97a16c5 | [
"MIT"
] | 1 | 2021-06-25T17:35:56.000Z | 2021-06-25T17:35:56.000Z | medis/Detector/pipeline.py | RupertDodkins/medis | bdb1f00fb93506da2a1f251bc6780e70e97a16c5 | [
"MIT"
] | null | null | null | medis/Detector/pipeline.py | RupertDodkins/medis | bdb1f00fb93506da2a1f251bc6780e70e97a16c5 | [
"MIT"
] | 2 | 2018-12-08T15:05:13.000Z | 2019-08-08T17:28:24.000Z | from medis.params import mp, ap, cp, tp
# import math
# import MKIDs
# import cPickle
# import medis.Utils.misc as misc
# import temporal as temp
import medis.Utils.misc as misc
from . import spectral as spec
import matplotlib.pyplot as plt
# import proper
import numpy as np
import os
import h5py
from medis.Utils.misc ... | 35.902913 | 121 | 0.590725 |
ddd487a49cca8c65ef420c44da407d64f0a185a3 | 4,656 | py | Python | sigmod2021-LIMA-p32/MLSystems_comparison/pcacv_kdd_tf.py | damslab/reproducibility | f7804b2513859f7e6f14fa7842d81003d0758bf8 | [
"Apache-2.0"
] | 4 | 2021-12-10T17:20:26.000Z | 2021-12-27T14:38:40.000Z | sigmod2021-LIMA-p32/MLSystems_comparison/pcacv_kdd_tf.py | damslab/reproducibility | f7804b2513859f7e6f14fa7842d81003d0758bf8 | [
"Apache-2.0"
] | null | null | null | sigmod2021-LIMA-p32/MLSystems_comparison/pcacv_kdd_tf.py | damslab/reproducibility | f7804b2513859f7e6f14fa7842d81003d0758bf8 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import sys
import numpy as np
import pandas as pd
import math
#tf.get_logger().setLevel('ERROR')
tf.config.threading.set_inter_op_parallelism_threads(1)
def readCSV_X():
inp = "../datasets/KDD_recode_X.csv"
df = pd.read_csv(inp, delimiter=",", header=None)
res = tf.convert_to_tensor(df.va... | 28.919255 | 103 | 0.643041 |
c7c48a39a6a2ac34a16e3d07eb508d5c4417e1b5 | 859 | py | Python | var/spack/repos/builtin/packages/rgb/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/rgb/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/rgb/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Rgb(AutotoolsPackage, XorgPackage):
"""X color name database.
This package in... | 33.038462 | 95 | 0.745052 |
dfad5b9a470a635704fb0caa028fca79f5591e46 | 876 | py | Python | qiskit_ibm_runtime/qiskit/primitives/utils.py | rathishcholarajan/qiskit-ibm-runtime | 315a088a844dc8aa4452bde6136b53694dfb3220 | [
"Apache-2.0"
] | null | null | null | qiskit_ibm_runtime/qiskit/primitives/utils.py | rathishcholarajan/qiskit-ibm-runtime | 315a088a844dc8aa4452bde6136b53694dfb3220 | [
"Apache-2.0"
] | null | null | null | qiskit_ibm_runtime/qiskit/primitives/utils.py | rathishcholarajan/qiskit-ibm-runtime | 315a088a844dc8aa4452bde6136b53694dfb3220 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 31.285714 | 81 | 0.737443 |
faab50d154fd0b7b4018529e111cff7183bdb0f5 | 937 | py | Python | scraper.py | allanliebold/job-scraper | 172370d460dc76cf9229508e86fb1c414d5043e0 | [
"MIT"
] | null | null | null | scraper.py | allanliebold/job-scraper | 172370d460dc76cf9229508e86fb1c414d5043e0 | [
"MIT"
] | null | null | null | scraper.py | allanliebold/job-scraper | 172370d460dc76cf9229508e86fb1c414d5043e0 | [
"MIT"
] | null | null | null | """Python web scraper."""
import requests
import csv
from datetime import datetime
from bs4 import BeautifulSoup
job_page = ['https://stackoverflow.com/jobs']
for i in range(2, 10):
job_page.append('https://stackoverflow.com/jobs?pg=' + str(i))
for url in job_page:
page = requests.get(url)
soup = Beaut... | 22.853659 | 75 | 0.651014 |
dfac4e2e82b042d2aae2282148f6098388859c0f | 2,247 | py | Python | examples/gee_uc1_pol.py | morandiaye/openeo-python-client | cd04715fc4ab1eec2c9b8b187a0f88ff2c710eb8 | [
"Apache-2.0"
] | 1 | 2021-04-01T13:15:35.000Z | 2021-04-01T13:15:35.000Z | examples/gee_uc1_pol.py | morandiaye/openeo-python-client | cd04715fc4ab1eec2c9b8b187a0f88ff2c710eb8 | [
"Apache-2.0"
] | null | null | null | examples/gee_uc1_pol.py | morandiaye/openeo-python-client | cd04715fc4ab1eec2c9b8b187a0f88ff2c710eb8 | [
"Apache-2.0"
] | null | null | null | import openeo
from openeo.internal.graph_building import PGNode
# Connect to backend via basic authentication
con = openeo.connect("https://earthengine.openeo.org/v1.0")
con.authenticate_basic()
datacube = con.load_collection("COPERNICUS/S1_GRD",
spatial_extent={"west": 16.06, "south": ... | 36.241935 | 120 | 0.591455 |
d8e8d2adb7e09fcdff53954d49e03954020d25d2 | 25,693 | py | Python | awswrangler/s3/_write_text.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | null | null | null | awswrangler/s3/_write_text.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | null | null | null | awswrangler/s3/_write_text.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | null | null | null | """Amazon S3 Text Write Module (PRIVATE)."""
import csv
import logging
import uuid
from distutils.version import LooseVersion
from typing import Any, Dict, List, Optional, Tuple, Union
import boto3
import pandas as pd
from pandas.io.common import infer_compression
from awswrangler import _data_types, _utils, catalog... | 40.397799 | 125 | 0.61869 |
12faacb4c0c487d3b85723f1c1048356b4d7b841 | 343 | py | Python | src/stack3d/study/components.py | jmsgrogan/Stack3D | f220a4470d36210447862080971c5b36146a539a | [
"BSD-3-Clause"
] | null | null | null | src/stack3d/study/components.py | jmsgrogan/Stack3D | f220a4470d36210447862080971c5b36146a539a | [
"BSD-3-Clause"
] | null | null | null | src/stack3d/study/components.py | jmsgrogan/Stack3D | f220a4470d36210447862080971c5b36146a539a | [
"BSD-3-Clause"
] | null | null | null | class TimepointData(object):
def __init__(self):
self.raw_data_path = None
class MouseData(object):
def __init__(self):
self.raw_data_path = None
self.extra_path = ""
self.timepoints = []
class StudyData(object):
def __init__(self):
self.raw_data_path = None... | 15.590909 | 33 | 0.606414 |
42136c3433977daa74983fea3bbe3e83293b4092 | 26,349 | py | Python | pandas/tseries/tests/test_daterange.py | springcoil/pandas | 945075ad78cef652039feb50d60092b0580604e6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | pandas/tseries/tests/test_daterange.py | springcoil/pandas | 945075ad78cef652039feb50d60092b0580604e6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | pandas/tseries/tests/test_daterange.py | springcoil/pandas | 945075ad78cef652039feb50d60092b0580604e6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | from datetime import datetime
from pandas.compat import range
import nose
import numpy as np
from pandas.core.index import Index
from pandas.tseries.index import DatetimeIndex
from pandas import Timestamp
from pandas.tseries.offsets import generate_range
from pandas.tseries.index import cdate_range, bdate_range, date... | 35.558704 | 108 | 0.603211 |
d1b781adac42d48147d161cb6d857bba474919db | 927,185 | py | Python | build/releases/release-0.535/ob/lisp.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 26 | 2019-02-01T19:12:21.000Z | 2022-03-25T04:40:38.000Z | build/releases/release-0.535/ob/lisp.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 3 | 2019-10-29T17:49:19.000Z | 2022-03-20T21:21:31.000Z | build/releases/release-0.535/ob/lisp.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 4 | 2019-02-02T16:50:48.000Z | 2020-10-29T03:10:58.000Z | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... | 46.137789 | 787 | 0.648023 |
35cc51eb94aed828521668578c579ce7e3bd292b | 1,148 | py | Python | capybara_tw/gui/QToolTipper.py | capybara-translation/capybara-tw | 5b588b6a29c17f33a94b7fe1a368fc92ad383953 | [
"MIT"
] | null | null | null | capybara_tw/gui/QToolTipper.py | capybara-translation/capybara-tw | 5b588b6a29c17f33a94b7fe1a368fc92ad383953 | [
"MIT"
] | null | null | null | capybara_tw/gui/QToolTipper.py | capybara-translation/capybara-tw | 5b588b6a29c17f33a94b7fe1a368fc92ad383953 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from PyQt5.QtCore import Qt, QEvent, QObject
from PyQt5.QtGui import QFontMetrics
from PyQt5.QtWidgets import QToolTip
class QToolTipper(QObject):
def __init__(self, parent=None):
super().__init__(parent)
def eventFilter(self, obj: QObject, event: QEvent) -> bool:
if ev... | 35.875 | 92 | 0.584495 |
82b86371f463febf9e39c57684e8a45cc7a0a8f3 | 205 | py | Python | setup.py | YusukeSuzuki/castanea | ff9a689dda4037fdebce20829dca453a04c26c64 | [
"MIT"
] | null | null | null | setup.py | YusukeSuzuki/castanea | ff9a689dda4037fdebce20829dca453a04c26c64 | [
"MIT"
] | null | null | null | setup.py | YusukeSuzuki/castanea | ff9a689dda4037fdebce20829dca453a04c26c64 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name = 'castanea',
version = 0.1,
packages = find_packages(),
install_requires = ['tensorflow', 'numpy', 'PyYAML'],
zip_safe=False)
| 20.5 | 57 | 0.658537 |
56bf974334547a4c997dea304c08acf2afbd58eb | 2,812 | py | Python | piecrust/processing/requirejs.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | piecrust/processing/requirejs.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | piecrust/processing/requirejs.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | import os
import os.path
import json
import hashlib
import logging
import platform
import subprocess
from piecrust.processing.base import Processor, PRIORITY_FIRST
from piecrust.processing.tree import FORCE_BUILD
logger = logging.getLogger(__name__)
class RequireJSProcessor(Processor):
PROCESSOR_NAME = 'require... | 31.595506 | 73 | 0.629445 |
d082a3e68b7bde383eb3c747c215e6b6d02eebba | 1,925 | py | Python | machine-learning/blur-faces/blur_faces.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | machine-learning/blur-faces/blur_faces.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | machine-learning/blur-faces/blur_faces.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import sys
# https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt
prototxt_path = "weights/deploy.prototxt.txt"
# https://raw.githubusercontent.com/opencv/opencv_3rdparty/dnn_samples_face_detector_20180205_fp16/res10_300x300_ssd_iter_14000... | 43.75 | 146 | 0.708571 |
ea63e19ccd2560956f3d8fa9db49e0d05a3f12ed | 6,122 | py | Python | dephell/converters/pipfile.py | cclauss/dephell | de792071c51d23b6b85dd3bb9b84ab3092a92a7a | [
"MIT"
] | null | null | null | dephell/converters/pipfile.py | cclauss/dephell | de792071c51d23b6b85dd3bb9b84ab3092a92a7a | [
"MIT"
] | null | null | null | dephell/converters/pipfile.py | cclauss/dephell | de792071c51d23b6b85dd3bb9b84ab3092a92a7a | [
"MIT"
] | null | null | null | # built-in
from collections import OrderedDict
from pathlib import Path
from typing import List, Optional
# external
import tomlkit
from dephell_pythons import Pythons
from dephell_specifier import RangeSpecifier
# app
from ..controllers import DependencyMaker
from ..models import Constraint, Dependency, RootDependen... | 35.593023 | 108 | 0.53953 |
5ee47ebde5af2c49049a8a5e64530542f156dd60 | 608 | py | Python | day07/t05.py | linlicro/python100 | ca7309ce239bb83618351bb1326a9022dc18f145 | [
"MIT"
] | 1 | 2020-02-13T05:49:26.000Z | 2020-02-13T05:49:26.000Z | day07/t05.py | linlicro/python100 | ca7309ce239bb83618351bb1326a9022dc18f145 | [
"MIT"
] | null | null | null | day07/t05.py | linlicro/python100 | ca7309ce239bb83618351bb1326a9022dc18f145 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
使用列表的生成式语法来创建列
version: 0.1
author: icro
"""
import sys
def main():
f = [x for x in range(0, 10)]
print(f)
f = [x + y for x in "ABCDE" for y in "12345"]
print(f)
# 用列表的生成表达式语法创建列表容器
# 用这种语法创建列表之后元素已经准备就绪所以需要耗费较多的内存空间
f = [x ** 2 for x in range(0, 1000)]
print(... | 17.882353 | 49 | 0.600329 |
df688b49dd36979f00aed04d59c30b53c48f62a2 | 5,261 | py | Python | src/utils/gen_coeffs_queue.py | gayashiva/air_model | fb6fb02b866a821ee8a83551be78c25bdb7da7c9 | [
"FTL"
] | 3 | 2021-12-23T18:12:40.000Z | 2022-01-12T10:48:21.000Z | src/utils/gen_coeffs_queue.py | Gayashiva/AIR_model | fb6fb02b866a821ee8a83551be78c25bdb7da7c9 | [
"FTL"
] | 1 | 2022-01-31T15:59:08.000Z | 2022-01-31T15:59:08.000Z | src/utils/gen_coeffs_queue.py | gayashiva/air_model | fb6fb02b866a821ee8a83551be78c25bdb7da7c9 | [
"FTL"
] | null | null | null | import multiprocessing
from time import sleep
import os, sys, time
import logging
import coloredlogs
import xarray as xr
import numpy as np
import math
# Locals
dirname = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
sys.path.append(dirname)
from src.models.icestupaClass import Icestup... | 30.410405 | 99 | 0.569473 |
9952e511fe9b6f36e4cb0cb21d2a21a59f34942d | 9,974 | py | Python | examples/cloudml-energy-price-forecasting/data_preparation/data_prep.py | ZenPylon/professional-services | e579939dabfd135b7ad3c844e0824d4ba06a9793 | [
"Apache-2.0"
] | 14 | 2019-09-22T13:19:22.000Z | 2021-11-04T01:24:02.000Z | examples/cloudml-energy-price-forecasting/data_preparation/data_prep.py | ZenPylon/professional-services | e579939dabfd135b7ad3c844e0824d4ba06a9793 | [
"Apache-2.0"
] | 6 | 2020-01-28T22:42:21.000Z | 2021-10-30T05:50:15.000Z | examples/cloudml-energy-price-forecasting/data_preparation/data_prep.py | ZenPylon/professional-services | e579939dabfd135b7ad3c844e0824d4ba06a9793 | [
"Apache-2.0"
] | 19 | 2019-07-11T17:48:31.000Z | 2021-12-01T15:53:31.000Z | #!/usr/bin/env python
#Copyright 2018 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 or agreed... | 30.783951 | 80 | 0.64628 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.