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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
481d2e56d3d59708527a7af2ed41f3bcb6e417ba | 3,666 | py | Python | homeassistant/components/smarty/fan.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/smarty/fan.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/smarty/fan.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Platform to control a Salda Smarty XP/XV ventilation unit."""
import logging
import math
from homeassistant.components.fan import SUPPORT_SET_SPEED, FanEntity
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.dispatcher import async_dispatche... | 30.04918 | 86 | 0.656028 |
483a516727c72ddf67816bf76eeb678589119d10 | 5,744 | py | Python | Autocorr/autocorr_functions.py | adameshel/spatial_autocorrelation | 06dba506aeff39db4d9f506201e470f0ad2de103 | [
"MIT"
] | null | null | null | Autocorr/autocorr_functions.py | adameshel/spatial_autocorrelation | 06dba506aeff39db4d9f506201e470f0ad2de103 | [
"MIT"
] | null | null | null | Autocorr/autocorr_functions.py | adameshel/spatial_autocorrelation | 06dba506aeff39db4d9f506201e470f0ad2de103 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.integrate import quad, nquad, dblquad
from scipy.stats.stats import tiecorrect, ttest_ind_from_stats
def acf_original_2d(x, alpha, beta, gamma):
return beta * np.exp(-(np.sqrt(x[0]**2 + x[1]**2) / alpha) ** gamma)
d... | 34.812121 | 95 | 0.539519 |
4c7076071553273958a58e7255b6b25dd72eeb1a | 597 | py | Python | feed/migrations/0004_auto_20210329_1507.py | hossn75/PhotoShare-Django-Api | e381d72676b4c61e4487123aba93b400784e296d | [
"Apache-2.0"
] | null | null | null | feed/migrations/0004_auto_20210329_1507.py | hossn75/PhotoShare-Django-Api | e381d72676b4c61e4487123aba93b400784e296d | [
"Apache-2.0"
] | null | null | null | feed/migrations/0004_auto_20210329_1507.py | hossn75/PhotoShare-Django-Api | e381d72676b4c61e4487123aba93b400784e296d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.6 on 2021-03-29 19:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('feed', '0003_auto_202103... | 27.136364 | 135 | 0.676717 |
6880c89287982f1277a04491508d8f37eacc4474 | 5,649 | py | Python | firmware/eppenwolf/runs/phage_experiment_4/phage_subtract.py | 0xDBFB7/covidinator | e9c103e5e62bc128169400998df5f5cd13bd8949 | [
"MIT"
] | null | null | null | firmware/eppenwolf/runs/phage_experiment_4/phage_subtract.py | 0xDBFB7/covidinator | e9c103e5e62bc128169400998df5f5cd13bd8949 | [
"MIT"
] | null | null | null | firmware/eppenwolf/runs/phage_experiment_4/phage_subtract.py | 0xDBFB7/covidinator | e9c103e5e62bc128169400998df5f5cd13bd8949 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from math import pi, sqrt, e, log, isclose, exp
import pickle
import scipy.integrate as integrate
valid_lines = []
with open('phage_run_4_slide_0.csv', "r") as f:
for line in f:
if(line.count(',') == 15):
valid_lines.append(line)
with open('p... | 31.038462 | 139 | 0.681714 |
ccde200815791397ee7f6ea0db751027e0c6d819 | 1,553 | py | Python | examples/adspygoogle/dfp/v201208/get_order.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201208/get_order.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201208/get_order.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 33.042553 | 80 | 0.716677 |
61ec1da9b7e7ab6459d62098209cc907856742f9 | 5,471 | py | Python | python/cuml/dask/common/part_utils.py | Chetank99/cuml | 2f099347e41339adc5a8fd6639dfdc792285f00f | [
"Apache-2.0"
] | null | null | null | python/cuml/dask/common/part_utils.py | Chetank99/cuml | 2f099347e41339adc5a8fd6639dfdc792285f00f | [
"Apache-2.0"
] | null | null | null | python/cuml/dask/common/part_utils.py | Chetank99/cuml | 2f099347e41339adc5a8fd6639dfdc792285f00f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019, 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... | 33.981366 | 79 | 0.667154 |
73fef063b09061b97d9963afcae637d35a809067 | 5,297 | py | Python | lmp/model/_res_lstm.py | france5289/language-model-playground | 02181561107dac13d52e411bc970e245277854d4 | [
"Beerware"
] | 9 | 2020-07-31T10:27:28.000Z | 2021-12-23T05:58:03.000Z | lmp/model/_res_lstm.py | Aidenzich/language-model-playground | daecd4e39bbf8128b04aa236ad1d31cd22c3c1d9 | [
"Beerware"
] | 10 | 2020-07-28T05:32:52.000Z | 2022-03-04T06:36:23.000Z | lmp/model/_res_lstm.py | Aidenzich/language-model-playground | daecd4e39bbf8128b04aa236ad1d31cd22c3c1d9 | [
"Beerware"
] | 20 | 2020-07-08T07:05:39.000Z | 2021-09-22T07:20:46.000Z | r"""LSTM language model with residual connection."""
from typing import ClassVar, Dict, Optional
import torch.nn as nn
from lmp.model._res_rnn import ResRNNBlock, ResRNNModel
from lmp.tknzr._base import BaseTknzr
class ResLSTMBlock(ResRNNBlock):
r"""Residual connected LSTM blocks.
Same architecture as :py... | 32.496933 | 77 | 0.595431 |
826a7107b3562ae6905ff6e326908432ae39ad51 | 2,281 | py | Python | into/into.py | quasiben/odo | a31e09b6d36dd69c081d3842b7dbe5941d40adf0 | [
"BSD-3-Clause"
] | null | null | null | into/into.py | quasiben/odo | a31e09b6d36dd69c081d3842b7dbe5941d40adf0 | [
"BSD-3-Clause"
] | null | null | null | into/into.py | quasiben/odo | a31e09b6d36dd69c081d3842b7dbe5941d40adf0 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
from toolz import merge
from multipledispatch import Dispatcher
from .convert import convert
from .append import append
from .resource import resource
from .utils import ignoring
from datashape import discover, var
from datashape.dispatch import namespac... | 25.920455 | 72 | 0.638317 |
b19ee5b31feaea51b63e7816e23f8ecc7f07991d | 4,488 | py | Python | db/Accept.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | 1 | 2019-11-19T09:08:50.000Z | 2019-11-19T09:08:50.000Z | db/Accept.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | null | null | null | db/Accept.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | null | null | null | import datetime
import random
from .prepare import app, db, model_repr, DEFAULT_TIME, ALL_TAGS, QUESTIONNAIRE_INDEX
from .Answer import random_answers
class Accept(db.Model):
'''
使用的sql语句:
```sql
CREATE TABLE `accepts` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '接受id',
`tag` varcha... | 43.572816 | 113 | 0.621212 |
32930cba49683755c8f49d817ba0d0b680824a17 | 902 | py | Python | main.py | mrrazonj/Sigil-Bot | 99b459e0a9ba013e62208ab1794a9b8a3dc4bee9 | [
"MIT"
] | 1 | 2021-08-07T13:44:21.000Z | 2021-08-07T13:44:21.000Z | main.py | mrrazonj/Sigil-Bot | 99b459e0a9ba013e62208ab1794a9b8a3dc4bee9 | [
"MIT"
] | null | null | null | main.py | mrrazonj/Sigil-Bot | 99b459e0a9ba013e62208ab1794a9b8a3dc4bee9 | [
"MIT"
] | 1 | 2021-08-07T13:37:36.000Z | 2021-08-07T13:37:36.000Z | import discord
from discord.ext import commands, tasks
import asyncio
import os
import BotConf
client = commands.Bot(command_prefix=BotConf.bot_prefix, description=BotConf.bot_description)
@client.event
async def on_ready():
print(f"{client.user} is now online!")
if client.get_guild(BotConf.id_guild):
... | 29.096774 | 93 | 0.717295 |
3c281880c3ab01d8fb44e0dc47c402699b0deb79 | 9,824 | py | Python | maestrowf/interfaces/script/_flux/flux0_18_0.py | gaybro8777/maestrowf | b172457b6d20c01cbfa29dfc691ff20ddaadfe09 | [
"MIT"
] | 90 | 2017-07-10T17:10:35.000Z | 2022-03-06T02:46:51.000Z | maestrowf/interfaces/script/_flux/flux0_18_0.py | gaybro8777/maestrowf | b172457b6d20c01cbfa29dfc691ff20ddaadfe09 | [
"MIT"
] | 253 | 2017-07-12T17:26:22.000Z | 2022-02-24T00:13:56.000Z | maestrowf/interfaces/script/_flux/flux0_18_0.py | gaybro8777/maestrowf | b172457b6d20c01cbfa29dfc691ff20ddaadfe09 | [
"MIT"
] | 36 | 2017-07-10T17:44:56.000Z | 2022-02-21T15:20:39.000Z | import errno
import logging
from math import ceil
import os
from maestrowf.abstracts.enums import CancelCode, JobStatusCode, State, \
SubmissionCode
from maestrowf.abstracts.interfaces.flux import FluxInterface
LOGGER = logging.getLogger(__name__)
try:
from flux import constants as flux_constants
from fl... | 33.875862 | 78 | 0.553237 |
f8b04585c68ed35fef2fe1ddc07b7880f475ae31 | 15,243 | py | Python | python/visualization.py | Juhni/audio-reactive-led-strip | 31afcb22fad834fbe43a23a01ab764f5119d3623 | [
"MIT"
] | null | null | null | python/visualization.py | Juhni/audio-reactive-led-strip | 31afcb22fad834fbe43a23a01ab764f5119d3623 | [
"MIT"
] | null | null | null | python/visualization.py | Juhni/audio-reactive-led-strip | 31afcb22fad834fbe43a23a01ab764f5119d3623 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division
import time
import numpy as np
from scipy.ndimage.filters import gaussian_filter1d
from python import led, microphone, dsp, config
#import ligh_tests
import matplotlib.pyplot as plt
import scipy.fftpack
_time_prev = time.time() * 1000.0
"""The previ... | 34.961009 | 85 | 0.614971 |
7543ac91b44bf87ff1343ebd7acb2f445bdfeaf3 | 840 | py | Python | Week9/785.py | bobsingh149/LeetCode | 293ed4931960bf5b9a3d5c4331ba4dfddccfcd55 | [
"MIT"
] | 101 | 2021-02-26T14:32:37.000Z | 2022-03-16T18:46:37.000Z | Week9/785.py | bobsingh149/LeetCode | 293ed4931960bf5b9a3d5c4331ba4dfddccfcd55 | [
"MIT"
] | null | null | null | Week9/785.py | bobsingh149/LeetCode | 293ed4931960bf5b9a3d5c4331ba4dfddccfcd55 | [
"MIT"
] | 30 | 2021-03-09T05:16:48.000Z | 2022-03-16T21:16:33.000Z | import collections
import queue
class Solution:
def isBipartite(self, graph: List[List[int]]) -> bool:
q=queue.Queue()
visited=[0 for _ in range(len(graph))]
for i in range(len(graph)):
if visited[i]==0:
visited[i]=1
q.put(i)
... | 33.6 | 59 | 0.334524 |
208b730464ab952c05f9bf896c5b3953e36d9865 | 1,076 | py | Python | polls/migrations/0001_initial.py | kevinbowen777/django_polls | 28e9c4afe1877fa004d3243a744f638c2fbfb5fd | [
"MIT"
] | null | null | null | polls/migrations/0001_initial.py | kevinbowen777/django_polls | 28e9c4afe1877fa004d3243a744f638c2fbfb5fd | [
"MIT"
] | 1 | 2022-03-31T19:53:55.000Z | 2022-03-31T19:53:55.000Z | polls/migrations/0001_initial.py | kevinbowen777/django_polls | 28e9c4afe1877fa004d3243a744f638c2fbfb5fd | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-04-18 02:57
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Question",
fields=[
... | 33.625 | 117 | 0.591078 |
a00049c869542a29033853adbf8e2f4970429e6c | 3,119 | py | Python | test/lazy/test_kronecker_product_lazy_tensor.py | rhaps0dy/gpytorch | 278284e23e08340eb648389f205c159c2dd9461c | [
"MIT"
] | 2 | 2021-10-30T03:50:28.000Z | 2022-02-22T22:01:14.000Z | test/lazy/test_kronecker_product_lazy_tensor.py | rhaps0dy/gpytorch | 278284e23e08340eb648389f205c159c2dd9461c | [
"MIT"
] | null | null | null | test/lazy/test_kronecker_product_lazy_tensor.py | rhaps0dy/gpytorch | 278284e23e08340eb648389f205c159c2dd9461c | [
"MIT"
] | 3 | 2020-09-18T18:58:12.000Z | 2021-05-27T15:39:00.000Z | #!/usr/bin/env python3
import unittest
import torch
from gpytorch.lazy import KroneckerProductLazyTensor, NonLazyTensor
from gpytorch.test.lazy_tensor_test_case import LazyTensorTestCase, RectangularLazyTensorTestCase
def kron(a, b):
res = []
for i in range(a.size(-2)):
row_res = []
for j i... | 37.578313 | 119 | 0.662071 |
f700169f42c4405db98ca51444ca7070b1d5d538 | 43,726 | py | Python | looking_for_group/games/api_views.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | looking_for_group/games/api_views.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | looking_for_group/games/api_views.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | import logging
from django.db.models.query_utils import Q
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import no_b... | 34.160938 | 179 | 0.644353 |
c61bab73334726dcaa49a1f6af925be55190d8a0 | 17,461 | py | Python | lib/django/contrib/auth/hashers.py | bretlowery/snakr | eee58a18df2e194b72b5dc07cc5a27856f49593c | [
"BSD-3-Clause"
] | 1 | 2016-11-27T23:31:33.000Z | 2016-11-27T23:31:33.000Z | lib/django/contrib/auth/hashers.py | bretlowery/snakr | eee58a18df2e194b72b5dc07cc5a27856f49593c | [
"BSD-3-Clause"
] | null | null | null | lib/django/contrib/auth/hashers.py | bretlowery/snakr | eee58a18df2e194b72b5dc07cc5a27856f49593c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from d... | 33.708494 | 106 | 0.653399 |
da35544e0e6d32f1e18fce7fcb584831b080feb9 | 826 | py | Python | pypi_packages/adabelief_tf0.2.0/setup.py | wes-chen/Adabelief-Optimizer | 2e4e57cb75e79fe3f72051041b6aec09549b2d85 | [
"BSD-2-Clause"
] | 1,005 | 2020-10-16T02:40:57.000Z | 2022-03-21T19:51:27.000Z | pypi_packages/adabelief_tf0.2.0/setup.py | wes-chen/Adabelief-Optimizer | 2e4e57cb75e79fe3f72051041b6aec09549b2d85 | [
"BSD-2-Clause"
] | 56 | 2020-10-16T16:27:18.000Z | 2022-03-31T18:35:56.000Z | pypi_packages/adabelief_tf0.2.0/setup.py | wes-chen/Adabelief-Optimizer | 2e4e57cb75e79fe3f72051041b6aec09549b2d85 | [
"BSD-2-Clause"
] | 118 | 2020-10-16T06:40:24.000Z | 2022-03-25T05:29:48.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="adabelief_tf",
version="0.2.0",
author="Juntang Zhuang",
author_email="j.zhuang@yale.edu",
description="Tensorflow implementation of AdaBelief Optimizer",
long_description="Tensorflow... | 29.5 | 72 | 0.641646 |
60a17599f73eaab75fbac8f8014b92823f5a3fd2 | 2,754 | py | Python | sermar/migrations/0003_collection.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | null | null | null | sermar/migrations/0003_collection.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | null | null | null | sermar/migrations/0003_collection.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-10-27 20:18
import ckeditor.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('sermar', '0002_locality_roost_id'),
]
operations = [
mi... | 57.375 | 184 | 0.625272 |
b2dfe4e8a7f3995efcb306e9ac54badd58a3d017 | 848 | py | Python | plot.py | lcesquivel10/LauraEsquivel_ejercicio30 | 88e60897452549be66c250652dd6d1daadacba42 | [
"MIT"
] | null | null | null | plot.py | lcesquivel10/LauraEsquivel_ejercicio30 | 88e60897452549be66c250652dd6d1daadacba42 | [
"MIT"
] | null | null | null | plot.py | lcesquivel10/LauraEsquivel_ejercicio30 | 88e60897452549be66c250652dd6d1daadacba42 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation, PillowWriter
NX=100
Dx=1./NX
B=0.05
Vel=1.
Dt=B*Dx/Vel
Tf=0.1
NT=int(Tf/Dt)+1
fig = plt.figure()
ax = plt.axes(xlim=(0, 1), ylim=(-0.05, 0.05))
ax.set_aspect(1./0.1)
plt.xlabel('Posicion[metros]')
plt.ylabel('U')
... | 20.682927 | 102 | 0.660377 |
b2ef7b7fff26c049c0881359c0d262af732a22e1 | 358 | py | Python | ThumkiStores/admin.py | Ashwin-Dev-P/Thumki-Final-Hosting | fcfe40000b688d419513831ece5400cb32caaa69 | [
"MIT"
] | 1 | 2022-01-09T10:23:22.000Z | 2022-01-09T10:23:22.000Z | ThumkiStores/admin.py | Ashwin-Dev-P/dev-stores | fcfe40000b688d419513831ece5400cb32caaa69 | [
"MIT"
] | null | null | null | ThumkiStores/admin.py | Ashwin-Dev-P/dev-stores | fcfe40000b688d419513831ece5400cb32caaa69 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Dress)
admin.site.register(Category)
admin.site.register(Customer_review)
admin.site.register(Messages)
admin.site.register(FAQ)
admin.site.register(Subscription)
admin.site.register(Profile)
admin.site.register(Gen... | 25.571429 | 36 | 0.821229 |
983155b52fe9a3a0e927ea017321c74743151688 | 9,838 | py | Python | manila/db/migrations/alembic/versions/805685098bd2_add_share_network_subnets_table_and_modify_share_servers_table.py | kpawar89/manila | d487c2db728cedf8357b9f4acbc0a45c21c3a83e | [
"Apache-2.0"
] | 159 | 2015-01-02T09:35:15.000Z | 2022-01-04T11:51:34.000Z | manila/db/migrations/alembic/versions/805685098bd2_add_share_network_subnets_table_and_modify_share_servers_table.py | viroel/manila | fbcabd2c03985000bd9b4d4d9a4478bc0b784efa | [
"Apache-2.0"
] | 6 | 2021-02-11T16:09:43.000Z | 2022-03-15T09:56:25.000Z | manila/db/migrations/alembic/versions/805685098bd2_add_share_network_subnets_table_and_modify_share_servers_table.py | viroel/manila | fbcabd2c03985000bd9b4d4d9a4478bc0b784efa | [
"Apache-2.0"
] | 128 | 2015-01-05T22:52:28.000Z | 2021-12-29T14:00:58.000Z | # Copyright 2019 NetApp, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 42.405172 | 79 | 0.656739 |
4fa3706d99d17b3cf2ab3150e10c65b6864616fe | 7,882 | py | Python | diagnostics/spectra.py | wheelerMT/two-component_BEC | 3c7ddee98d2dd49b07705cb343536f8a68006d7f | [
"MIT"
] | 1 | 2020-12-16T00:05:38.000Z | 2020-12-16T00:05:38.000Z | diagnostics/spectra.py | wheelerMT/twoComponent-BEC | 3c7ddee98d2dd49b07705cb343536f8a68006d7f | [
"MIT"
] | null | null | null | diagnostics/spectra.py | wheelerMT/twoComponent-BEC | 3c7ddee98d2dd49b07705cb343536f8a68006d7f | [
"MIT"
] | null | null | null | import h5py
import numpy as np
from tabulate import tabulate
from numpy.fft import fftshift, ifftshift
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('TkAgg')
plt.rcParams.update({'font.size': 13})
def spectral_derivative(array, wvn_x, wvn_y):
return np.fft.ifft2(ifftshift(1j * wvn_x * fftshift... | 37.533333 | 119 | 0.528546 |
96eef3c65102b6c360ed9d0e355c773631a81b18 | 831 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_multiplicado_por_fator.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_multiplicado_por_fator.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_multiplicado_por_fator.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por criar uma nova lista multiplicada por um fator.
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import multiplicado_por_fator
class PainelMul... | 37.772727 | 109 | 0.638989 |
d16002074ee4d3546bf879900f683676f698ef2a | 738 | py | Python | components/quizQuestions.py | Doyeon-k-fanshawe/kim_doyeon_hw3 | 716ae4663da90482768d5b05cc6760209a3b5258 | [
"MIT"
] | null | null | null | components/quizQuestions.py | Doyeon-k-fanshawe/kim_doyeon_hw3 | 716ae4663da90482768d5b05cc6760209a3b5258 | [
"MIT"
] | null | null | null | components/quizQuestions.py | Doyeon-k-fanshawe/kim_doyeon_hw3 | 716ae4663da90482768d5b05cc6760209a3b5258 | [
"MIT"
] | null | null | null | questions = {
"q1" : {
"question": "Has your hero ever had a nationality other than the U.S.? ",
"yes" : 500,
"no" : 0
},
"q2" : {
"question" : "Are your hero a student? ",
"yes" : 200,
"no" : 0
},
"q3" : {
"question" : "Are your hero a super... | 18.923077 | 81 | 0.397019 |
c861dc4de54825339bc4a9dac33fe26fb7b3a7cb | 1,439 | py | Python | PythonCSS/PyCSS/utils.py | Jammin-Coder/py-css | 7817b6dc11fcfcaca3be70db49be5d561af56190 | [
"Apache-2.0"
] | null | null | null | PythonCSS/PyCSS/utils.py | Jammin-Coder/py-css | 7817b6dc11fcfcaca3be70db49be5d561af56190 | [
"Apache-2.0"
] | 1 | 2021-08-03T05:07:24.000Z | 2021-08-03T05:07:24.000Z | PythonCSS/PyCSS/utils.py | Jammin-Coder/py-css | 7817b6dc11fcfcaca3be70db49be5d561af56190 | [
"Apache-2.0"
] | 1 | 2021-08-02T23:49:14.000Z | 2021-08-02T23:49:14.000Z | CSS_HEADER = "/*This CSS file was generated using\n" \
"the PyCSS package written by JamminCoder.*/"
def stringify(lst) -> str:
output = ""
for item in lst:
output += item
return output
def remove_space(string) -> str:
chars = list(string)
len_chars = len(chars)
while len... | 22.484375 | 80 | 0.57262 |
449f3863be0584aa689c3f8ffeae06dedebc3e65 | 2,574 | py | Python | Manage-Retweets/retweet_a_tweet.py | ProbisMis/Twitter-API-v2-sample-code | 76cee7857a0b20ded886336d74fd617b95416cf2 | [
"Apache-2.0"
] | 1,157 | 2020-08-12T17:24:24.000Z | 2022-03-31T00:16:38.000Z | Manage-Retweets/retweet_a_tweet.py | ProbisMis/Twitter-API-v2-sample-code | 76cee7857a0b20ded886336d74fd617b95416cf2 | [
"Apache-2.0"
] | 86 | 2020-08-15T20:52:22.000Z | 2022-03-31T19:36:02.000Z | Manage-Retweets/retweet_a_tweet.py | ProbisMis/Twitter-API-v2-sample-code | 76cee7857a0b20ded886336d74fd617b95416cf2 | [
"Apache-2.0"
] | 552 | 2020-08-14T12:56:17.000Z | 2022-03-31T21:49:24.000Z | from requests_oauthlib import OAuth1Session
import os
import json
# In your terminal please set your environment variables by running the following lines of code.
# export 'CONSUMER_KEY'='<your_consumer_key>'
# export 'CONSUMER_SECRET'='<your_consumer_secret>'
consumer_key = os.environ.get("CONSUMER_KEY")
consumer_se... | 32.582278 | 96 | 0.77467 |
40c5243ef31866386895228356bf5672b92b5c5a | 310 | py | Python | wksp-boto/chapter1/aws_helper.py | ongzhixian/Impulse | 5dbed045159ff049c0fccbd3f0451259b11fde71 | [
"MIT"
] | null | null | null | wksp-boto/chapter1/aws_helper.py | ongzhixian/Impulse | 5dbed045159ff049c0fccbd3f0451259b11fde71 | [
"MIT"
] | 39 | 2020-10-10T01:31:05.000Z | 2020-11-20T22:26:23.000Z | wksp-boto/chapter1/aws_helper.py | ongzhixian/Impulse | 5dbed045159ff049c0fccbd3f0451259b11fde71 | [
"MIT"
] | null | null | null | import json
import logging
import os
def get_aws_credentials():
profile_filepath = os.path.join(
os.environ["USERPROFILE"],
"Documents\PowerShell\wkspboto_dev.json"
)
with open(profile_filepath, "r") as aws_credential_file:
return json.loads(aws_credential_file.read())
| 20.666667 | 60 | 0.703226 |
ecf7d0b8b4b9b47714e0f54b122b9796478e5b5a | 142 | py | Python | estate_app/estate_app/doctype/property/test_property.py | kiranchoudhary123/demo-frappe_app | 8becdf09e2f83e5e3a0c5d317eba4c5ccccf5eeb | [
"MIT"
] | null | null | null | estate_app/estate_app/doctype/property/test_property.py | kiranchoudhary123/demo-frappe_app | 8becdf09e2f83e5e3a0c5d317eba4c5ccccf5eeb | [
"MIT"
] | null | null | null | estate_app/estate_app/doctype/property/test_property.py | kiranchoudhary123/demo-frappe_app | 8becdf09e2f83e5e3a0c5d317eba4c5ccccf5eeb | [
"MIT"
] | null | null | null | # Copyright (c) 2021, kiran and Contributors
# See license.txt
# import frappe
import unittest
class TestProperty(unittest.TestCase):
pass
| 15.777778 | 44 | 0.774648 |
fc5ec839fb3cd9b32f906ca16ad0a7f9e779de75 | 20,570 | py | Python | hybrid_zero_dynamics/py/minitaur_virtual_constraints_legspace_example.py | kinoute/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | 11 | 2020-01-29T07:25:04.000Z | 2022-03-05T16:01:21.000Z | hybrid_zero_dynamics/py/minitaur_virtual_constraints_legspace_example.py | zhangyuezjx/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | 13 | 2020-01-28T22:19:53.000Z | 2022-02-10T00:39:26.000Z | hybrid_zero_dynamics/py/minitaur_virtual_constraints_legspace_example.py | zhangyuezjx/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | 2 | 2020-02-27T11:09:49.000Z | 2021-08-25T07:32:15.000Z | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 32.342767 | 80 | 0.678221 |
7af821c81928e67e0f258bc064d582a4186995c1 | 2,343 | py | Python | tensorflow/python/training/basic_loops.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/training/basic_loops.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/training/basic_loops.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.790323 | 80 | 0.701665 |
bcb0d1f82b809c4ea76726ef439b605801db855e | 3,469 | py | Python | main.py | acemasterjb/blackbart | 534dfe921549fd5529397c424abc8aa2b290b8f5 | [
"MIT"
] | null | null | null | main.py | acemasterjb/blackbart | 534dfe921549fd5529397c424abc8aa2b290b8f5 | [
"MIT"
] | null | null | null | main.py | acemasterjb/blackbart | 534dfe921549fd5529397c424abc8aa2b290b8f5 | [
"MIT"
] | null | null | null | from typing import Optional, AnyStr, Any
import urllib3
import json
import lxml
from lxml import html
from bs4 import BeautifulSoup
import httpx
from fastapi import FastAPI
""" DATA RETRIEVAL
"""
global switch
switch = {
"XCD": "https://www.eccb-centralbank.org/",
"BSD": "https://www.centralbankb... | 31.536364 | 178 | 0.593543 |
b02bf81352778b4eff52f92c9d058708efae07cf | 11,767 | py | Python | examples/research_projects/adversarial/utils_hans.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 50,404 | 2019-09-26T09:55:55.000Z | 2022-03-31T23:07:49.000Z | examples/research_projects/adversarial/utils_hans.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 13,179 | 2019-09-26T10:10:57.000Z | 2022-03-31T23:17:08.000Z | examples/research_projects/adversarial/utils_hans.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 13,337 | 2019-09-26T10:49:38.000Z | 2022-03-31T23:06:17.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... | 34.507331 | 118 | 0.58936 |
37e2fb3f52d657b3977f7eaf402c20c0e217c853 | 1,099 | py | Python | statistics.test.py | clean-code-craft-tcq-2/sense-py-Patiljyoti12 | a5e1dfd461c613f18cead32a4ef01affd03ef0a9 | [
"MIT"
] | null | null | null | statistics.test.py | clean-code-craft-tcq-2/sense-py-Patiljyoti12 | a5e1dfd461c613f18cead32a4ef01affd03ef0a9 | [
"MIT"
] | null | null | null | statistics.test.py | clean-code-craft-tcq-2/sense-py-Patiljyoti12 | a5e1dfd461c613f18cead32a4ef01affd03ef0a9 | [
"MIT"
] | null | null | null | import unittest
import statistics
import math
class StatsTest(unittest.TestCase):
def test_report_min_max_avg(self):
computedStats = statistics.calculateStats([1.5, 8.9, 3.2, 4.5])
epsilon = 0.001
self.assertAlmostEqual(computedStats["avg"], 4.525, delta=epsilon)
self.assertAlmostEqual(computedStats[... | 35.451613 | 80 | 0.737034 |
2d7c178910c2a4eb06e3d9acc3bf591ee8044796 | 8,479 | py | Python | chb/relational/BlockRelationalAnalysis.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/relational/BlockRelationalAnalysis.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/relational/BlockRelationalAnalysis.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021-2022 Aarno Labs, LLC
#
# Permission is hereby granted, free of... | 37.188596 | 90 | 0.526831 |
8fd46f5fad542f1c6e08a998b64650b85b041373 | 4,685 | py | Python | stix2validator/test/network_traffic_tests.py | emmanvg/cti-stix-validator | 0e5e4320d100b1d2a9a5d3f748e1ac6da330c1ea | [
"BSD-3-Clause"
] | null | null | null | stix2validator/test/network_traffic_tests.py | emmanvg/cti-stix-validator | 0e5e4320d100b1d2a9a5d3f748e1ac6da330c1ea | [
"BSD-3-Clause"
] | null | null | null | stix2validator/test/network_traffic_tests.py | emmanvg/cti-stix-validator | 0e5e4320d100b1d2a9a5d3f748e1ac6da330c1ea | [
"BSD-3-Clause"
] | null | null | null | import copy
import json
import unittest
from . import ValidatorTest
from .. import validate_string
VALID_NETWORK_TRAFFIC_DEFINITION = """
{
"type": "observed-data",
"id": "observed-data--b67d30ff-02ac-498a-92f9-32f845f448cf",
"created_by_ref": "identity--f431f809-377b-45e0-aa1c-6a4751cae5ff",
"created": "201... | 32.762238 | 80 | 0.616009 |
94ca63a2316473f55a34d810b1a3f89c82fa0800 | 300 | py | Python | src/dataclay/util/management/metadataservice/RegistrationInfo.py | bsc-dom/pyclay | abb392c39f2c5991d890acd9a034c2d5c50cc0e4 | [
"BSD-3-Clause"
] | 1 | 2020-04-16T17:09:15.000Z | 2020-04-16T17:09:15.000Z | src/dataclay/util/management/metadataservice/RegistrationInfo.py | bsc-dom/pyclay | abb392c39f2c5991d890acd9a034c2d5c50cc0e4 | [
"BSD-3-Clause"
] | 35 | 2019-11-06T17:06:16.000Z | 2021-04-12T16:27:20.000Z | src/dataclay/util/management/metadataservice/RegistrationInfo.py | bsc-dom/pyclay | abb392c39f2c5991d890acd9a034c2d5c50cc0e4 | [
"BSD-3-Clause"
] | 1 | 2020-05-06T11:28:16.000Z | 2020-05-06T11:28:16.000Z | class RegistrationInfo(object):
def __init__(self, object_id, class_id, store_session_id, dataset_id, alias):
self.object_id = object_id
self.class_id = class_id
self.store_session_id = store_session_id
self.dataset_id = dataset_id
self.alias = alias
| 23.076923 | 81 | 0.686667 |
5ee1faa75c31fbd2a6c87a13c2678a28c69b746d | 5,725 | py | Python | flaat/config.py | marcvs/flat | 44b4c7c0cdc077014ae8c4741d600aa6a3b84039 | [
"MIT"
] | 1 | 2018-07-18T15:35:10.000Z | 2018-07-18T15:35:10.000Z | flaat/config.py | marcvs/flask-oidc-deep | 44b4c7c0cdc077014ae8c4741d600aa6a3b84039 | [
"MIT"
] | null | null | null | flaat/config.py | marcvs/flask-oidc-deep | 44b4c7c0cdc077014ae8c4741d600aa6a3b84039 | [
"MIT"
] | null | null | null | import logging
from dataclasses import dataclass
from typing import List, Union
from flaat.requirements import REQUIREMENT, HasSubIss, Satisfied, Unsatisfiable
logger = logging.getLogger(__name__)
LOG_LEVEL_OVERRIDES = {
"requests_cache": logging.WARN,
"urllib3": logging.WARN,
"asyncio": logging.WARN,
}
... | 34.077381 | 141 | 0.657467 |
b535dd6b338a8cca1d95fb00cd4221296a8c9984 | 9,341 | py | Python | backend/orcinus/modules/sendletter.py | jiwonMe/rokn-letter | c91442f0174ff1e1efba568483d9d9def9423309 | [
"MIT"
] | 1 | 2022-01-18T03:13:20.000Z | 2022-01-18T03:13:20.000Z | backend/orcinus/modules/sendletter.py | jiwonMe/rokn-letter | c91442f0174ff1e1efba568483d9d9def9423309 | [
"MIT"
] | 4 | 2021-06-13T14:54:41.000Z | 2021-06-14T14:25:33.000Z | backend/orcinus/modules/sendletter.py | jiwonMe/rokn-letter | c91442f0174ff1e1efba568483d9d9def9423309 | [
"MIT"
] | null | null | null | import requests
import os
import base64
from bs4 import BeautifulSoup as bs
from dotenv import load_dotenv
from io import BytesIO
from PIL import Image
from urllib3.exceptions import InsecureRequestWarning
# edunavy.mil.kr에서 ssl에러 띄우는 것 방지
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
c... | 34.985019 | 744 | 0.557007 |
f1701704f76763c35e97ec8b286de46dbd8b7e96 | 1,804 | py | Python | faasmcli/faasmcli/util/state.py | J-Heinemann/faasm | 6a7472d73ef7cc18e63617c72715c8775afd11a9 | [
"Apache-2.0"
] | 1 | 2021-03-03T09:54:21.000Z | 2021-03-03T09:54:21.000Z | faasmcli/faasmcli/util/state.py | J-Heinemann/faasm | 6a7472d73ef7cc18e63617c72715c8775afd11a9 | [
"Apache-2.0"
] | null | null | null | faasmcli/faasmcli/util/state.py | J-Heinemann/faasm | 6a7472d73ef7cc18e63617c72715c8775afd11a9 | [
"Apache-2.0"
] | null | null | null | from os.path import join, basename
from faasmcli.util.download import get_file
from faasmcli.util.upload_util import upload_file_to_s3, curl_file
_SPARSE_MATRIX_PARTS = ["vals", "innr", "outr", "size", "nonz"]
def upload_sparse_matrix(user, key, directory, host=None, s3_bucket=None):
assert host or s3_bucket, "... | 30.066667 | 79 | 0.632483 |
2d766829711845de41b5c8d90779f5f90cb15efb | 2,710 | py | Python | hphp/tools/gdb/lookup.py | OrochiProject/hhvm-verifier | 4bba454dce32d5bceb12d4ca8c9f1fa5df2024c5 | [
"PHP-3.01",
"Zend-2.0"
] | 1 | 2015-02-12T07:24:28.000Z | 2015-02-12T07:24:28.000Z | hphp/tools/gdb/lookup.py | OrochiProject/hhvm-verifier | 4bba454dce32d5bceb12d4ca8c9f1fa5df2024c5 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | hphp/tools/gdb/lookup.py | OrochiProject/hhvm-verifier | 4bba454dce32d5bceb12d4ca8c9f1fa5df2024c5 | [
"PHP-3.01",
"Zend-2.0"
] | 1 | 2015-06-16T05:47:12.000Z | 2015-06-16T05:47:12.000Z | """
GDB commands for various HHVM ID lookups.
"""
# @lint-avoid-python-3-compatibility-imports
# @lint-avoid-pyflakes3
# @lint-avoid-pyflakes2
import gdb
import idx
import unit
from gdbutils import *
#------------------------------------------------------------------------------
# `lookup' command.
class LookupComm... | 25.327103 | 79 | 0.549446 |
29f9b54dfbd39fb0c5663e5a3960e483b96169b5 | 9,636 | py | Python | league.py | nathanbraun/fantasy-developer-kit | 141e95c9e346e5b5a077d81f10e5942022e899e6 | [
"Xnet",
"X11"
] | 6 | 2021-09-10T22:34:47.000Z | 2021-11-22T05:04:05.000Z | league.py | nathanbraun/fantasy-developer-kit | 141e95c9e346e5b5a077d81f10e5942022e899e6 | [
"Xnet",
"X11"
] | null | null | null | league.py | nathanbraun/fantasy-developer-kit | 141e95c9e346e5b5a077d81f10e5942022e899e6 | [
"Xnet",
"X11"
] | 3 | 2021-09-09T20:09:54.000Z | 2021-09-16T23:30:29.000Z | import hosts.fleaflicker as site
import hosts.db as db
import sqlite3
import pandas as pd
from os import path
from pathlib import Path
import seaborn as sns
from textwrap import dedent
from pandas import DataFrame
from utilities import (get_sims, generate_token, LICENSE_KEY, DB_PATH,
OUTPUT_PATH,... | 34.414286 | 97 | 0.584994 |
0d9ca2822a0830fa9a569bf41962710ce146a70d | 318 | py | Python | analysis/__init__.py | Yooke/django-analysis | 654685bca5750f10d6a14992a9cafe75981e3856 | [
"BSD-3-Clause"
] | null | null | null | analysis/__init__.py | Yooke/django-analysis | 654685bca5750f10d6a14992a9cafe75981e3856 | [
"BSD-3-Clause"
] | null | null | null | analysis/__init__.py | Yooke/django-analysis | 654685bca5750f10d6a14992a9cafe75981e3856 | [
"BSD-3-Clause"
] | null | null | null | import os
from django.conf import settings
db_path = os.path.join(os.path.dirname(__file__), 'analysis.db')
settings.DATABASES['analysis_sqlite3'] = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': db_path
}
if not os.path.exists(db_path):
print('do init db')
from .db import init_db
init_db()
| 21.2 | 64 | 0.691824 |
b157731a4b4e6c10e7c878d08fd94ce9aebbff26 | 2,907 | py | Python | _cloudview/openstack.py | asmorodskyi/cloudview | 39166a6f63f62aee3b8586e6adc8abc0f8f91fcd | [
"MIT"
] | null | null | null | _cloudview/openstack.py | asmorodskyi/cloudview | 39166a6f63f62aee3b8586e6adc8abc0f8f91fcd | [
"MIT"
] | null | null | null | _cloudview/openstack.py | asmorodskyi/cloudview | 39166a6f63f62aee3b8586e6adc8abc0f8f91fcd | [
"MIT"
] | null | null | null | #
# Copyright 2019 Ricardo Branco <rbranco@suse.de>
# MIT License
#
"""
Reference:
https://developer.openstack.org/api-ref/compute/
"""
import concurrent.futures
from functools import lru_cache
import openstack
from openstack.exceptions import OpenStackCloudException
from _cloudview.exceptions import FatalError
fro... | 28.782178 | 87 | 0.609563 |
40a30564f4a90aba2e00bedcd824c0c9c7816354 | 1,141 | py | Python | tests/falcon/tests_confirmation.py | sgaynetdinov/instasave_bot | b54c1f53917b0a81dffd7a2e5e0980fa878b3d73 | [
"MIT"
] | 13 | 2017-08-16T18:48:43.000Z | 2021-07-27T22:47:28.000Z | tests/falcon/tests_confirmation.py | sgaynetdinov/instasave_bot | b54c1f53917b0a81dffd7a2e5e0980fa878b3d73 | [
"MIT"
] | 14 | 2019-01-17T07:49:23.000Z | 2021-09-16T15:13:13.000Z | tests/falcon/tests_confirmation.py | sgaynetdinov/instasave_bot | b54c1f53917b0a81dffd7a2e5e0980fa878b3d73 | [
"MIT"
] | 2 | 2019-06-08T23:34:53.000Z | 2021-06-01T07:36:35.000Z | import os
from unittest.mock import patch
import falcon
from falcon import testing
from bot.middleware import JSONMiddleware
from bot.vk_bot import Process
from bot.wsgi import application
os.environ['CONFIRMATION_KEY'] = 'response confirmation'
os.environ['GROUP_ID'] = '100500'
os.environ['SECRET_KEY'] = 'SECRET'
... | 30.837838 | 157 | 0.683611 |
b59fb6f6d130fb462ef13414a74ffeae9a8af1a7 | 5,234 | py | Python | tests/test_EquivalentObjects.py | moshekaplan/palo_alto_firewall_analyzer | 9040b85278701dcd7280dde0cf9e3ed05b2fb5d0 | [
"CC0-1.0"
] | 4 | 2021-03-06T05:57:29.000Z | 2022-03-11T07:10:41.000Z | tests/test_EquivalentObjects.py | moshekaplan/palo_alto_firewall_analyzer | 9040b85278701dcd7280dde0cf9e3ed05b2fb5d0 | [
"CC0-1.0"
] | 24 | 2021-03-05T04:53:46.000Z | 2022-03-22T15:51:12.000Z | tests/test_EquivalentObjects.py | moshekaplan/palo_alto_firewall_analyzer | 9040b85278701dcd7280dde0cf9e3ed05b2fb5d0 | [
"CC0-1.0"
] | 1 | 2021-03-05T16:41:52.000Z | 2021-03-05T16:41:52.000Z | #!/usr/bin/env python
import unittest
from palo_alto_firewall_analyzer.core import ProfilePackage
from palo_alto_firewall_analyzer.pan_config import PanConfig
from palo_alto_firewall_analyzer.validators.find_equivalent_objects import find_equivalent_addresses
from palo_alto_firewall_analyzer.validators.find_equivalent... | 48.018349 | 121 | 0.633168 |
f8d11bac4ec57f3056e632787bd3d024d5c610a9 | 1,732 | py | Python | tests/storage/test_main.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | tests/storage/test_main.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | tests/storage/test_main.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2020 Awesome Technologies Innovationslabor GmbH
#
# 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 applicabl... | 34.64 | 85 | 0.698614 |
2e6283990e4ceb2f5cd14bfd3b080111e6678730 | 1,056 | py | Python | Section21_Strategy/RegularStrategy/TextProcessor.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | 1 | 2020-10-20T07:41:51.000Z | 2020-10-20T07:41:51.000Z | Section21_Strategy/RegularStrategy/TextProcessor.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | null | null | null | Section21_Strategy/RegularStrategy/TextProcessor.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | null | null | null | from Section21_Strategy.RegularStrategy.HtmlAbstractListStrategy import HtmlAbstractListStrategy
from Section21_Strategy.RegularStrategy.MarkdownAbstractListStrategy import MarkdownAbstractListStrategy
from Section21_Strategy.RegularStrategy.OutputFormatEnum import OutputFormatEnum
class TextProcessor:
def __init... | 35.2 | 104 | 0.716856 |
f2af3facb3917f88447def018f14eba128fcddcb | 18,764 | py | Python | nicos/clients/gui/panels/tabwidget.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos/clients/gui/panels/tabwidget.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos/clients/gui/panels/tabwidget.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 37.009862 | 80 | 0.571413 |
ab56cd4bb46e837d82d36d7647b7880dca33f62b | 521 | py | Python | factorial.py | goel28priyanshu/hactoberfest20 | d7acf92b384d66f4e2c6c1a4feefcfa82ddf8bd9 | [
"MIT"
] | 1 | 2021-09-09T11:13:47.000Z | 2021-09-09T11:13:47.000Z | factorial.py | goel28priyanshu/hactoberfest20 | d7acf92b384d66f4e2c6c1a4feefcfa82ddf8bd9 | [
"MIT"
] | null | null | null | factorial.py | goel28priyanshu/hactoberfest20 | d7acf92b384d66f4e2c6c1a4feefcfa82ddf8bd9 | [
"MIT"
] | null | null | null | # Python program to find the factorial of a number provided by the user.
# change the value for a different result
num = 7
# To take input from the user
#num = int(input("Enter a number: "))
factorial = 1
# check if the number is negative, positive or zero
if num < 0:
print("Sorry, factorial does not... | 27.421053 | 73 | 0.666027 |
8d5c744b961a6605df449604385f341b7ff9b72d | 1,280 | py | Python | video-maker/make_gif.py | GrzegorzKrug/GymTrain | 0731c45a61f9b727e9d91e3d082d6bae90f9bd8b | [
"Apache-2.0"
] | 2 | 2020-08-13T08:22:11.000Z | 2021-01-20T05:35:12.000Z | video-maker/make_gif.py | GrzegorzKrug/GymTrain | 0731c45a61f9b727e9d91e3d082d6bae90f9bd8b | [
"Apache-2.0"
] | 3 | 2021-06-08T21:16:44.000Z | 2022-03-12T00:22:56.000Z | video-maker/make_gif.py | GrzegorzKrug/GymTrain | 0731c45a61f9b727e9d91e3d082d6bae90f9bd8b | [
"Apache-2.0"
] | null | null | null | from PIL import Image
import os
import re
def make_gif(name, file_list):
framerate = 30
duration = 1 / framerate
frames = []
for file_path in file_list:
picture = Image.open(os.path.join(name, file_path))
pil_im = picture.copy()
picture.close()
frames.append(pil_im)... | 24.615385 | 80 | 0.610938 |
81b10fa02efc11bf0b2bd2e44a7125165459435d | 2,834 | py | Python | libqtile/widget/debuginfo.py | Fuhrmann/qtile | 9760feed411582eeb0379afe7b4b54f73220c1ad | [
"MIT"
] | 1 | 2015-11-24T16:22:37.000Z | 2015-11-24T16:22:37.000Z | libqtile/widget/debuginfo.py | Fuhrmann/qtile | 9760feed411582eeb0379afe7b4b54f73220c1ad | [
"MIT"
] | null | null | null | libqtile/widget/debuginfo.py | Fuhrmann/qtile | 9760feed411582eeb0379afe7b4b54f73220c1ad | [
"MIT"
] | null | null | null | # Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Thomas Sarboni
# Copyright (c) 2014-2015 Tycho Andersen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including wit... | 41.676471 | 79 | 0.671842 |
28d671cc9fe6304766107acbd1c98e88b1fe3ab2 | 1,624 | py | Python | PyPowerStore/tests/unit_tests/entity/smb_share.py | dell/python-powerstore | 04d6d73e4c926cf0d347cf68b24f8f11ff80f565 | [
"Apache-2.0"
] | 15 | 2020-05-06T23:46:44.000Z | 2021-12-14T08:04:48.000Z | PyPowerStore/tests/unit_tests/entity/smb_share.py | dell/python-powerstore | 04d6d73e4c926cf0d347cf68b24f8f11ff80f565 | [
"Apache-2.0"
] | 2 | 2020-06-09T15:19:25.000Z | 2020-08-18T18:58:59.000Z | PyPowerStore/tests/unit_tests/entity/smb_share.py | dell/python-powerstore | 04d6d73e4c926cf0d347cf68b24f8f11ff80f565 | [
"Apache-2.0"
] | 5 | 2020-05-06T23:46:22.000Z | 2021-05-08T03:03:07.000Z | from PyPowerStore.tests.unit_tests.entity.base_abstract import Entity
from PyPowerStore.tests.unit_tests.common_data import CommonData
from PyPowerStore.utils import constants
class SMBShareResponse(Entity):
def __init__(self, method, url, **kwargs):
self.method = method
self.url = url
se... | 30.641509 | 69 | 0.607143 |
48d185829da546bdeeb0db725ad835f2815d3051 | 260 | py | Python | tests/conftest.py | Pylons/pyramid_retry | 0b6eed66e2c47da4350bf36fc7bb452083821fcb | [
"MIT"
] | 5 | 2017-03-01T07:54:34.000Z | 2018-09-26T22:00:34.000Z | tests/conftest.py | Pylons/pyramid_retry | 0b6eed66e2c47da4350bf36fc7bb452083821fcb | [
"MIT"
] | 13 | 2017-03-01T08:59:10.000Z | 2021-04-15T16:56:59.000Z | tests/conftest.py | Pylons/pyramid_retry | 0b6eed66e2c47da4350bf36fc7bb452083821fcb | [
"MIT"
] | 9 | 2017-03-01T08:47:37.000Z | 2021-04-15T16:05:34.000Z | import pyramid.testing
import pytest
@pytest.fixture
def config():
config = pyramid.testing.setUp(
settings={'retry.attempts': 3},
autocommit=False,
)
config.include('pyramid_retry')
yield config
pyramid.testing.tearDown()
| 20 | 39 | 0.673077 |
f144027d4808a3d1b402458a5e34f72a1d9b97ba | 188 | py | Python | solutions/1st-operators/l1_a6.py | Jhynn/programming-concepts-and-logic | 0ffa71c6259296813d3951f21e8d0d69dd523545 | [
"CC-BY-4.0"
] | 4 | 2021-08-03T01:13:34.000Z | 2021-09-29T21:47:41.000Z | solutions/1st-operators/l1_a6.py | Jhynn/programming-concepts-and-logic | 0ffa71c6259296813d3951f21e8d0d69dd523545 | [
"CC-BY-4.0"
] | null | null | null | solutions/1st-operators/l1_a6.py | Jhynn/programming-concepts-and-logic | 0ffa71c6259296813d3951f21e8d0d69dd523545 | [
"CC-BY-4.0"
] | null | null | null | m_per_s = float(input('Please, type some speed in meters per seconds: '))
km_per_h = m_per_s*3.6 # 1Km = 1,000 meters, 1 hour = 3,600 seconds.
print(f'{m_per_s}m/s is {km_per_h}Km/h.')
| 31.333333 | 73 | 0.680851 |
7d886d8ff014b8ba4911d4fbc2660cab7cc9d4f9 | 3,025 | py | Python | generate_gs.py | cjlovering/EGG | cce146e035decbc410e981f8bc7ada32979f3b6d | [
"MIT"
] | null | null | null | generate_gs.py | cjlovering/EGG | cce146e035decbc410e981f8bc7ada32979f3b6d | [
"MIT"
] | null | null | null | generate_gs.py | cjlovering/EGG | cce146e035decbc410e981f8bc7ada32979f3b6d | [
"MIT"
] | null | null | null | import itertools
import os
import math
import random
PROCESS_PER_SCRIPT = 1
def template_file(texts):
text = "".join(texts)
out = f"""#!/bin/bash
#$ -cwd
#$ -e ./logs/
#$ -o ./logs/
#$ -l vf=4G
source /data/nlp/lunar_pilot_env/bin/activate
echo 'Starting job'
mkdir -p data
mkdir -p output
mkdir -p ./logs/
m... | 25.420168 | 94 | 0.596364 |
9d439471cd48f4b8a0bb47aaabec4f6ae793d388 | 185 | py | Python | Livro Nilo Ney (Python)/Cap.04/Exe 4.6.py | EduardoOliver25/Python | 626f0f05641ce52ebe5e350d380ac21c3af53aa8 | [
"MIT"
] | null | null | null | Livro Nilo Ney (Python)/Cap.04/Exe 4.6.py | EduardoOliver25/Python | 626f0f05641ce52ebe5e350d380ac21c3af53aa8 | [
"MIT"
] | null | null | null | Livro Nilo Ney (Python)/Cap.04/Exe 4.6.py | EduardoOliver25/Python | 626f0f05641ce52ebe5e350d380ac21c3af53aa8 | [
"MIT"
] | null | null | null | distancia = float(input('Qual distancia a pecorrer: '))
preco = distancia * 0.50
preco1 = distancia * 0.45
if distancia <= 200:
print(preco)
elif distancia > 200:
print(preco1)
| 23.125 | 55 | 0.686486 |
37b78af699575523281d4a398244a7a6a7559561 | 1,318 | py | Python | longqiao/longqiao/apps/world/urls.py | yktimes/longqiao | 80f98c3f5816c08af9fb8ed6dc43f61c4cc9893d | [
"Apache-2.0"
] | 1 | 2019-09-11T10:24:47.000Z | 2019-09-11T10:24:47.000Z | longqiao/longqiao/apps/world/urls.py | yktimes/longqiao | 80f98c3f5816c08af9fb8ed6dc43f61c4cc9893d | [
"Apache-2.0"
] | null | null | null | longqiao/longqiao/apps/world/urls.py | yktimes/longqiao | 80f98c3f5816c08af9fb8ed6dc43f61c4cc9893d | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^circle/$', views.CreateWorldView.as_view()), # 创建动态(表白墙或世界圈)
# 首页
url(r'^site/$', views.SiteListView.as_view({'get': 'list'})), # 世界圈展示
url(r'^site/(?P<pk>\d+)/$', views.SiteListView.as_view({'get': 'retrieve'}), name='sit... | 33.794872 | 115 | 0.600152 |
d1453ac6d3c1f1d05fa81f932819db967b44f2e8 | 4,071 | py | Python | courier_model.py | DmitrySH19/REST_api_yandex | 7cb3301fdaa9676c617619e4712f96e9bc78442a | [
"MIT"
] | null | null | null | courier_model.py | DmitrySH19/REST_api_yandex | 7cb3301fdaa9676c617619e4712f96e9bc78442a | [
"MIT"
] | null | null | null | courier_model.py | DmitrySH19/REST_api_yandex | 7cb3301fdaa9676c617619e4712f96e9bc78442a | [
"MIT"
] | null | null | null |
import datetime
from datetimerange import DateTimeRange
def formatted_date():
return datetime.datetime.utcnow().isoformat()[:-4]+'Z'
class courier_model():
def __init__(self, courier, orders):
if courier['courier_type'] == 'foot':
self.max_weight = 10.0
elif courier['courier_typ... | 39.144231 | 88 | 0.584132 |
fd6e3db9c6fa2f86911055b66f74a36e2f0c8496 | 266 | py | Python | react-django/backend/todo/models.py | dhy3y/Metamorphosis-Automation | 9a0113ef63283a5fae591c1348288c62f3f8c727 | [
"MIT"
] | null | null | null | react-django/backend/todo/models.py | dhy3y/Metamorphosis-Automation | 9a0113ef63283a5fae591c1348288c62f3f8c727 | [
"MIT"
] | null | null | null | react-django/backend/todo/models.py | dhy3y/Metamorphosis-Automation | 9a0113ef63283a5fae591c1348288c62f3f8c727 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Todo(models.Model):
title = models.CharField(max_length=120)
description = models.TextField()
completed = models.BooleanField(default=False)
def __str__(self):
return self.title | 24.181818 | 50 | 0.718045 |
e8e7c6d29c6e9bfb06cc1845f37e9fe6c28ccc07 | 12,465 | py | Python | docs/conf.py | changsongd/python-optimization | 9f574507010ef637e5a6912a1cb725b782c03cf4 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | changsongd/python-optimization | 9f574507010ef637e5a6912a1cb725b782c03cf4 | [
"Apache-2.0"
] | 4 | 2022-03-24T18:26:49.000Z | 2022-03-31T19:18:00.000Z | docs/conf.py | changsongd/python-optimization | 9f574507010ef637e5a6912a1cb725b782c03cf4 | [
"Apache-2.0"
] | 2 | 2022-03-24T19:22:44.000Z | 2022-03-28T21:19:59.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 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 agr... | 32.376623 | 81 | 0.704773 |
0ade19c1082836a42732195219085397cc6ba58e | 476 | py | Python | app/proyecto/migrations/0002_auto_20171126_1117.py | keveenrodz/PIS_app_web | ba38f0f6b1803f23e98e7398fec05161166cc828 | [
"MIT"
] | null | null | null | app/proyecto/migrations/0002_auto_20171126_1117.py | keveenrodz/PIS_app_web | ba38f0f6b1803f23e98e7398fec05161166cc828 | [
"MIT"
] | null | null | null | app/proyecto/migrations/0002_auto_20171126_1117.py | keveenrodz/PIS_app_web | ba38f0f6b1803f23e98e7398fec05161166cc828 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-26 16:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('proyecto', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 22.666667 | 74 | 0.62395 |
f087e757fe519d1b417213ddc9c73d8c6caec532 | 29,686 | py | Python | sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import codecs
from dateutil import parser as date_parse
import functools
import json
import logging
import time
from azure.core.exceptions import ResourceExistsError, R... | 44.707831 | 532 | 0.686485 |
591ff94cd027e3fa8f96ccba7b9071e618fc120f | 6,705 | py | Python | train.py | omarcal24/Image-Classifier-Project | 432d5f3b583fbeeb76027ba8555d223e5393b5fc | [
"MIT"
] | null | null | null | train.py | omarcal24/Image-Classifier-Project | 432d5f3b583fbeeb76027ba8555d223e5393b5fc | [
"MIT"
] | null | null | null | train.py | omarcal24/Image-Classifier-Project | 432d5f3b583fbeeb76027ba8555d223e5393b5fc | [
"MIT"
] | null | null | null | import torch
from torch import nn, optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
import time
from collections import OrderedDict
import numpy as np
import PIL
from PIL import Image
import matplotlib.pyplot as plt
import shutil, argparse
# The user can choose the some option... | 37.881356 | 136 | 0.58956 |
b1a8bbb141ce65ca2af6afd6d9944c3254c020fd | 1,180 | py | Python | setup.py | astro-kris/scintools | d1398e92c3c99f136e4d7c8c0a72200d5a5614db | [
"MIT"
] | 8 | 2019-01-02T04:12:47.000Z | 2021-10-18T00:53:58.000Z | setup.py | astro-kris/scintools | d1398e92c3c99f136e4d7c8c0a72200d5a5614db | [
"MIT"
] | 1 | 2020-09-10T16:56:26.000Z | 2020-09-10T16:56:26.000Z | setup.py | astro-kris/scintools | d1398e92c3c99f136e4d7c8c0a72200d5a5614db | [
"MIT"
] | 10 | 2019-11-13T15:29:57.000Z | 2021-02-20T05:57:52.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 6 21:44:08 2019
@author: dreardon
"""
from setuptools import setup
setup(
name='scintools',
version='0.2',
description='Tools for analysing pulsar scintillation.',
long_description="See: `github.com/danielreardon/scintools \
... | 32.777778 | 102 | 0.639831 |
12b70256ce926d5593eee46d6abe70326998b0af | 6,554 | py | Python | scripts/ctc-crf/train.py | wenjie-p/CAT | 0e6904658dd3d14afe51faf1d0141ae95fef44e8 | [
"Apache-2.0"
] | null | null | null | scripts/ctc-crf/train.py | wenjie-p/CAT | 0e6904658dd3d14afe51faf1d0141ae95fef44e8 | [
"Apache-2.0"
] | null | null | null | scripts/ctc-crf/train.py | wenjie-p/CAT | 0e6904658dd3d14afe51faf1d0141ae95fef44e8 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2021 Tsinghua University
Apache 2.0.
Author: Zheng Huahuan (zhh20@mails.tsinghua.edu.cn)
This script uses DistributedDataParallel (DDP) to train model within framework of CAT.
Differed from `train_dist.py`, this one supports read configurations from json file
and is more non-hard-coding style.
"""
impor... | 31.509615 | 102 | 0.656088 |
fcb4ff875287e576bec7921dcb7e73a140fa49ed | 2,614 | py | Python | gd/memory/_offsets.py | nekitdev/gd.py | b9d5e29c09f953f54b9b648fb677e987d9a8e103 | [
"MIT"
] | 58 | 2020-09-30T16:51:22.000Z | 2022-02-13T17:27:48.000Z | gd/memory/_offsets.py | NeKitDS/gd.py | b9d5e29c09f953f54b9b648fb677e987d9a8e103 | [
"MIT"
] | 30 | 2019-07-29T12:03:41.000Z | 2020-09-15T17:01:37.000Z | gd/memory/_offsets.py | NeKitDS/gd.py | b9d5e29c09f953f54b9b648fb677e987d9a8e103 | [
"MIT"
] | 20 | 2019-12-06T03:16:57.000Z | 2020-09-16T17:45:27.000Z | from gd.json import NamedDict
from gd.platform import LINUX, MACOS, WINDOWS
from gd.typing import TypeVar, cast
__all__ = (
"offsets_x32",
"offsets_x64",
"linux_offsets_x32",
"linux_offsets_x64",
"macos_offsets_x32",
"macos_offsets_x64",
"windows_offsets_x32",
"windows_offsets_x64",
)
... | 27.515789 | 91 | 0.701224 |
9a135dce07b9ab51076f2363db371c210a3910e3 | 9,019 | py | Python | plugin.video.emisiunionline/default.py | keddyboys/keddy-repo | 5c3420828e19f97222714e0e8518a95d58b3f637 | [
"MIT"
] | 1 | 2019-09-08T05:39:36.000Z | 2019-09-08T05:39:36.000Z | plugin.video.emisiunionline/default.py | keddyboys/keddy-repo | 5c3420828e19f97222714e0e8518a95d58b3f637 | [
"MIT"
] | 1 | 2017-12-03T09:17:31.000Z | 2019-01-13T08:48:40.000Z | plugin.video.emisiunionline/default.py | keddyboys/keddy-repo | 5c3420828e19f97222714e0e8518a95d58b3f637 | [
"MIT"
] | null | null | null | import os
import re
import sys
import urllib
import urllib2
import urlparse
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
try:
import urlresolver
except:
import urlresolver9 as urlresolver
settings = xbmcaddon.Addon(id='plugin.video.emisiunionline')
search_thumb = os.path.join(settings.getAddo... | 39.04329 | 162 | 0.608604 |
d9213106afcc90ed509034f2fc7df7b9dedc620e | 519 | py | Python | miner/address_test.py | DrPandemic/pickaxe | 73b5eebbe00d658dc37a23b5bfc2eb0c2e48b2a4 | [
"MIT"
] | 2 | 2016-03-30T21:21:23.000Z | 2021-07-18T02:23:28.000Z | miner/address_test.py | JesseEmond/pickaxe | 73b5eebbe00d658dc37a23b5bfc2eb0c2e48b2a4 | [
"MIT"
] | 20 | 2016-03-30T17:07:03.000Z | 2016-04-29T04:11:59.000Z | miner/address_test.py | JesseEmond/pickaxe | 73b5eebbe00d658dc37a23b5bfc2eb0c2e48b2a4 | [
"MIT"
] | 4 | 2016-08-20T18:44:34.000Z | 2021-07-18T02:23:43.000Z | import unittest
from address import p2pkh_address_to_pubkey_hash
class AddressTest(unittest.TestCase):
def test_address_p2pkh_to_pubkey_hash_mainnet(self):
# taken from:
# https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
addr = "16UwLL9Risc3QfPqBUvKofHmBQ7wMt... | 28.833333 | 88 | 0.734104 |
5e336425e3526aee558e2ba0638a5eea028f3036 | 6,259 | py | Python | create_trust_anchor_dev_cred.py | armPelionEdge/workflows-with-secure-device-access-client | bf03d069032a15e3b0e3af6abd7496740f376ca1 | [
"Apache-2.0"
] | null | null | null | create_trust_anchor_dev_cred.py | armPelionEdge/workflows-with-secure-device-access-client | bf03d069032a15e3b0e3af6abd7496740f376ca1 | [
"Apache-2.0"
] | 1 | 2021-05-10T11:27:02.000Z | 2021-05-10T11:27:02.000Z | create_trust_anchor_dev_cred.py | armPelionEdge/workflows-with-secure-device-access-client | bf03d069032a15e3b0e3af6abd7496740f376ca1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2017-2019 ARM Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 44.707143 | 241 | 0.629653 |
b1c04248df15f45d913be1d2279e72d6f83a1c7f | 6,782 | py | Python | mergePHASEDsnps_withWholeGenome.py | evodify/phasing-genomes | c528f3223f2227d91359ae2311ee8708fa124d5b | [
"MIT"
] | 7 | 2018-05-15T12:41:22.000Z | 2021-09-03T01:47:15.000Z | mergePHASEDsnps_withWholeGenome.py | evodify/phasing-genomes | c528f3223f2227d91359ae2311ee8708fa124d5b | [
"MIT"
] | 1 | 2016-09-24T19:28:17.000Z | 2016-10-18T19:09:42.000Z | mergePHASEDsnps_withWholeGenome.py | evodify/genome-phasing | c528f3223f2227d91359ae2311ee8708fa124d5b | [
"MIT"
] | 1 | 2019-11-22T10:09:08.000Z | 2019-11-22T10:09:08.000Z | #!/usr/bin/env python2
'''
The script merged phased SNPs dataset with whole genome homozygous sites. Because some heterozygouse sites are not phased and set to Ns, missing data shoudl be also introduced to homozygous sites. This missing data correction is performed with -Np option.
phased-file:
CHROM POS Sample1_A ... | 31.840376 | 255 | 0.608228 |
85827e8b07f65fbfbd8e9649abaf04d34dded219 | 3,748 | py | Python | whiteboxlayer/extensions/utility.py | YeongHyeon/white-box-layer | 0fa85a7d5ec849e584a292275e5a49c4cde41420 | [
"MIT"
] | 7 | 2021-05-28T12:47:48.000Z | 2021-10-03T01:33:35.000Z | whiteboxlayer/extensions/utility.py | YeongHyeon/white-box-layer | 0fa85a7d5ec849e584a292275e5a49c4cde41420 | [
"MIT"
] | null | null | null | whiteboxlayer/extensions/utility.py | YeongHyeon/white-box-layer | 0fa85a7d5ec849e584a292275e5a49c4cde41420 | [
"MIT"
] | 1 | 2021-08-01T04:20:45.000Z | 2021-08-01T04:20:45.000Z | import os
import numpy as np
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2_as_graph
def trim_odd(x):
b, t, c = list(x.get_shape())
if(int(t) % 2 == 1):
return tf.slice(x, [0, 0, 0], [-1, int(t)-1, -1])
else:
return x
... | 32.877193 | 120 | 0.660085 |
9e4c712584a037bb00fae835ec26ef9e7c073668 | 4,015 | py | Python | main.py | lariodiniz/Dekatrian | 0caff45758ba1fe539a142148b5f1d701772592d | [
"MIT"
] | 15 | 2018-08-29T13:28:16.000Z | 2022-03-25T21:20:15.000Z | main.py | lariodiniz/Dekatrian | 0caff45758ba1fe539a142148b5f1d701772592d | [
"MIT"
] | null | null | null | main.py | lariodiniz/Dekatrian | 0caff45758ba1fe539a142148b5f1d701772592d | [
"MIT"
] | 5 | 2018-08-29T15:41:57.000Z | 2021-12-15T14:16:41.000Z | # coding: utf-8
__version__ = '1.1.0'
__author__ = "Lário dos Santos Diniz"
import os
from datetime import date
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager
from kivy.core.window import Window
from kivy.properties import ObjectProperty
from kivy.config import Config
from kivy.lang impo... | 29.522059 | 77 | 0.659776 |
c61485844d64aa17fa1475fb8ee0478d1341a695 | 386 | py | Python | back/web/tran/migrations/0035_profile_profession.py | wda43779/fine-water-flow | 8f7773ee4e8fde7ebe1279842090c3c8158c634e | [
"BSD-2-Clause"
] | 26 | 2019-08-27T13:40:58.000Z | 2021-07-22T16:53:38.000Z | back/web/tran/migrations/0035_profile_profession.py | wda43779/fine-water-flow | 8f7773ee4e8fde7ebe1279842090c3c8158c634e | [
"BSD-2-Clause"
] | 5 | 2019-12-05T00:22:47.000Z | 2022-02-10T12:55:24.000Z | back/web/tran/migrations/0035_profile_profession.py | wda43779/fine-water-flow | 8f7773ee4e8fde7ebe1279842090c3c8158c634e | [
"BSD-2-Clause"
] | 9 | 2019-06-07T09:41:35.000Z | 2021-07-22T16:53:39.000Z | # Generated by Django 2.2.3 on 2019-09-11 04:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tran', '0034_notice'),
]
operations = [
migrations.AddField(
model_name='profile',
name='profession',
fi... | 20.315789 | 62 | 0.590674 |
0f6265ba505b2612674b9ba720a48327a8729434 | 217 | py | Python | HackerRank/Python/Regex and Parsing/Credit Card Numbers.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | HackerRank/Python/Regex and Parsing/Credit Card Numbers.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | HackerRank/Python/Regex and Parsing/Credit Card Numbers.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | import re
test=re.compile(
r'^'
r'(?!.*(\d)(-?\1){3})'
r'[456]'
r'\d{3}'
r'(?:-?\d{4}){3}'
r'$'
)
for _ in range(int(input())):
print("Valid" if test.search(input().strip()) else "Invalid") | 19.727273 | 65 | 0.460829 |
599f0b2d319bce413149759b23bce26b2de4ced2 | 7,502 | py | Python | tests/plugins/test_koji.py | ben-alkov/atomic-reactor | be6b626b7d822f77999f245193fefcc00c501ca9 | [
"BSD-3-Clause"
] | 16 | 2019-07-04T16:00:13.000Z | 2022-01-28T19:51:58.000Z | tests/plugins/test_koji.py | containerbuildsystem/atomic-reactor | 5734a189fc79245d99610f3a81b3aee9913db355 | [
"BSD-3-Clause"
] | 577 | 2019-06-03T07:53:16.000Z | 2022-03-31T04:01:23.000Z | tests/plugins/test_koji.py | ben-alkov/atomic-reactor | be6b626b7d822f77999f245193fefcc00c501ca9 | [
"BSD-3-Clause"
] | 17 | 2020-02-21T13:30:06.000Z | 2022-02-15T10:42:32.000Z | """
Copyright (c) 2015, 2018, 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import koji
import os
from atomic_reactor.plugins.pre_koji import KojiPlugin
from atomic_reactor.inner import DockerBuildWorkflow... | 31.389121 | 91 | 0.616769 |
01235a6a91e82728658823baa8e9884ade7070e9 | 12,169 | py | Python | Community_Water_Model/CWATM/source/hydrological_modules/snow_frost.py | amirsarikhani/NEST | 2771f6593bca0827489359c4129db9eea439d036 | [
"Apache-2.0"
] | 8 | 2019-07-15T19:28:36.000Z | 2021-06-24T04:45:43.000Z | Community_Water_Model/CWATM/source/hydrological_modules/snow_frost.py | amirsarikhani/NEST | 2771f6593bca0827489359c4129db9eea439d036 | [
"Apache-2.0"
] | 1 | 2020-10-19T15:49:34.000Z | 2020-10-19T15:49:34.000Z | Community_Water_Model/CWATM/source/hydrological_modules/snow_frost.py | amirsarikhani/NEST | 2771f6593bca0827489359c4129db9eea439d036 | [
"Apache-2.0"
] | 7 | 2019-05-20T08:50:22.000Z | 2022-03-08T03:35:08.000Z | # -------------------------------------------------------------------------
# Name: Snow module
# Purpose:
#
# Author: PB
#
# Created: 13/07/2016
# Copyright: (c) PB 2016
# -------------------------------------------------------------------------
from management_modules.data_handling import *
#from s... | 41.250847 | 171 | 0.596598 |
f032d8e4d2cf7e8fbe9b1d486a7b2469de5026c8 | 3,545 | py | Python | allennlp/modules/token_embedders/pretrained_transformer_mismatched_embedder.py | urigoren/allennlp | 236e1fd01ca30409cd736625901292609009f5c4 | [
"Apache-2.0"
] | null | null | null | allennlp/modules/token_embedders/pretrained_transformer_mismatched_embedder.py | urigoren/allennlp | 236e1fd01ca30409cd736625901292609009f5c4 | [
"Apache-2.0"
] | null | null | null | allennlp/modules/token_embedders/pretrained_transformer_mismatched_embedder.py | urigoren/allennlp | 236e1fd01ca30409cd736625901292609009f5c4 | [
"Apache-2.0"
] | 2 | 2019-12-21T05:58:44.000Z | 2021-08-16T07:41:21.000Z | from typing import Optional
from overrides import overrides
import torch
from allennlp.modules.token_embedders import PretrainedTransformerEmbedder, TokenEmbedder
from allennlp.nn import util
@TokenEmbedder.register("pretrained_transformer_mismatched")
class PretrainedTransformerMismatchedEmbedder(TokenEmbedder):
... | 40.747126 | 100 | 0.695628 |
adba32cc83b7a229ccb18c243c2b8dbf902439bd | 16,168 | py | Python | super_spirals/io.py | marcusinthesky/super-spirals | e89d0921a9d1c9a8965da33532a2f264ed87b567 | [
"MIT"
] | 5 | 2019-12-04T10:12:05.000Z | 2022-02-16T03:10:49.000Z | super_spirals/io.py | marcusinthesky/super-spirals | e89d0921a9d1c9a8965da33532a2f264ed87b567 | [
"MIT"
] | null | null | null | super_spirals/io.py | marcusinthesky/super-spirals | e89d0921a9d1c9a8965da33532a2f264ed87b567 | [
"MIT"
] | null | null | null | # wavfile.py (Enhanced)
#
# Mod by X-Raym
# Date: 20181906_1222
# * corrected loops
# * unsupported chunk read and write
# * LIST-INFO support
# * renamed variables to avoid conflict with python native functions
# * correct bytes error
# * correct write function
#
# URL: https://gist.github.com/josephernest/3f22c5ed5da... | 29.611722 | 152 | 0.520411 |
e7e08e4935b9cca91eaedf33fcd41172ab20171d | 51,734 | py | Python | pyNastran/gui/utils/colormaps/__init__.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | pyNastran/gui/utils/colormaps/__init__.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | pyNastran/gui/utils/colormaps/__init__.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
#from inferno import cm_data as inferno_cm
#from magma import cm_data as magma_cm
#from plasma import cm_data as plasma_cm
#from viridis import cm_data as viridis_cm
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and t... | 46.649234 | 75 | 0.44319 |
7be3f6b0794d9361151c7c414337432e99841309 | 1,085 | py | Python | setup.py | lllusion3469/pixivpy | cc9763273ce518f7d7c92f07a168b9471aea652d | [
"Unlicense"
] | 4 | 2019-09-15T20:09:12.000Z | 2020-07-26T02:37:33.000Z | setup.py | Notsfsssf/pixivpy | 5afc5aeed465223f3ab3c4607048937c24f07e99 | [
"Unlicense"
] | null | null | null | setup.py | Notsfsssf/pixivpy | 5afc5aeed465223f3ab3c4607048937c24f07e99 | [
"Unlicense"
] | null | null | null | import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requires = ['requests']
version = ''
with open('pixivpy3/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
if not version:
... | 31 | 106 | 0.656221 |
49eeff89d894698aaeb3323a84222763e8fa2d2c | 68 | py | Python | restapi/__init__.py | giota-f/simple_app | cb8531119fd258e22a6dc6d6cf59eac99532c1ce | [
"MIT"
] | 1 | 2019-03-18T14:58:35.000Z | 2019-03-18T14:58:35.000Z | restapi/__init__.py | giota-f/simple_app | cb8531119fd258e22a6dc6d6cf59eac99532c1ce | [
"MIT"
] | null | null | null | restapi/__init__.py | giota-f/simple_app | cb8531119fd258e22a6dc6d6cf59eac99532c1ce | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
import restapi.views
| 13.6 | 23 | 0.794118 |
6f0c354bf796fac43bd8750da340257c3ce59785 | 2,994 | py | Python | core/tests/load_tests/feedback_thread_summaries_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 5,422 | 2015-08-14T01:56:44.000Z | 2022-03-31T23:31:56.000Z | core/tests/load_tests/feedback_thread_summaries_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 14,178 | 2015-08-14T05:21:45.000Z | 2022-03-31T23:54:10.000Z | core/tests/load_tests/feedback_thread_summaries_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 3,574 | 2015-08-14T04:20:06.000Z | 2022-03-29T01:52:37.000Z | # coding: utf-8
#
# Copyright 2017 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 36.072289 | 78 | 0.684369 |
676c952f98a2e7e1a4680a8d449d8ece5937742f | 10,810 | py | Python | ML code/GCNClassification.py | RX-Larry/FIT3161_MA_6 | ecfab10d0b88918415a683395fccdc2e399d037b | [
"MIT"
] | null | null | null | ML code/GCNClassification.py | RX-Larry/FIT3161_MA_6 | ecfab10d0b88918415a683395fccdc2e399d037b | [
"MIT"
] | null | null | null | ML code/GCNClassification.py | RX-Larry/FIT3161_MA_6 | ecfab10d0b88918415a683395fccdc2e399d037b | [
"MIT"
] | 1 | 2022-03-08T10:28:44.000Z | 2022-03-08T10:28:44.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 12 11:43:06 2021
@author: student
"""
import pandas as pd
import numpy as np
import argparse
import os
import random
import matplotlib.pyplot as plt
from stellargraph.mapper import PaddedGraphGenerator
from stellargraph.layer import DeepGraphCNN, G... | 32.65861 | 115 | 0.640333 |
6b8e1335cf34503941ba9ffde0c502942ca3ef9f | 11,825 | py | Python | paddlevideo/modeling/backbones/stgcn.py | ppppeng/cvsport22-figure-skating | c94f9a668f53c8ae34db5a917b5ad1deda8da0c5 | [
"Apache-2.0"
] | null | null | null | paddlevideo/modeling/backbones/stgcn.py | ppppeng/cvsport22-figure-skating | c94f9a668f53c8ae34db5a917b5ad1deda8da0c5 | [
"Apache-2.0"
] | null | null | null | paddlevideo/modeling/backbones/stgcn.py | ppppeng/cvsport22-figure-skating | c94f9a668f53c8ae34db5a917b5ad1deda8da0c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 35.298507 | 127 | 0.502241 |
c986910f69ac6388c01a261d8d779de5f60ff5d6 | 4,712 | py | Python | pylearn2/costs/mlp/__init__.py | capybaralet/pylearn2 | 78d78a99bc6114616a22a4d798c7fedfe4489c58 | [
"BSD-3-Clause"
] | 3 | 2016-01-23T10:18:39.000Z | 2019-02-28T06:22:45.000Z | pylearn2/costs/mlp/__init__.py | kastnerkyle/pylearn2 | f0fc7ddc6fe8db0ff264c189980dca62529b8edb | [
"BSD-3-Clause"
] | null | null | null | pylearn2/costs/mlp/__init__.py | kastnerkyle/pylearn2 | f0fc7ddc6fe8db0ff264c189980dca62529b8edb | [
"BSD-3-Clause"
] | null | null | null | """
Costs for use with the MLP model class.
"""
__authors__ = 'Vincent Archambault-Bouffard, Ian Goodfellow'
__copyright__ = "Copyright 2013, Universite de Montreal"
from theano import tensor as T
from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin, NullDataSpecsMixin
from pylearn2.utils import safe_izip
from... | 28.047619 | 79 | 0.579584 |
254a4ca5bb10dc5446b93ce69f7e7c897b828a5d | 1,520 | py | Python | Greedy/medium/MinimumDeletion_Cost_2.py | dhruvilgandhi/DSA-Together-HacktoberFest | fda752e0622544c83e11f1caf1cc99f36792069e | [
"MIT"
] | 16 | 2021-10-02T20:10:51.000Z | 2022-03-06T10:31:11.000Z | Greedy/medium/MinimumDeletion_Cost_2.py | dhruvilgandhi/DSA-Together-HacktoberFest | fda752e0622544c83e11f1caf1cc99f36792069e | [
"MIT"
] | 55 | 2021-10-02T07:31:41.000Z | 2021-10-30T06:19:26.000Z | Greedy/medium/MinimumDeletion_Cost_2.py | dhruvilgandhi/DSA-Together-HacktoberFest | fda752e0622544c83e11f1caf1cc99f36792069e | [
"MIT"
] | 36 | 2021-10-02T18:00:08.000Z | 2022-01-03T18:50:35.000Z | # https://leetcode.com/problems/minimum-deletion-cost-to-avoid-repeating-letters/submissions/
# Approach2:
# s = "aaabbabbbb"
# cost = [3, 5, 10, 12, 10 , 2 , ,3 , 2 , 3 , 4]
# Here we calculate the local max and local sum of all the duplicates
# So for "aaa" -> Local sum = 3+5+10 = 18 , Local sum = 10
# So since w... | 31.020408 | 112 | 0.567763 |
16be4513c9e8c3b5cb207b9d3b67173807f3e1df | 6,645 | py | Python | jel/utils/tokenizer.py | izuna385/jel | 3bce15d2dd81d18e04eae49bf91afa45d3a1f93e | [
"Apache-2.0"
] | 6 | 2021-05-28T05:59:49.000Z | 2021-06-03T13:31:20.000Z | jel/utils/tokenizer.py | izuna385/jel | 3bce15d2dd81d18e04eae49bf91afa45d3a1f93e | [
"Apache-2.0"
] | 3 | 2021-05-29T15:20:37.000Z | 2021-07-25T04:01:38.000Z | jel/utils/tokenizer.py | izuna385/jel | 3bce15d2dd81d18e04eae49bf91afa45d3a1f93e | [
"Apache-2.0"
] | 1 | 2021-07-25T04:43:34.000Z | 2021-07-25T04:43:34.000Z | import transformers
from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer, PretrainedTransformerIndexer
import os
import urllib.request
from typing import List, Tuple
import pdb
import re
from allennlp.data.token_indexers import SingleIdTokenIndexer
from sudachipy import tokenizer as sudachiTokeni... | 40.518293 | 171 | 0.631151 |
d8effcddc7edc887871036013818a0fc171d6ff3 | 30,570 | py | Python | src/GUI/OneDim.py | ElsevierSoftwareX/SOFTX-D-21-00205 | 5851812987c0f5c65ffb961f8fe3a14e6a3fc01a | [
"BSD-3-Clause"
] | 1 | 2022-03-01T19:27:29.000Z | 2022-03-01T19:27:29.000Z | src/GUI/OneDim.py | ElsevierSoftwareX/SOFTX-D-21-00205 | 5851812987c0f5c65ffb961f8fe3a14e6a3fc01a | [
"BSD-3-Clause"
] | null | null | null | src/GUI/OneDim.py | ElsevierSoftwareX/SOFTX-D-21-00205 | 5851812987c0f5c65ffb961f8fe3a14e6a3fc01a | [
"BSD-3-Clause"
] | 1 | 2022-02-16T15:43:55.000Z | 2022-02-16T15:43:55.000Z | # Copyright (c) 2021, BOXVIA Developers
# All rights reserved.
# Code released under the BSD 3-clause license.
import os
import sys
import csv
import numpy as np
import pandas as pd
from dash import dcc, html, dash_table
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
impo... | 42.815126 | 167 | 0.365587 |
a995e083dfd36d3c2e041a2eaa5186810154661f | 361 | py | Python | code/arkaplan-cikarma/python/background-subtractor-gmg.py | BASARIRR/computer-vision-guide | 0a11726fb2be0cad63738ab45fd4edc4515441d2 | [
"MIT"
] | 230 | 2019-01-17T01:00:53.000Z | 2022-03-31T18:00:09.000Z | code/arkaplan-cikarma/python/background-subtractor-gmg.py | sturlu/goruntu-isleme-kilavuzu | e9377ace3823ca5f2d06ca78a11884256539134d | [
"MIT"
] | 8 | 2019-05-03T07:44:50.000Z | 2022-02-10T00:14:38.000Z | code/arkaplan-cikarma/python/background-subtractor-gmg.py | sturlu/goruntu-isleme-kilavuzu | e9377ace3823ca5f2d06ca78a11884256539134d | [
"MIT"
] | 71 | 2019-01-17T12:11:06.000Z | 2022-03-03T22:02:46.000Z | import numpy as np
import cv2
cap = cv2.VideoCapture(0)
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3,3))
fgbg = cv2.createBackgroundSubtractorGMG()
while(1):
ret, frame = cap.read()
fgmask = fgbg.apply(frame)
fgmask = cv2.morphologyEx(fgmask, cv2.MORPH_OPEN, kernel)
cv2.imshow('GORUNTU',fgmas... | 27.769231 | 61 | 0.736842 |
bbc648a0f3b5163e95e4e4651c7750dcee4dd7be | 1,273 | py | Python | labour/views/view_helpers.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | labour/views/view_helpers.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | labour/views/view_helpers.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from ..models import JobCategory
from core.utils import initialize_form
def initialize_signup_forms(request, event, signup, admin=False, SignupFormClass=None, SignupExtraFormClass=None):
assert all([SignupFormClass, SignupExtraFormClass]) or not any([SignupFormClass, SignupExtraFormClass])
signup_extra = sig... | 33.5 | 114 | 0.706991 |
4dabb249b133dd1dc456b613a7465010be36d501 | 1,138 | py | Python | LC_152_maximum_product_subarray.py | tirthbharatiya/interview_questions | 44e51c95ce12441fe5f4a5bc03efa0d409e4c014 | [
"MIT"
] | 1 | 2020-02-22T08:29:58.000Z | 2020-02-22T08:29:58.000Z | LC_152_maximum_product_subarray.py | tirthbharatiya/interview_questions | 44e51c95ce12441fe5f4a5bc03efa0d409e4c014 | [
"MIT"
] | null | null | null | LC_152_maximum_product_subarray.py | tirthbharatiya/interview_questions | 44e51c95ce12441fe5f4a5bc03efa0d409e4c014 | [
"MIT"
] | 1 | 2021-06-19T13:14:03.000Z | 2021-06-19T13:14:03.000Z | '''
Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, and return the product.
It is guaranteed that the answer will fit in a 32-bit integer.
A subarray is a contiguous subsequence of the array.
Example 1:
Input: nums = [2,3,-2,4]
Output: 6
Explan... | 24.73913 | 136 | 0.551845 |
fa6a777f688ef65562ec118176c40a48e9770993 | 1,253 | py | Python | Assignments/HW4/sonar_distance.py | bsaisudh/ENPM809T | d31072c2c79ea7ec34f61f868af12195286ed1da | [
"MIT"
] | null | null | null | Assignments/HW4/sonar_distance.py | bsaisudh/ENPM809T | d31072c2c79ea7ec34f61f868af12195286ed1da | [
"MIT"
] | null | null | null | Assignments/HW4/sonar_distance.py | bsaisudh/ENPM809T | d31072c2c79ea7ec34f61f868af12195286ed1da | [
"MIT"
] | 1 | 2021-02-05T00:45:48.000Z | 2021-02-05T00:45:48.000Z | import RPi.GPIO as gpio
import time
import numpy as np
import cv2
import imutils
import os
trig = 16
echo = 18
def distance():
gpio.setmode(gpio.BOARD)
gpio.setup(trig, gpio.OUT)
gpio.setup(echo, gpio.IN)
gpio.output(trig, False)
time.sleep(0.1)
gpio.output(trig, True)
time.sleep(0.00001... | 21.603448 | 107 | 0.595371 |
958025787609d74dfbc1093dca81813434e3a904 | 9,653 | py | Python | sdk/python/pulumi_azure/compute/shared_image.py | AdminTurnedDevOps/pulumi-azure | affd9eaaee3016f350f0d0469694dbd52850300b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/compute/shared_image.py | AdminTurnedDevOps/pulumi-azure | affd9eaaee3016f350f0d0469694dbd52850300b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/compute/shared_image.py | AdminTurnedDevOps/pulumi-azure | affd9eaaee3016f350f0d0469694dbd52850300b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Shared... | 54.230337 | 292 | 0.688491 |
3f243252943cd912dd97879cfe89e53bef6f8c14 | 26,068 | py | Python | venv/lib/python3.8/site-packages/mercurial/parser.py | JesseDavids/mqtta | 389eb4f06242d4473fe1bcff7fc6a22290e0d99c | [
"Apache-2.0"
] | 4 | 2021-02-05T10:57:39.000Z | 2022-02-25T04:43:23.000Z | venv/lib/python3.8/site-packages/mercurial/parser.py | JesseDavids/mqtta | 389eb4f06242d4473fe1bcff7fc6a22290e0d99c | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/mercurial/parser.py | JesseDavids/mqtta | 389eb4f06242d4473fe1bcff7fc6a22290e0d99c | [
"Apache-2.0"
] | null | null | null | # parser.py - simple top-down operator precedence parser for mercurial
#
# Copyright 2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# see http://effbot.org/zone/simple-top-down-parsing.htm and
... | 35.037634 | 80 | 0.528387 |
bcd2080724c54799da16c6c599ddd4fd3ec38e21 | 593 | py | Python | scripts/paster.py | bensellak/galaxy | 020b145c8c0ee5f61543e87e5d1867ae717a6871 | [
"CC-BY-3.0"
] | 2 | 2017-10-23T14:44:12.000Z | 2018-01-14T10:37:28.000Z | scripts/paster.py | bensellak/galaxy | 020b145c8c0ee5f61543e87e5d1867ae717a6871 | [
"CC-BY-3.0"
] | 30 | 2016-10-20T15:35:12.000Z | 2018-10-02T15:59:54.000Z | scripts/paster.py | bensellak/galaxy | 020b145c8c0ee5f61543e87e5d1867ae717a6871 | [
"CC-BY-3.0"
] | 7 | 2016-11-03T19:11:01.000Z | 2020-05-11T14:23:52.000Z | """
Bootstrap the Galaxy framework.
This should not be called directly! Use the run.sh script in Galaxy's
top level directly.
"""
from __future__ import absolute_import
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
from galaxy.util.pastescript i... | 21.178571 | 94 | 0.752108 |
31e711e8a7c33bb5f967740a8f56e38417a72556 | 2,768 | py | Python | BlockToObj.py | jamescarson3/BlockToObj | de3fc5b0ceccb67398b4ae1ed29df0ab6d1f62e3 | [
"MIT"
] | null | null | null | BlockToObj.py | jamescarson3/BlockToObj | de3fc5b0ceccb67398b4ae1ed29df0ab6d1f62e3 | [
"MIT"
] | null | null | null | BlockToObj.py | jamescarson3/BlockToObj | de3fc5b0ceccb67398b4ae1ed29df0ab6d1f62e3 | [
"MIT"
] | null | null | null | # imports
import sys, os
# assign input filename and output directory
arguments = len(sys.argv) - 1
if arguments!=2:
print("Format: python3 Block2Obj.py <input_filename> <output_foldername>")
sys.exit(0)
input_filename=sys.argv[1]
output_foldername=sys.argv[2]
# open tab separated value file
f=open(input_fil... | 27.959596 | 107 | 0.58237 |
1bcc36e874d9a4ca2e4cda018c642a0fb67a7c1f | 2,391 | py | Python | chalmers/service/tests/test_darwin_service.py | Anaconda-Platform/chalmers | 029ac223660f267a04047b63d6ccfefa3d012b2e | [
"MIT"
] | 11 | 2016-05-05T15:33:32.000Z | 2021-04-12T20:37:47.000Z | chalmers/service/tests/test_darwin_service.py | Anaconda-Platform/chalmers | 029ac223660f267a04047b63d6ccfefa3d012b2e | [
"MIT"
] | 3 | 2016-07-19T15:40:19.000Z | 2016-07-25T19:03:52.000Z | chalmers/service/tests/test_darwin_service.py | Anaconda-Platform/chalmers | 029ac223660f267a04047b63d6ccfefa3d012b2e | [
"MIT"
] | 3 | 2016-08-04T05:58:02.000Z | 2017-06-06T02:32:33.000Z | import unittest
from chalmers.service.darwin_service import DarwinService
from contextlib import contextmanager
import subprocess as sp
import xml.etree.ElementTree as ET
loaded_launchd = {}
def plist_value(value):
if value.tag == 'string':
return value.text
elif value.tag == 'true':
return T... | 29.8875 | 68 | 0.61857 |
a4bb6cb59be488d54abb3f4397ae5588880629ee | 6,101 | py | Python | tests/git_utils.py | dogbert911/Universum | 96cb237b1e11cf835d86779e4f960b284ac3f720 | [
"BSD-2-Clause"
] | null | null | null | tests/git_utils.py | dogbert911/Universum | 96cb237b1e11cf835d86779e4f960b284ac3f720 | [
"BSD-2-Clause"
] | null | null | null | tests/git_utils.py | dogbert911/Universum | 96cb237b1e11cf835d86779e4f960b284ac3f720 | [
"BSD-2-Clause"
] | null | null | null | # pylint: disable = redefined-outer-name
import os
from time import sleep
import git
from git.remote import RemoteProgress
import py
import pytest
import sh
from . import utils
class GitServer:
def __init__(self, working_directory: py.path.local, branch_name: str):
self.target_branch: str = branch_name... | 36.315476 | 111 | 0.633994 |
d085834233d581febc0fd0643e412a3a33008c69 | 13,992 | py | Python | appv1/aws_actions.py | CBitLabs/atlas | d205924dc3938ef49f156148ac1dda20220f7575 | [
"MIT"
] | null | null | null | appv1/aws_actions.py | CBitLabs/atlas | d205924dc3938ef49f156148ac1dda20220f7575 | [
"MIT"
] | null | null | null | appv1/aws_actions.py | CBitLabs/atlas | d205924dc3938ef49f156148ac1dda20220f7575 | [
"MIT"
] | null | null | null | import boto
import boto, boto.ec2
from aws_helper import AwsHelper
from atlas_helper_methods import AtlasHelper
import jenkins
from jenkins import Jenkins
import re
from boto.exception import AWSConnectionError, EC2ResponseError
import memcache
class AwsActions:
def __init__(self):
self.awshelper_obj = Aw... | 55.968 | 211 | 0.65416 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.