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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fcc9e01939ec837964e1db345f0c9a95613dca04 | 2,057 | py | Python | _backend_api/views.py | Amechi101/indieapp | 606c1346f65c343eb2cc8f7fba9d555b8c30a7fa | [
"MIT"
] | null | null | null | _backend_api/views.py | Amechi101/indieapp | 606c1346f65c343eb2cc8f7fba9d555b8c30a7fa | [
"MIT"
] | null | null | null | _backend_api/views.py | Amechi101/indieapp | 606c1346f65c343eb2cc8f7fba9d555b8c30a7fa | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.contrib import auth, messages
from django.views.generic import ListView
from django.views.generic.detail import SingleObjectMixin
from _backend_api.models import Product, Brand, Location
from subscription.mo... | 26.371795 | 104 | 0.7579 |
a071ac8c516edd4f2ca5b67cffe5e58b7db49419 | 3,958 | py | Python | glvm/auto_encoder.py | zhangdongkun98/generative-latent-variable-models | 11e54ff33e6b86e2b87213b8620676a4e19ad24f | [
"MIT"
] | null | null | null | glvm/auto_encoder.py | zhangdongkun98/generative-latent-variable-models | 11e54ff33e6b86e2b87213b8620676a4e19ad24f | [
"MIT"
] | null | null | null | glvm/auto_encoder.py | zhangdongkun98/generative-latent-variable-models | 11e54ff33e6b86e2b87213b8620676a4e19ad24f | [
"MIT"
] | null | null | null | import rllib
from typing import List
import torch
import torch.nn as nn
from torch.optim import Adam
class AutoEncoder(rllib.template.MethodSingleAgent):
lr_model = 0.0003
buffer_size = 10000
batch_size = 144
weight = batch_size / buffer_size
start_timesteps = 10000
save_model_interva... | 33.260504 | 132 | 0.638201 |
0e51ec28fcabe2694449f367a6dd949a1f5e8a53 | 28 | py | Python | logger/__init__.py | ducminhkhoi/Video-Attention | 84aea8a14bd375ca9765f76a6e5b6ad3f8a951c7 | [
"MIT"
] | null | null | null | logger/__init__.py | ducminhkhoi/Video-Attention | 84aea8a14bd375ca9765f76a6e5b6ad3f8a951c7 | [
"MIT"
] | null | null | null | logger/__init__.py | ducminhkhoi/Video-Attention | 84aea8a14bd375ca9765f76a6e5b6ad3f8a951c7 | [
"MIT"
] | 2 | 2020-02-29T02:41:50.000Z | 2021-10-02T16:54:34.000Z | from logger.logger import *
| 14 | 27 | 0.785714 |
d2624356d7fdcb1e5a73c54b384b575c16e48ef1 | 319 | py | Python | src/kong/__init__.py | SpazioDati/python-kong | fbfc0a357a5ea0471c2dc138bcbe521349ded965 | [
"BSD-2-Clause"
] | null | null | null | src/kong/__init__.py | SpazioDati/python-kong | fbfc0a357a5ea0471c2dc138bcbe521349ded965 | [
"BSD-2-Clause"
] | null | null | null | src/kong/__init__.py | SpazioDati/python-kong | fbfc0a357a5ea0471c2dc138bcbe521349ded965 | [
"BSD-2-Clause"
] | 1 | 2020-01-17T06:55:00.000Z | 2020-01-17T06:55:00.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
try: # pragma: no cover
# https://urllib3.readthedocs.org/en/latest/security.html#pyopenssl
import urllib3.contrib.pyopenssl
urllib3.contrib.pyopenssl.inject_into_urllib3()
except ImportError:
pass
__version__ = '0.3.1'
| 26.583333 | 71 | 0.742947 |
e26f4e1f9ad50b625a802011a462d50cbf49defa | 8,079 | py | Python | contrib/devtools/update-translations.py | Saci-de-bani/onecommacoin | bff7fd5cab50d4be5fb685185c54df035adb95ce | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Saci-de-bani/onecommacoin | bff7fd5cab50d4be5fb685185c54df035adb95ce | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Saci-de-bani/onecommacoin | bff7fd5cab50d4be5fb685185c54df035adb95ce | [
"MIT"
] | 1 | 2021-08-06T05:44:52.000Z | 2021-08-06T05:44:52.000Z | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | 38.841346 | 124 | 0.636094 |
58f8a62fdf55d9bd7fda59b23544b47740dc1abd | 780 | py | Python | assignements/Session1/test_S3.py | charlottedrb/BachelorDIM-Lectures-Algorithms-2020 | f34cb432cd2b34b548cbc44539084831fd45695e | [
"MIT"
] | null | null | null | assignements/Session1/test_S3.py | charlottedrb/BachelorDIM-Lectures-Algorithms-2020 | f34cb432cd2b34b548cbc44539084831fd45695e | [
"MIT"
] | null | null | null | assignements/Session1/test_S3.py | charlottedrb/BachelorDIM-Lectures-Algorithms-2020 | f34cb432cd2b34b548cbc44539084831fd45695e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 29 08:46:18 2020
@author: derbaghc
"""
import cv2
import numpy as np
import S3_imgproc_tools as main
import pytest
# =============================================================================
# Tests pour la fonction de déclenchements d'erreurs
# ====================... | 25.16129 | 79 | 0.553846 |
1f15aacfca79687c062fc340db09411d67e1fc21 | 727 | py | Python | HLTrigger/Configuration/python/HLT_75e33/modules/hltRechitInRegionsHGCAL_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltRechitInRegionsHGCAL_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltRechitInRegionsHGCAL_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
hltRechitInRegionsHGCAL = cms.EDProducer("HLTHGCalRecHitsInRegionsProducer",
etaPhiRegions = cms.VPSet(cms.PSet(
inputColl = cms.InputTag("hltL1TEGammaHGCFilteredCollectionProducer"),
maxDEta = cms.double(0.0),
maxDPhi = cms.double(0.0),
maxD... | 36.35 | 144 | 0.678129 |
a4157da2608fdbeaad524a08bd7d21477c304128 | 1,369 | py | Python | tests/test_top_level_editable.py | bendikro/pip-tools | 62a5b4d74b889a9265fc0f1ca91ca2b92a5801c0 | [
"BSD-3-Clause"
] | 1 | 2018-12-03T01:55:55.000Z | 2018-12-03T01:55:55.000Z | tests/test_top_level_editable.py | DalavanCloud/pip-tools | c1b4c67c44e97efcb16f7f88d7f3062db1b8c5d0 | [
"BSD-3-Clause"
] | 1 | 2022-02-09T11:29:10.000Z | 2022-02-09T11:29:10.000Z | tests/test_top_level_editable.py | DalavanCloud/pip-tools | c1b4c67c44e97efcb16f7f88d7f3062db1b8c5d0 | [
"BSD-3-Clause"
] | 2 | 2021-11-11T00:36:27.000Z | 2022-02-09T09:47:35.000Z | import os
import pytest
from piptools.repositories import PyPIRepository
from piptools.scripts.compile import get_pip_command
class MockedPyPIRepository(PyPIRepository):
def get_dependencies(self, ireq):
# "mock" everything but editable reqs to avoid disk and network I/O
# when possible
i... | 29.12766 | 102 | 0.710007 |
d38afec42d8537ed2d5b313ecfdabace98fb421f | 400 | py | Python | papermerge/core/serializers/automate.py | papermerge/papermerge-core | e377441a8e5ddb748fa3861f686fa22c00d407fe | [
"Apache-2.0"
] | 45 | 2021-01-10T14:33:52.000Z | 2022-03-27T14:02:56.000Z | papermerge/core/serializers/automate.py | papermerge/papermerge-core | e377441a8e5ddb748fa3861f686fa22c00d407fe | [
"Apache-2.0"
] | 8 | 2021-01-08T20:02:21.000Z | 2022-02-01T13:12:24.000Z | papermerge/core/serializers/automate.py | papermerge/papermerge-core | e377441a8e5ddb748fa3861f686fa22c00d407fe | [
"Apache-2.0"
] | 12 | 2021-01-07T20:03:07.000Z | 2022-03-24T04:07:51.000Z | from rest_framework import serializers
from papermerge.core.models import Automate
class AutomateSerializer(serializers.ModelSerializer):
class Meta:
model = Automate
resource_name = 'automates'
fields = (
'id',
'name',
'match',
'matching_a... | 21.052632 | 54 | 0.57 |
6be0e401c8f92d7d21e743ed8d667d7755e8b595 | 17,859 | py | Python | TFGeneration/GenerateTFRecord.py | bradleyfowler123/TIES_DataGeneration | 28f29b0f292b4652cfcd2d68674b50aea792f3ac | [
"MIT"
] | null | null | null | TFGeneration/GenerateTFRecord.py | bradleyfowler123/TIES_DataGeneration | 28f29b0f292b4652cfcd2d68674b50aea792f3ac | [
"MIT"
] | null | null | null | TFGeneration/GenerateTFRecord.py | bradleyfowler123/TIES_DataGeneration | 28f29b0f292b4652cfcd2d68674b50aea792f3ac | [
"MIT"
] | 1 | 2021-07-12T07:34:10.000Z | 2021-07-12T07:34:10.000Z | import warnings
warnings.filterwarnings("ignore")
import tensorflow as tf
import numpy as np
import traceback
import cv2
import os
import string
import pickle
from multiprocessing import Process,Lock
from TableGeneration.Table import Table
from multiprocessing import Process,Pool,cpu_count
import random
import argpars... | 53.47006 | 196 | 0.590739 |
75e4cee3a2b209dfb20e3ce7be3a738acc0c864c | 1,397 | py | Python | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/package/scripts/status_params.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/package/scripts/status_params.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/package/scripts/status_params.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); yo... | 38.805556 | 72 | 0.735147 |
6948f49e37bafa003372ad0b74b648a8341f9fad | 5,306 | py | Python | sociation2vec/utils.py | ur001/sociation_corpus | 050e6bc35f7e4261a46e509a05d484937b30e8b6 | [
"MIT"
] | 3 | 2017-11-05T06:39:25.000Z | 2017-11-16T13:44:54.000Z | sociation2vec/utils.py | ur001/sociation_corpus | 050e6bc35f7e4261a46e509a05d484937b30e8b6 | [
"MIT"
] | null | null | null | sociation2vec/utils.py | ur001/sociation_corpus | 050e6bc35f7e4261a46e509a05d484937b30e8b6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Создание исходного корпуса Sociation.org
Выполняется в консоли. Код для ознакомления
"""
import os
from collections import Counter
from operator import itemgetter
from random import randint
import numpy as np
from gensim import corpora, models, similarities
class DictEncoder(object):
"""
В... | 32.157576 | 107 | 0.637015 |
a5186465f09e98330d03cddec3197fe3bddb1359 | 1,616 | py | Python | editDistance/editDistance.py | alexZrAl/Simple-Algorithms | d420b5efea08719315b27908267a8b7fd7dffc50 | [
"MIT"
] | null | null | null | editDistance/editDistance.py | alexZrAl/Simple-Algorithms | d420b5efea08719315b27908267a8b7fd7dffc50 | [
"MIT"
] | null | null | null | editDistance/editDistance.py | alexZrAl/Simple-Algorithms | d420b5efea08719315b27908267a8b7fd7dffc50 | [
"MIT"
] | null | null | null | import numpy as np
def getEditDist(src, target):
'''
Compares the edit distance of string target with string src, in quadratic time
@param src: The "sample" string
@param target: The string we want to compare with the sample
'''
row = len(src) + 1
col = len(target) + 1
# ch... | 28.857143 | 91 | 0.587252 |
4451a99d6a9228f5644d8c5f02d048a61e04a276 | 1,043 | py | Python | sublime_helper/__init__.py | derickc/Fountainhead | b9b6bdae7a62aff17c8a277bf384ba13a0c49ad1 | [
"MIT"
] | 66 | 2015-01-25T17:36:33.000Z | 2021-09-16T11:21:22.000Z | sublime_helper/__init__.py | chukhran/Fountainhead | 2db9da646e4cfcdfe89b8b21e6ba08b11d7e39e6 | [
"MIT"
] | 24 | 2015-01-21T12:42:50.000Z | 2020-06-15T14:36:56.000Z | sublime_helper/__init__.py | chukhran/Fountainhead | 2db9da646e4cfcdfe89b8b21e6ba08b11d7e39e6 | [
"MIT"
] | 13 | 2015-01-23T12:55:31.000Z | 2022-03-27T01:17:20.000Z | class SublimeHelper:
def cursor_scope(self, view, offset=1):
'''
Gives the scope based on cursor position.
'''
return view.scope_name(view.sel()[0].end() - offset)
def line_scope(self, view, offset=1):
'''
Gives the scope for a given line based on cursor positio... | 33.645161 | 103 | 0.587728 |
a4375a05632edda459c2524d107e4b471f567340 | 3,011 | py | Python | args/starting_party.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 7 | 2022-01-15T02:53:53.000Z | 2022-02-17T00:51:32.000Z | args/starting_party.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 8 | 2022-01-16T02:45:24.000Z | 2022-03-21T02:08:27.000Z | args/starting_party.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 5 | 2022-01-15T02:53:38.000Z | 2022-01-19T17:42:10.000Z | def name():
return "Starting Party"
def parse(parser):
starting_party = parser.add_argument_group("Starting Party")
from data.characters import Characters
character_options = [name.lower() for name in Characters.DEFAULT_NAME]
character_options.append("random")
character_options.append("randomn... | 35.011628 | 117 | 0.63268 |
aae4af6bf88ead0d714c092e22fad305d8877644 | 13,648 | py | Python | codes/2_run_model_cequeau.py | aviolinist/EEE | 032e2029815229875048cc92dd7da24ff3f71e93 | [
"MIT"
] | 6 | 2019-09-27T15:38:37.000Z | 2021-02-03T13:58:01.000Z | codes/2_run_model_cequeau.py | aviolinist/EEE | 032e2029815229875048cc92dd7da24ff3f71e93 | [
"MIT"
] | null | null | null | codes/2_run_model_cequeau.py | aviolinist/EEE | 032e2029815229875048cc92dd7da24ff3f71e93 | [
"MIT"
] | 5 | 2019-09-27T15:38:52.000Z | 2022-03-22T17:24:37.000Z | #!/usr/bin/env python
from __future__ import print_function
# Copyright 2019 Juliane Mai - juliane.mai(at)uwaterloo.ca
#
# License
# This file is part of the EEE code library for "Computationally inexpensive identification
# of noninformative model parameters by sequential screening: Efficient Elementary Effects (EEE)... | 40.984985 | 374 | 0.606609 |
442f875f7dd039b48b782ee185925322f7ab356d | 1,461 | py | Python | pyStatus/plugins/Memory.py | fleaz/pyStatus | cc9f89d1173897da929bbb85e435a912bf1dc5c3 | [
"MIT"
] | null | null | null | pyStatus/plugins/Memory.py | fleaz/pyStatus | cc9f89d1173897da929bbb85e435a912bf1dc5c3 | [
"MIT"
] | null | null | null | pyStatus/plugins/Memory.py | fleaz/pyStatus | cc9f89d1173897da929bbb85e435a912bf1dc5c3 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import psutil
from ..BarItem import BarItem
class Memory(BarItem):
def __init__(self):
BarItem.__init__(self, "Memory")
self.output['name'] = "Memory"
self.update()
def update(self):
mem = psutil.virtual_memory()
mem_total = mem[0]
mem_... | 25.631579 | 93 | 0.579055 |
9c2cf0ebcc1df2aeed838a6395df29469a37697b | 1,884 | py | Python | tests/test_forms.py | jcass77/django-yearlessdate | 19ed3ecb16efe33eea6f02138bb4365447cb2ea7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_forms.py | jcass77/django-yearlessdate | 19ed3ecb16efe33eea6f02138bb4365447cb2ea7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_forms.py | jcass77/django-yearlessdate | 19ed3ecb16efe33eea6f02138bb4365447cb2ea7 | [
"BSD-3-Clause"
] | null | null | null | from djangoyearlessdate.helpers import YearlessDate
from djangoyearlessdate.forms import YearlessDateSelect
from .testapp.forms import YearForm, YearlessDateForm
class TestYearlessDateWidget:
def test_decompress_with_value(self):
assert YearlessDateSelect().decompress(YearlessDate(22, 6)) == [22, 6]
... | 36.941176 | 87 | 0.674628 |
121b35795cff2acccc3d2bbf37cd67f4f44c5322 | 354 | py | Python | python/ray/tune/automl/__init__.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 21,382 | 2016-09-26T23:12:52.000Z | 2022-03-31T21:47:45.000Z | python/ray/tune/automl/__init__.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 19,689 | 2016-09-17T08:21:25.000Z | 2022-03-31T23:59:30.000Z | python/ray/tune/automl/__init__.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 4,114 | 2016-09-23T18:54:01.000Z | 2022-03-31T15:07:32.000Z | from ray.tune.automl.genetic_searcher import GeneticSearch
from ray.tune.automl.search_policy import GridSearch, RandomSearch
from ray.tune.automl.search_space import SearchSpace, \
ContinuousSpace, DiscreteSpace
__all__ = [
"ContinuousSpace",
"DiscreteSpace",
"SearchSpace",
"GridSearch",
"Rand... | 25.285714 | 66 | 0.748588 |
2d958ee9de18d8957b296a98c2054d1ac6433781 | 536 | py | Python | exercicios_python/Exercicio_042.py | GabsOrtega/logica-python | 6f4e752d0796c9bf70be8f7108bc3bd49d877709 | [
"MIT"
] | null | null | null | exercicios_python/Exercicio_042.py | GabsOrtega/logica-python | 6f4e752d0796c9bf70be8f7108bc3bd49d877709 | [
"MIT"
] | null | null | null | exercicios_python/Exercicio_042.py | GabsOrtega/logica-python | 6f4e752d0796c9bf70be8f7108bc3bd49d877709 | [
"MIT"
] | null | null | null | r1 = float(input('Primeiro segmento: '))
r2 = float(input('Segundo segmento: '))
r3 = float(input('Terceiro segmento: '))
if r1+r2 > r3 and r2+r3 > r1 and r3+r1 > r2:
print('É POSSÍVEL FORMAR UM TRIÂNGULO COM ESTES SEGMENTOS DE RETA')
if r1 == r2 and r2 == r3:
print('TRIÂNGULO EQUILÁTERO')
... | 38.285714 | 72 | 0.606343 |
91015941bab84753c1d866b89ba10edafc51f6f3 | 9,929 | py | Python | tests/parallel_test.py | alexdavies/jax | 812df27a2d8f61bfac95ff2867d1284cac81837f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-12T20:19:20.000Z | 2020-05-12T20:19:20.000Z | tests/parallel_test.py | alexdavies/jax | 812df27a2d8f61bfac95ff2867d1284cac81837f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/parallel_test.py | alexdavies/jax | 812df27a2d8f61bfac95ff2867d1284cac81837f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.638806 | 79 | 0.642461 |
7d634bd4f14e9df3035785f9707c9f77f6b51f4d | 690 | py | Python | ecs/docstash/views.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 9 | 2017-02-13T18:17:13.000Z | 2020-11-21T20:15:54.000Z | ecs/docstash/views.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 2 | 2021-05-20T14:26:47.000Z | 2021-05-20T14:26:48.000Z | ecs/docstash/views.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 4 | 2017-04-02T18:48:59.000Z | 2021-11-23T15:40:35.000Z | from django.http import Http404
from django.shortcuts import get_object_or_404
from ecs.docstash.models import DocStash
from ecs.documents.models import Document
from ecs.documents.views import handle_download
def download_document(request, docstash_key=None, document_pk=None, view=False):
docstash = get_object_... | 38.333333 | 84 | 0.801449 |
350341e48ba6df997263ad2c86e6c32b023ea177 | 10,263 | py | Python | Kai/python/tools/fileloader.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | 1 | 2022-01-17T17:29:38.000Z | 2022-01-17T17:29:38.000Z | Kai/python/tools/fileloader.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | null | null | null | Kai/python/tools/fileloader.py | NJManganelli/FourTopNAOD | 9743d5b49bdbad27a74abb7b2d5b7295f678a0e3 | [
"Apache-2.0"
] | 1 | 2021-12-15T10:56:50.000Z | 2021-12-15T10:56:50.000Z | import json
from pprint import pprint
class FileLoader:
"""FileLoader takes as input an evenSet, era, and channel; it returns a list of files, a json, and a configuration dictionary.
eventSet: "TTTT", "TT", "DY", etc.
era: 2016, 2017, 2018. This corresponds to both MC tunes and Data run sets, as well as the defaul... | 51.833333 | 186 | 0.507357 |
7ef7a96cc18d760e65822d4582fffe830753dcc8 | 1,284 | py | Python | fHDHR_web/api/__init__.py | alexmerm/fHDHR | 586ffe5540a69da1430bec3dbbdcc8e86232fd03 | [
"WTFPL"
] | 39 | 2021-01-23T22:04:59.000Z | 2022-03-13T11:30:00.000Z | fHDHR_web/api/__init__.py | alexmerm/fHDHR | 586ffe5540a69da1430bec3dbbdcc8e86232fd03 | [
"WTFPL"
] | 124 | 2021-02-01T14:41:35.000Z | 2022-03-19T04:06:57.000Z | fHDHR_web/api/__init__.py | alexmerm/fHDHR | 586ffe5540a69da1430bec3dbbdcc8e86232fd03 | [
"WTFPL"
] | 12 | 2021-01-22T15:06:08.000Z | 2022-02-18T21:54:36.000Z |
from .root_url import Root_URL
from .startup_tasks import Startup_Tasks
from .settings import Settings
from .logs import Logs
from .versions import Versions
from .channels import Channels
from .origins import Origins
from .xmltv import xmlTV
from .m3u import M3U
from .w3u import W3U
from .epg import EPG
from .tuners ... | 25.176471 | 49 | 0.688474 |
15506c9d3b917a6a1bc46dffb7f880578de51951 | 5,177 | py | Python | static_compress/mixin.py | RentFreeMedia/django-static-compress | b56940b9246714401bdd0b24c2f9595419dc6671 | [
"MIT"
] | 8 | 2017-10-23T07:32:43.000Z | 2019-12-16T16:25:02.000Z | static_compress/mixin.py | RentFreeMedia/django-static-compress | b56940b9246714401bdd0b24c2f9595419dc6671 | [
"MIT"
] | 90 | 2018-06-02T07:37:29.000Z | 2022-03-31T13:01:24.000Z | static_compress/mixin.py | RentFreeMedia/django-static-compress | b56940b9246714401bdd0b24c2f9595419dc6671 | [
"MIT"
] | 8 | 2018-07-25T13:56:40.000Z | 2022-02-11T17:18:17.000Z | import os
from os.path import getatime, getctime, getmtime
import errno
from django.core.exceptions import ImproperlyConfigured
from . import compressors
__all__ = ["CompressMixin"]
DEFAULT_METHODS = ["gz", "br"]
METHOD_MAPPING = {
"gz": compressors.ZopfliCompressor,
"br": compressors.BrotliCompressor,
... | 40.131783 | 114 | 0.618119 |
3e8f653c47424631c337e80540016f32eaf3e5a2 | 14,378 | py | Python | env/lib/python3.7/site-packages/pandas/tests/series/test_repr.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 5 | 2019-07-26T15:22:41.000Z | 2021-09-28T09:22:17.000Z | env/lib/python3.7/site-packages/pandas/tests/series/test_repr.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | env/lib/python3.7/site-packages/pandas/tests/series/test_repr.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 9 | 2020-02-05T10:24:12.000Z | 2020-02-10T13:08:50.000Z | from datetime import datetime, timedelta
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Index,
Series,
date_range,
option_context,
period_range,
timedelta_range,
)
from pandas.core.base import StringMixin
from pandas.core.index import ... | 29.1643 | 103 | 0.525247 |
003e089e217978c3810712fb5e5aedd36ac27c54 | 7,584 | py | Python | tests/xbmcextra.py | dobo90/script.speedtester | 58052583bfc2ca624a489ad71df23e9038588d32 | [
"Apache-2.0"
] | 3 | 2020-09-26T08:12:00.000Z | 2021-05-01T22:12:26.000Z | tests/xbmcextra.py | dobo90/script.speedtester | 58052583bfc2ca624a489ad71df23e9038588d32 | [
"Apache-2.0"
] | 3 | 2020-10-04T11:54:28.000Z | 2022-01-26T01:59:16.000Z | tests/xbmcextra.py | dobo90/script.speedtester | 58052583bfc2ca624a489ad71df23e9038588d32 | [
"Apache-2.0"
] | 4 | 2020-09-26T09:28:23.000Z | 2021-04-27T13:05:48.000Z | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Extra functions for testing"""
# pylint: disable=invalid-name
from __future__ import absolute_import, division, print_function, unicode... | 39.915789 | 101 | 0.622495 |
8dfa6cc321dc935e54c3169d399774a302a81613 | 4,332 | py | Python | rustici_software_cloud_v2/models/xapi_credentials_list_schema.py | RusticiSoftware/scormcloud-api-v2-client-python | 04e2cce304a336caf492c3330c706840815c4abe | [
"Apache-2.0"
] | 2 | 2020-07-21T10:33:39.000Z | 2021-08-17T21:40:13.000Z | rustici_software_cloud_v2/models/xapi_credentials_list_schema.py | RusticiSoftware/scormcloud-api-v2-client-python | 04e2cce304a336caf492c3330c706840815c4abe | [
"Apache-2.0"
] | 2 | 2020-10-22T20:58:19.000Z | 2020-10-27T17:25:28.000Z | rustici_software_cloud_v2/models/xapi_credentials_list_schema.py | RusticiSoftware/scormcloud-api-v2-client-python | 04e2cce304a336caf492c3330c706840815c4abe | [
"Apache-2.0"
] | 1 | 2020-10-15T17:11:15.000Z | 2020-10-15T17:11:15.000Z | # coding: utf-8
"""
SCORM Cloud Rest API
REST API used for SCORM Cloud integrations. # noqa: E501
OpenAPI spec version: 2.0
Contact: systems@rusticisoftware.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class XapiCr... | 30.293706 | 102 | 0.597184 |
a34af95358640a2d759a673d63dd286be9a75c01 | 7,621 | py | Python | sdks/python/apache_beam/testing/test_pipeline.py | davidtime/beam | f2d19fdf7118a08d222f0028753a58347e6352fd | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/testing/test_pipeline.py | davidtime/beam | f2d19fdf7118a08d222f0028753a58347e6352fd | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/testing/test_pipeline.py | davidtime/beam | f2d19fdf7118a08d222f0028753a58347e6352fd | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 38.882653 | 80 | 0.684949 |
832f610f7857940f434164dc364cf6041afc89e9 | 16,585 | py | Python | mobile_insight/analyzer/profile.py | unknownhandX/mobileinsight-core | 5efc3d877072d0a176c5e628064c6e981f2a0342 | [
"Apache-2.0"
] | null | null | null | mobile_insight/analyzer/profile.py | unknownhandX/mobileinsight-core | 5efc3d877072d0a176c5e628064c6e981f2a0342 | [
"Apache-2.0"
] | null | null | null | mobile_insight/analyzer/profile.py | unknownhandX/mobileinsight-core | 5efc3d877072d0a176c5e628064c6e981f2a0342 | [
"Apache-2.0"
] | 1 | 2018-11-15T07:57:55.000Z | 2018-11-15T07:57:55.000Z | #!/usr/bin/python
# Filename: profile.py
"""
Profile abstraction
Author: Yuanjie Li
"""
is_android = False
try:
from jnius import autoclass # For Android
is_android = True
except Exception as e:
import sqlite3 # Laptop version
is_android = False
import ast
import os
__all__ = ["ProfileHierarchy",... | 35.063425 | 119 | 0.554175 |
569b8b3f3be6b4d89d628d7803ff5b9449c627ee | 1,986 | py | Python | tbx/core/migrations/0006_auto_20150326_1023.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 103 | 2015-02-24T17:58:21.000Z | 2022-03-23T08:08:58.000Z | tbx/core/migrations/0006_auto_20150326_1023.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 145 | 2015-01-13T17:13:43.000Z | 2022-03-29T12:56:20.000Z | tbx/core/migrations/0006_auto_20150326_1023.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 57 | 2015-01-03T12:00:37.000Z | 2022-02-09T13:11:30.000Z | # -*- coding: utf-8 -*-
from django.db import models, migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
("torchbox", "0005_auto_20150325_1631"),
]
operations = [
migrations.AlterField(
model_name="blogpage",
name="body... | 31.03125 | 86 | 0.553877 |
8608cc3343ab9fae1e85b195a0e190974b8f03ed | 2,483 | py | Python | dashbot/google.py | leonardocustodio/dashbotpy | e5ea48965d025704ec45ecbde6b49882a0def429 | [
"MIT"
] | 1 | 2020-07-08T15:03:50.000Z | 2020-07-08T15:03:50.000Z | dashbot/google.py | leonardocustodio/dashbotpy | e5ea48965d025704ec45ecbde6b49882a0def429 | [
"MIT"
] | null | null | null | dashbot/google.py | leonardocustodio/dashbotpy | e5ea48965d025704ec45ecbde6b49882a0def429 | [
"MIT"
] | 5 | 2018-09-04T15:59:05.000Z | 2020-09-22T21:21:13.000Z | import os
import datetime
import time
import json
from .version import __version__
from . import generic
class google(generic.generic):
def __init__(self,apiKey,debug=False,printErrors=False):
if 'DASHBOT_SERVER_ROOT' in os.environ:
serverRoot = os.environ['DASHBOT_SERVER_ROO... | 31.833333 | 140 | 0.510673 |
b2c0bc75aa567f1fa4a6d0ec2f6c00d2b1445ed2 | 549 | py | Python | src/solutions/solution016.py | samtcwong/daily-coding-problems | bd7da8e64a74a04f69a8b5b930100754e99b63f7 | [
"MIT"
] | null | null | null | src/solutions/solution016.py | samtcwong/daily-coding-problems | bd7da8e64a74a04f69a8b5b930100754e99b63f7 | [
"MIT"
] | null | null | null | src/solutions/solution016.py | samtcwong/daily-coding-problems | bd7da8e64a74a04f69a8b5b930100754e99b63f7 | [
"MIT"
] | null | null | null | from typing import List
# Problem #16 [Easy]
# Good morning! Here's your coding interview problem for today.
# This problem was asked by Twitter.
# You run an e-commerce website and want to record the last N order ids in a log.
# Implement a data structure to accomplish this, with the following API:
# record(order_... | 32.294118 | 104 | 0.750455 |
419d792a98470a1ef5fbf1867f740e47aa916dcc | 535 | py | Python | src/deploy/builder/stacks/migrations/0008_auto_20190529_1523.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | src/deploy/builder/stacks/migrations/0008_auto_20190529_1523.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | src/deploy/builder/stacks/migrations/0008_auto_20190529_1523.py | werelaxe/drapo | 5f78da735819200f0e7efa6a5e6b3b45ba6e0d4b | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2019-05-29 15:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stacks', '0007_auto_20190529_1520'),
]
operations = [
migrations.AlterField(
model_name='stack',
name='status',
... | 28.157895 | 203 | 0.620561 |
a792ee0ac89e30b6ef18c7c40f68ad6bc9e5bfd6 | 2,847 | py | Python | unit-tests/test_importer.py | sk-keeper/Commander | 951317ee44439302520035171baf1d098be98cc6 | [
"MIT"
] | null | null | null | unit-tests/test_importer.py | sk-keeper/Commander | 951317ee44439302520035171baf1d098be98cc6 | [
"MIT"
] | null | null | null | unit-tests/test_importer.py | sk-keeper/Commander | 951317ee44439302520035171baf1d098be98cc6 | [
"MIT"
] | null | null | null | from unittest import TestCase, mock
import pytest
from data_vault import get_synced_params, get_connected_params
from helper import KeeperApiHelper
from keepercommander.importer import importer, commands
class TestImporterUtils(TestCase):
def setUp(self):
self.communicate_mock = mock.patch('keepercomman... | 36.974026 | 116 | 0.650861 |
989777feb5db0b1661da61572aa4b2053cdb1db3 | 874 | py | Python | survey_app/tests/test_util.py | acrellin/survey_classifier_app | c54fa9faa9ce02e5c5fdf54c38194710496a5025 | [
"BSD-3-Clause"
] | null | null | null | survey_app/tests/test_util.py | acrellin/survey_classifier_app | c54fa9faa9ce02e5c5fdf54c38194710496a5025 | [
"BSD-3-Clause"
] | 9 | 2016-12-03T17:42:28.000Z | 2016-12-06T22:13:55.000Z | survey_app/tests/test_util.py | acrellin/survey_classifier_app | c54fa9faa9ce02e5c5fdf54c38194710496a5025 | [
"BSD-3-Clause"
] | null | null | null | from survey_app import util
import numpy.testing as npt
import pytest
import os
from operator import itemgetter
from collections import OrderedDict
def test_robust_literal_eval():
"""Test util.robust_literal_eval"""
params = {"n_estimators": "1000",
"max_features": "auto",
"min_wei... | 34.96 | 72 | 0.570938 |
8bd7fd4603f6055ed81c597509ecd4535e93ee0d | 1,252 | py | Python | mmcls/datasets/pipelines/__init__.py | ChaseMonsterAway/mmclassification | 85d26b8eb2fc799599c42ca33831c40707311bd7 | [
"Apache-2.0"
] | null | null | null | mmcls/datasets/pipelines/__init__.py | ChaseMonsterAway/mmclassification | 85d26b8eb2fc799599c42ca33831c40707311bd7 | [
"Apache-2.0"
] | null | null | null | mmcls/datasets/pipelines/__init__.py | ChaseMonsterAway/mmclassification | 85d26b8eb2fc799599c42ca33831c40707311bd7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .auto_augment import (AutoAugment, AutoContrast, Brightness,
ColorTransform, Contrast, Cutout, Equalize, Invert,
Posterize, RandAugment, Rotate, Sharpness, Shear,
Solarize, SolarizeAdd, ... | 52.166667 | 78 | 0.646166 |
fd024f38255e47821a5f879746d2197c188fd5bf | 1,458 | py | Python | tests/test_decorator.py | WilliamMayor/flask-clacks | 491e22e34f06cdd25532ab7952cf1fa90f6bae1e | [
"MIT"
] | 1 | 2019-03-21T06:18:47.000Z | 2019-03-21T06:18:47.000Z | tests/test_decorator.py | WilliamMayor/flask-clacks | 491e22e34f06cdd25532ab7952cf1fa90f6bae1e | [
"MIT"
] | null | null | null | tests/test_decorator.py | WilliamMayor/flask-clacks | 491e22e34f06cdd25532ab7952cf1fa90f6bae1e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from flask import Flask
from flask_clacks import clacks
app = Flask(__name__)
methods = ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH']
@app.route('/foo/', methods=methods)
@clacks
def foo():
return 'bar'
@app.route('/foo2/', methods=methods)
@clacks(names=(... | 27 | 77 | 0.650206 |
09c6f89a72e4ce72c854fb53e408adfa52c05164 | 2,404 | py | Python | src/utils/mapper.py | gchhablani/financial-sentiment-analysis | b18e9072f8edb9f09d0fef697892f2462d6d44e9 | [
"MIT"
] | 2 | 2021-10-03T14:24:52.000Z | 2021-11-17T14:55:53.000Z | src/utils/mapper.py | gchhablani/financial-sentiment-analysis | b18e9072f8edb9f09d0fef697892f2462d6d44e9 | [
"MIT"
] | null | null | null | src/utils/mapper.py | gchhablani/financial-sentiment-analysis | b18e9072f8edb9f09d0fef697892f2462d6d44e9 | [
"MIT"
] | 1 | 2021-10-03T14:25:36.000Z | 2021-10-03T14:25:36.000Z | """ Implement the ConfigMapper class.
See class docs for usage."""
class ConfigMapper:
"""Class for creating ConfigMapper objects.
This class can be used to get and store custom objects from the libraries.
For each class or object instantiated in any modules,
the ConfigMapper object can be used e... | 25.574468 | 93 | 0.557404 |
84ed24770870472015d7806c6962b9421ca24440 | 5,492 | py | Python | celiagg/__init__.py | celiagg/celia | 2eff50ab901c297e6f6e8491ddba997e325ffcb9 | [
"MIT"
] | 18 | 2016-12-11T16:44:23.000Z | 2021-10-11T11:17:40.000Z | celiagg/__init__.py | celiagg/celia | 2eff50ab901c297e6f6e8491ddba997e325ffcb9 | [
"MIT"
] | 36 | 2016-11-26T01:59:38.000Z | 2021-04-15T07:31:34.000Z | celiagg/__init__.py | pyagg/pyagg | 2eff50ab901c297e6f6e8491ddba997e325ffcb9 | [
"MIT"
] | 4 | 2016-12-22T12:53:10.000Z | 2018-10-07T17:57:50.000Z | # The MIT License (MIT)
#
# Copyright (c) 2014-2016 WUSTL ZPLAB
# Copyright (c) 2016-2021 Celiagg Contributors
#
# 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... | 33.901235 | 79 | 0.712673 |
b8bf0c85fc38af24aa8afdf2fd3a22774e88e1f7 | 409 | py | Python | misc/defaultdict.py | gingerkirsch/playing-with-python | 5c958b22e13207e65bcaa94a982d71e2fe024e22 | [
"MIT"
] | null | null | null | misc/defaultdict.py | gingerkirsch/playing-with-python | 5c958b22e13207e65bcaa94a982d71e2fe024e22 | [
"MIT"
] | null | null | null | misc/defaultdict.py | gingerkirsch/playing-with-python | 5c958b22e13207e65bcaa94a982d71e2fe024e22 | [
"MIT"
] | null | null | null | import pprint
nodes = [
('a','b'),
('a', 'c'),
('b', 'a'),
('b', 'd'),
('c', 'a'),
('d', 'a'),
('d', 'b'),
('d', 'c')
]
graph = dict()
for from_, to in nodes:
if from_ not in graph:
graph[from_] = []
graph[from_].append(to)
pprint.pprint(graph)
import collections
graph = collections... | 13.633333 | 37 | 0.540342 |
d28bf82e172690c8effbd2639168c898115f2a79 | 11,924 | py | Python | docs/conf.py | sti320a/Adafruit_CircuitPython_CCS811 | 9b04575891b741530f76e84549f697e867adf7e3 | [
"MIT"
] | 29 | 2018-06-07T14:44:56.000Z | 2022-01-27T23:50:34.000Z | docs/conf.py | sti320a/Adafruit_CircuitPython_CCS811 | 9b04575891b741530f76e84549f697e867adf7e3 | [
"MIT"
] | 23 | 2017-08-10T00:23:00.000Z | 2022-02-05T02:24:21.000Z | docs/conf.py | sti320a/Adafruit_CircuitPython_CCS811 | 9b04575891b741530f76e84549f697e867adf7e3 | [
"MIT"
] | 31 | 2017-08-10T02:16:49.000Z | 2022-02-17T10:57:38.000Z | # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# Adafruit's CCS811 Library documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 11 21:37:36 2016.
#
# This file is execfile()d with the current directory set to its
# c... | 29.22549 | 85 | 0.697165 |
bd366a96e96128cf749d2c8361794f20f4807d8b | 3,738 | py | Python | MeanShift/ML_42_MeanShift_Dynamic_bandwidth.py | vaibhav2408/machineLearningSentdex | b1b7fa75c7796cbf008877b44c3204cd5bc61960 | [
"Apache-2.0"
] | null | null | null | MeanShift/ML_42_MeanShift_Dynamic_bandwidth.py | vaibhav2408/machineLearningSentdex | b1b7fa75c7796cbf008877b44c3204cd5bc61960 | [
"Apache-2.0"
] | null | null | null | MeanShift/ML_42_MeanShift_Dynamic_bandwidth.py | vaibhav2408/machineLearningSentdex | b1b7fa75c7796cbf008877b44c3204cd5bc61960 | [
"Apache-2.0"
] | null | null | null | '''
In this machine learning tutorial, we cover the idea of a
dynamically weighted bandwidth with our Mean Shift
clustering algorithm
'''
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
import numpy as np
from sklearn.datasets.samples_generator import make_blobs
import random
X, y... | 21.482759 | 94 | 0.650348 |
8408bb08b94ecc84b2c393738e36710c4850b1fb | 4,142 | py | Python | webempresa/settings.py | jhonattanrgc21/web-empresarial | 5c382874383497aa2f7a91edf56959ad2fc1ceca | [
"MIT"
] | null | null | null | webempresa/settings.py | jhonattanrgc21/web-empresarial | 5c382874383497aa2f7a91edf56959ad2fc1ceca | [
"MIT"
] | null | null | null | webempresa/settings.py | jhonattanrgc21/web-empresarial | 5c382874383497aa2f7a91edf56959ad2fc1ceca | [
"MIT"
] | null | null | null | """
Django settings for webempresa project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
... | 26.896104 | 140 | 0.67407 |
08092c3f35a41d046b46693b744906f423caea19 | 1,623 | py | Python | app/errors.py | kajusK/HiddenPlaces | aa976f611a419bc33f8a65f0314956ec09fe2bfd | [
"MIT"
] | null | null | null | app/errors.py | kajusK/HiddenPlaces | aa976f611a419bc33f8a65f0314956ec09fe2bfd | [
"MIT"
] | null | null | null | app/errors.py | kajusK/HiddenPlaces | aa976f611a419bc33f8a65f0314956ec09fe2bfd | [
"MIT"
] | null | null | null | """ Flask error handlers."""
from flask import render_template, request
from flask import current_app as app
from flask_login import current_user
from app.database import db
from app.models.event import EventLog, UnauthorizedEvent
def error_403(error: Exception):
"""Shows error page for user with insufficient pr... | 27.508475 | 78 | 0.669747 |
b54b499d685f300254e670e35b315cf985d8a181 | 3,971 | py | Python | django/contrib/gis/gdal/feature.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/contrib/gis/gdal/feature.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/contrib/gis/gdal/feature.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
from django.utils.... | 33.091667 | 84 | 0.631327 |
d6c2073d4c496f928bb189834018bcf5cb1ac9df | 3,131 | py | Python | experiments/mnist_cINN/cond_net.py | jlmaccal/FrEIA | 64a04cb784e19bdff69546657f602fd31835c21f | [
"MIT"
] | null | null | null | experiments/mnist_cINN/cond_net.py | jlmaccal/FrEIA | 64a04cb784e19bdff69546657f602fd31835c21f | [
"MIT"
] | null | null | null | experiments/mnist_cINN/cond_net.py | jlmaccal/FrEIA | 64a04cb784e19bdff69546657f602fd31835c21f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import config as c
import data as color_data
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv = nn.Sequential(
... | 31.94898 | 95 | 0.561482 |
b9f348fdfc79ebc5c9736bc58f9042855d47b0ee | 58,479 | py | Python | test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 51.028796 | 107 | 0.541323 |
aea67febcbf29a80db4e4c7be98990aa5feb77cd | 631 | py | Python | live_poll/migrations/0008_auto_20201217_0045.py | HiroshiFuu/cs-balloting | 565eb3ee88769d88b27705828c10c7b5be964ef5 | [
"MIT"
] | null | null | null | live_poll/migrations/0008_auto_20201217_0045.py | HiroshiFuu/cs-balloting | 565eb3ee88769d88b27705828c10c7b5be964ef5 | [
"MIT"
] | null | null | null | live_poll/migrations/0008_auto_20201217_0045.py | HiroshiFuu/cs-balloting | 565eb3ee88769d88b27705828c10c7b5be964ef5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-12-17 00:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('live_poll', '0007_auto_20201217_0018'),
]
operations = [
migrations.AlterModelOptions(
name='livepollitem',
options... | 27.434783 | 154 | 0.605388 |
884f5f2af5f4a49679145b95e38e70dc0d85d744 | 773 | py | Python | setup.py | eturpin/api_python | fac15d06ef2510972ed3c812bb16a675d4e30e3c | [
"MIT"
] | 6 | 2018-12-16T19:53:57.000Z | 2020-11-22T12:36:57.000Z | setup.py | eturpin/api_python | fac15d06ef2510972ed3c812bb16a675d4e30e3c | [
"MIT"
] | 6 | 2019-02-01T13:51:59.000Z | 2020-11-23T22:42:57.000Z | setup.py | eturpin/api_python | fac15d06ef2510972ed3c812bb16a675d4e30e3c | [
"MIT"
] | 8 | 2018-12-16T19:53:48.000Z | 2021-11-24T17:08:04.000Z | from distutils.core import setup
from setuptools import find_packages
packages = [
'tsheets',
'tsheets.repos',
'tsheets.models',
]
setup(
name='tsheets',
version='0.3',
description='API library helper for TSheets.com',
long_description='Allows to use the TSheets.com API to manage the ... | 26.655172 | 109 | 0.654592 |
224e315109a7e7516f43c3945362fb59e9a0b1bd | 4,695 | py | Python | Cogs/moderation.py | Punit-Choudhary/Garuda | 85c17353c8dc7993bd4c43c8924dd532331c70df | [
"MIT"
] | 1 | 2021-11-15T14:40:10.000Z | 2021-11-15T14:40:10.000Z | Cogs/moderation.py | Punit-Choudhary/Garuda | 85c17353c8dc7993bd4c43c8924dd532331c70df | [
"MIT"
] | null | null | null | Cogs/moderation.py | Punit-Choudhary/Garuda | 85c17353c8dc7993bd4c43c8924dd532331c70df | [
"MIT"
] | 1 | 2022-01-17T07:20:38.000Z | 2022-01-17T07:20:38.000Z | import discord
import logging
from discord.ext import commands
from rich.logging import RichHandler
# setting up logging
FORMAT = "%(message)s"
logging.basicConfig(
level="INFO", format=FORMAT, datefmt="[%x]", handlers=[RichHandler()]
)
log = logging.getLogger("rich")
class ModerationCog(commands.Cog, name="M... | 35.839695 | 110 | 0.569755 |
0654602ebc81da97b1d70799a1974c3c10707d6f | 1,470 | py | Python | scripts/artifacts/installedappsVending.py | mastenp/ALEAPP | b8ac061b82d5e6df7953331cf7bb7165f7552d84 | [
"MIT"
] | 1 | 2020-10-06T20:28:16.000Z | 2020-10-06T20:28:16.000Z | scripts/artifacts/installedappsVending.py | mastenp/ALEAPP | b8ac061b82d5e6df7953331cf7bb7165f7552d84 | [
"MIT"
] | null | null | null | scripts/artifacts/installedappsVending.py | mastenp/ALEAPP | b8ac061b82d5e6df7953331cf7bb7165f7552d84 | [
"MIT"
] | null | null | null | import sqlite3
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv
def get_installedappsVending(files_found, report_folder, seeker):
file_found = str(files_found[0])
db = sqlite3.connect(file_found)
cursor = db.cursor()
cursor.execute('''
SELECT
... | 30 | 100 | 0.605442 |
67766c78681dcb3f3c0e441ff447667d25102c3b | 222 | py | Python | webium/webium/controls/webelement.py | WandyYing/vscode-remote-webium | c6291cc6f72cbc9b323221a0ef4bbba3134f7f60 | [
"Apache-2.0"
] | null | null | null | webium/webium/controls/webelement.py | WandyYing/vscode-remote-webium | c6291cc6f72cbc9b323221a0ef4bbba3134f7f60 | [
"Apache-2.0"
] | null | null | null | webium/webium/controls/webelement.py | WandyYing/vscode-remote-webium | c6291cc6f72cbc9b323221a0ef4bbba3134f7f60 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.remote.webelement import WebElement as selenium_WebElement
class WebElement(selenium_WebElement):
def __init__(self, *args, **kwargs):
super(WebElement, self).__init__(*args, **kwargs) | 37 | 82 | 0.765766 |
e0b07e55487bcd52b1f1673ee0e9f57980762a95 | 22,016 | py | Python | train.py | Dan-hbd/NMTGMinor | 84e59ac8391ee78852d7c71afc60c3c8b8e3d44d | [
"MIT"
] | 1 | 2021-06-28T06:26:36.000Z | 2021-06-28T06:26:36.000Z | train.py | Dan-hbd/NMTGMinor | 84e59ac8391ee78852d7c71afc60c3c8b8e3d44d | [
"MIT"
] | null | null | null | train.py | Dan-hbd/NMTGMinor | 84e59ac8391ee78852d7c71afc60c3c8b8e3d44d | [
"MIT"
] | null | null | null | from __future__ import division
import onmt
import onmt.markdown
import onmt.modules
import argparse
import torch
import time, datetime
from onmt.train_utils.trainer import XETrainer
from onmt.modules.loss import NMTLossFunc, NMTAndCTCLossFunc
from onmt.model_factory import build_model, optimize_model
from onmt.bayesi... | 45.487603 | 117 | 0.518895 |
3762758b1e8bd039851d1e19f4523ff05622462c | 1,215 | py | Python | scripts/filter_design/fir_comparison_example.py | CyrilCadoux/dsp-labs | 8ef53fccb87ad842051d9032d127a86c1172155f | [
"MIT"
] | 18 | 2019-08-19T13:00:36.000Z | 2022-01-14T02:32:15.000Z | scripts/filter_design/fir_comparison_example.py | CyrilCadoux/dsp-labs | 8ef53fccb87ad842051d9032d127a86c1172155f | [
"MIT"
] | 2 | 2018-12-25T18:01:03.000Z | 2018-12-26T19:13:47.000Z | scripts/filter_design/fir_comparison_example.py | CyrilCadoux/dsp-labs | 8ef53fccb87ad842051d9032d127a86c1172155f | [
"MIT"
] | 10 | 2018-12-05T07:18:48.000Z | 2021-08-12T13:46:08.000Z | import numpy as np
from scipy.io import wavfile
import os
import matplotlib.pyplot as plt
from scipy.signal import firwin, lfilter
from utils import add_offset
def apply_fir(audio, b):
y_fir = lfilter(b, a=1, x=audio)
wavfile.write(filename="audio_hpf_{}.wav".format(len(b)),
rate=fs, data=y_... | 25.851064 | 96 | 0.680658 |
42074a70bf97d48524155928441d4c65e4da609b | 76,932 | py | Python | components/espcoredump/espcoredump.py | HallLabs/esp-idf | 826b9f63805ab9b955cd2129673117080c6d29ba | [
"Apache-2.0"
] | 1 | 2020-10-25T13:14:10.000Z | 2020-10-25T13:14:10.000Z | components/espcoredump/espcoredump.py | HallLabs/esp-idf | 826b9f63805ab9b955cd2129673117080c6d29ba | [
"Apache-2.0"
] | 1 | 2020-03-04T02:32:52.000Z | 2020-03-04T02:36:39.000Z | components/espcoredump/espcoredump.py | HallLabs/esp-idf | 826b9f63805ab9b955cd2129673117080c6d29ba | [
"Apache-2.0"
] | 1 | 2020-04-28T00:28:23.000Z | 2020-04-28T00:28:23.000Z | #!/usr/bin/env python
#
# ESP32 core dump Utility
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from hashlib import sha256
import sys
try:
from builtins import zip
from builtins import str
from builtins import range
from past.utils import ... | 43.986278 | 158 | 0.59485 |
6855aa30c92d56e22044785e2ef1b10780dfa637 | 58,992 | py | Python | BMCoGAN-coupDis-sepReg.py | tasfia/BMCoGAN | 0d400c2c71dbfb69af422afc487f65afb98de8af | [
"MIT"
] | null | null | null | BMCoGAN-coupDis-sepReg.py | tasfia/BMCoGAN | 0d400c2c71dbfb69af422afc487f65afb98de8af | [
"MIT"
] | null | null | null | BMCoGAN-coupDis-sepReg.py | tasfia/BMCoGAN | 0d400c2c71dbfb69af422afc487f65afb98de8af | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 17:13:09 2020
@author: tshermin
"""
from __future__ import print_function
from easydict import EasyDict
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.autograd as autograd
import torch.optim as optim
import to... | 41.987189 | 226 | 0.6012 |
45592202eb1867bba24d7533fa67ce9da47cafc6 | 1,289 | py | Python | tests/integration/test_league.py | bsmiller25/espn-api | e06f0168eb84d9380cd29235de9de5cb3e351080 | [
"MIT"
] | 1 | 2019-10-29T01:00:02.000Z | 2019-10-29T01:00:02.000Z | tests/integration/test_league.py | bsmiller25/espn-api | e06f0168eb84d9380cd29235de9de5cb3e351080 | [
"MIT"
] | null | null | null | tests/integration/test_league.py | bsmiller25/espn-api | e06f0168eb84d9380cd29235de9de5cb3e351080 | [
"MIT"
] | null | null | null | from unittest import TestCase
from espn_api.football import League
# Integration test to make sure ESPN's API didnt change
class LeagueTest(TestCase):
def test_league_init(self):
league = League(1234, 2018)
self.assertEqual(league.current_week, 15)
def test_past_league(self):
... | 29.295455 | 115 | 0.627618 |
6ebdca2fb08a4ec1713f47c6372f464405ae9fe7 | 2,034 | py | Python | 33. Search in Rotated Sorted Array.py | JazzikPeng/Algorithm-in-Python | 915135b1cdd02a6bb8d7068a54b2f497b2ec31d4 | [
"MIT"
] | 3 | 2018-02-05T06:15:57.000Z | 2019-04-07T23:33:07.000Z | 33. Search in Rotated Sorted Array.py | JazzikPeng/Algorithm-in-Python | 915135b1cdd02a6bb8d7068a54b2f497b2ec31d4 | [
"MIT"
] | null | null | null | 33. Search in Rotated Sorted Array.py | JazzikPeng/Algorithm-in-Python | 915135b1cdd02a6bb8d7068a54b2f497b2ec31d4 | [
"MIT"
] | null | null | null | class Solution:
def normal_search(self, nums, target):
left, right = 0, len(nums)-1
while right >= left:
mid = (left+right) // 2
if nums[mid] == target:
return mid
if nums[mid] > target:
right = mid-1
else:
... | 32.285714 | 79 | 0.438545 |
6d8933aab89923b495f7681200abfe10cbeb9e08 | 2,927 | py | Python | aoc21.py | zidarsk8/aoc2020 | 21239a8bfd3cba31f16c91c28a176e1163ba4cf9 | [
"Apache-2.0"
] | 1 | 2020-12-02T08:29:50.000Z | 2020-12-02T08:29:50.000Z | aoc21.py | zidarsk8/aoc2020 | 21239a8bfd3cba31f16c91c28a176e1163ba4cf9 | [
"Apache-2.0"
] | null | null | null | aoc21.py | zidarsk8/aoc2020 | 21239a8bfd3cba31f16c91c28a176e1163ba4cf9 | [
"Apache-2.0"
] | null | null | null | import aoc21_data
from typing import List, Tuple, Set, Dict
Food = List[Tuple[Set[str], Set[str]]]
def parse(text: str) -> Food:
food = []
for line in text.splitlines():
ingredits_part, allergen_part = line.split(" (contains ")
ingredits = ingredits_part.split()
allergens = allergen... | 28.144231 | 83 | 0.65152 |
968171ca5856337ebbcd8831bce969a5064b4a21 | 2,149 | py | Python | tests/utils.py | zarumaru/metalk8s | 8c79a28c2bd28ca5b84e58ace5605cbe6183fc75 | [
"Apache-2.0"
] | null | null | null | tests/utils.py | zarumaru/metalk8s | 8c79a28c2bd28ca5b84e58ace5605cbe6183fc75 | [
"Apache-2.0"
] | null | null | null | tests/utils.py | zarumaru/metalk8s | 8c79a28c2bd28ca5b84e58ace5605cbe6183fc75 | [
"Apache-2.0"
] | null | null | null | import ipaddress
import json
import logging
import re
import testinfra
import time
from typing import Optional, Dict
import pytest
LOGGER = logging.getLogger(__name__)
def retry(operation, times=1, wait=1, error_msg=None, name="default"):
last_assert = None
for idx in range(times):
try:
... | 27.909091 | 78 | 0.58725 |
e767178b9d671cba70cfdf3131fc816c01d936b6 | 51,564 | py | Python | stellargraph/core/graph.py | ashikrafi/stellargraph | 0f6f24d21ec9c016bb370c2d705af4e876495cb4 | [
"Apache-2.0"
] | 2 | 2020-03-27T07:02:09.000Z | 2020-05-30T16:46:18.000Z | stellargraph/core/graph.py | ashikrafi/stellargraph | 0f6f24d21ec9c016bb370c2d705af4e876495cb4 | [
"Apache-2.0"
] | null | null | null | stellargraph/core/graph.py | ashikrafi/stellargraph | 0f6f24d21ec9c016bb370c2d705af4e876495cb4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2017-2020 Data61, CSIRO
#
# 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 ... | 38.480597 | 200 | 0.61031 |
f4cbcca7693f35b2fbb5a5e954bf0741b81c00ae | 2,505 | py | Python | opc.py | Tomvargas/ModX | 4fb862e11d6f66e828687dc32eed3762d41b07d5 | [
"MIT"
] | 2 | 2020-04-13T18:23:48.000Z | 2020-04-16T19:54:11.000Z | opc.py | Tomvargas/MODX | 4fb862e11d6f66e828687dc32eed3762d41b07d5 | [
"MIT"
] | null | null | null | opc.py | Tomvargas/MODX | 4fb862e11d6f66e828687dc32eed3762d41b07d5 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter.ttk import *
from tkinter import ttk
from tkinter import messagebox
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import pyplot
import time
import serial
import threading
import tkinter.messagebox
from tkinter import *
from tkinter import filedialog
from tkinter i... | 31.3125 | 102 | 0.644311 |
4292a1e847fbed0c98165616fba4372eaa7e8693 | 3,486 | py | Python | summary.py | top-quarks/ARC-solution | 1cd2e8d8ecf20c9c3d013103d317f538ea8acf8a | [
"MIT"
] | 45 | 2020-06-08T23:00:20.000Z | 2022-02-19T13:23:33.000Z | summary.py | top-quarks/ARC-solution | 1cd2e8d8ecf20c9c3d013103d317f538ea8acf8a | [
"MIT"
] | null | null | null | summary.py | top-quarks/ARC-solution | 1cd2e8d8ecf20c9c3d013103d317f538ea8acf8a | [
"MIT"
] | 5 | 2020-06-09T04:09:39.000Z | 2022-01-05T15:38:55.000Z | """from glob import glob
def read(fn):
f = open(fn)
t = f.read()
f.close()
return t
combined = ["output_id,output"]
for taski in range(419):
ids = set()
cands = []
for fn in glob("output/answer_%d_*.csv"%taski):
#if not '_13.' in fn and not '_3.' in fn: continue
t = read(fn... | 24.377622 | 97 | 0.552783 |
74443e86cd3689104f126d9f0414120e8e9cca83 | 363 | py | Python | rest_framework_bulk/tests/simple_app/urls.py | livingbio/django-rest-framework-bulk | d69902d706aa236559a4b6ae7748b482418762f2 | [
"MIT"
] | null | null | null | rest_framework_bulk/tests/simple_app/urls.py | livingbio/django-rest-framework-bulk | d69902d706aa236559a4b6ae7748b482418762f2 | [
"MIT"
] | null | null | null | rest_framework_bulk/tests/simple_app/urls.py | livingbio/django-rest-framework-bulk | d69902d706aa236559a4b6ae7748b482418762f2 | [
"MIT"
] | null | null | null | from __future__ import print_function, unicode_literals
from django.conf.urls import url, include
from rest_framework_bulk.routes import BulkRouter
from .views import SimpleViewSet
app_name = 'test'
router = BulkRouter()
router.register('simple', SimpleViewSet, 'simple')
urlpatterns = (
url(r'^api/', include((... | 22.6875 | 67 | 0.757576 |
cd1ff5f3edcd5e139eca97102600dd30e828b7f6 | 304 | py | Python | employmentstatusprobability.py | virtualsociety/simulation-py | 89ba16cfcb0743aedc4eb669ed9853989aeebee1 | [
"MIT"
] | null | null | null | employmentstatusprobability.py | virtualsociety/simulation-py | 89ba16cfcb0743aedc4eb669ed9853989aeebee1 | [
"MIT"
] | null | null | null | employmentstatusprobability.py | virtualsociety/simulation-py | 89ba16cfcb0743aedc4eb669ed9853989aeebee1 | [
"MIT"
] | null | null | null | '''
Function to calculate the employment status probability
By Dr. Raymond Hoogendoorn
Copyright 2020
'''
def calculateEmploymentStatusProbability(df_employment, baseyear):
year = str(baseyear)
prob_dist = df_employment[year]
prob_dist = prob_dist / sum(prob_dist)
return prob_dist
| 23.384615 | 66 | 0.756579 |
d277ad2fc1262bd2c66418d4ac747bb431c28868 | 428 | py | Python | demosys/resources/data.py | Contraz/demosys-py | 0479e0f3b0a3901f601bffd2d11e155f97b47555 | [
"0BSD"
] | 70 | 2017-03-31T12:01:41.000Z | 2022-01-05T06:30:57.000Z | demosys/resources/data.py | Contraz/demosys-py | 0479e0f3b0a3901f601bffd2d11e155f97b47555 | [
"0BSD"
] | 69 | 2017-06-18T22:37:46.000Z | 2020-01-23T04:02:22.000Z | demosys/resources/data.py | Contraz/demosys-py | 0479e0f3b0a3901f601bffd2d11e155f97b47555 | [
"0BSD"
] | 9 | 2017-05-13T21:13:02.000Z | 2020-10-01T18:09:49.000Z | """
Registry general data files
"""
from demosys.conf import settings
from demosys.resources.base import BaseRegistry
from demosys.utils.module_loading import import_string
class DataFiles(BaseRegistry):
"""Registry for requested data files"""
def __init__(self):
super().__init__()
self._loade... | 22.526316 | 69 | 0.705607 |
d3ee7c5e9886615e6017ec30f1c5758f49456480 | 1,622 | py | Python | tool/githubify.py | coinjet/ripple-dev-portal | ade1cf861813a1735784671613b2800864b14788 | [
"Apache-2.0"
] | null | null | null | tool/githubify.py | coinjet/ripple-dev-portal | ade1cf861813a1735784671613b2800864b14788 | [
"Apache-2.0"
] | null | null | null | tool/githubify.py | coinjet/ripple-dev-portal | ade1cf861813a1735784671613b2800864b14788 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python3
"""
Convert between Dev-Portal-ready markdown and Github-ready markdown. Has two modes:
Normal - Convert from Dev Portal format to Github:
* Comments out divs that the dev portal uses to generate tabs, so that Github parses the markdown inside
* Replaces local relative links with absolute lin... | 33.102041 | 108 | 0.619605 |
6239c7e16a83312ec568640d46f48398e08dbd01 | 6,701 | py | Python | config/settings/production.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | 1 | 2021-11-27T06:40:34.000Z | 2021-11-27T06:40:34.000Z | config/settings/production.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | 2 | 2021-05-13T04:50:50.000Z | 2022-02-28T21:06:24.000Z | config/settings/production.py | gfavre/invoice-manager | 2a1db22edd51b461c090282c6fc1f290f3265379 | [
"MIT"
] | null | null | null | import logging
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------... | 38.511494 | 88 | 0.600358 |
2668134eb65738a2db35b00e80acf49bf0cc167b | 10,978 | py | Python | src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/file.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | 2 | 2020-07-22T18:53:05.000Z | 2021-09-11T05:52:33.000Z | src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/file.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/file.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 44.266129 | 100 | 0.624157 |
e4da84832ddaec0f421822628e60b2fd1ed59482 | 2,775 | py | Python | examples/extensions/sudoku.py | jasondark/cvxpy | 56aaa01b0e9d98ae5a91a923708129a7b37a6f18 | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2015-06-03T01:33:46.000Z | 2021-11-15T01:48:49.000Z | examples/extensions/sudoku.py | h-vetinari/cvxpy | 86307f271819bb78fcdf64a9c3a424773e8269fa | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-11-02T21:36:05.000Z | 2019-11-02T21:36:05.000Z | examples/extensions/sudoku.py | h-vetinari/cvxpy | 86307f271819bb78fcdf64a9c3a424773e8269fa | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-10-22T01:35:58.000Z | 2022-01-19T10:48:51.000Z | """
Copyright 2013 Steven Diamond
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 28.316327 | 83 | 0.557117 |
c2f7fe7f3bef71896a7e0ac0427b3e6bb56268c1 | 5,393 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/NV/float_buffer.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/NV/float_buffer.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/NV/float_buffer.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | '''OpenGL extension NV.float_buffer
Overview (from the spec)
This extension builds upon NV_fragment_program to provide a framebuffer
and texture format that allows fragment programs to read and write
unconstrained floating point data.
In unextended OpenGL, most computations dealing with color or depth
buffers... | 52.872549 | 94 | 0.787131 |
6a400cf97c1963b044e2476f0ca7b4eed93c1c76 | 1,278 | py | Python | lesson2-09/solution2_9.py | nmpegetis/udacity-facebook-pytorch | 36a9de03c71892836e184e58695143960c6a7d2b | [
"MIT"
] | null | null | null | lesson2-09/solution2_9.py | nmpegetis/udacity-facebook-pytorch | 36a9de03c71892836e184e58695143960c6a7d2b | [
"MIT"
] | null | null | null | lesson2-09/solution2_9.py | nmpegetis/udacity-facebook-pytorch | 36a9de03c71892836e184e58695143960c6a7d2b | [
"MIT"
] | null | null | null | import pandas as pd
# Set initial values w1, w2, and bias for the linear equation 3*x1+4*x2-10
w1 = 3.0
w2 = 4.0
bias = -10.0
# Inputs and outputs
misclassified_inputPoint_coords = (1, 1)
outputs = []
condition = False
times = 0
learning_rate = 0.1
is_correct_string = ''
while condition == False:
calculated_w1 =... | 33.631579 | 125 | 0.694836 |
84ef31cf6b690f94e2d27e2c0a2c4502afb26e9c | 7,454 | py | Python | preprocess/cskb_merge.py | HKUST-KnowComp/CSKB-Population | 7b1b2d25fbd0095b0cf009b933cfd5a62feadd58 | [
"MIT"
] | 13 | 2021-09-10T03:41:02.000Z | 2022-03-30T09:53:12.000Z | preprocess/cskb_merge.py | HKUST-KnowComp/CSKB-Population | 7b1b2d25fbd0095b0cf009b933cfd5a62feadd58 | [
"MIT"
] | 1 | 2022-02-09T23:08:33.000Z | 2022-03-22T22:28:37.000Z | preprocess/cskb_merge.py | HKUST-KnowComp/CSKB-Population | 7b1b2d25fbd0095b0cf009b933cfd5a62feadd58 | [
"MIT"
] | 2 | 2021-10-12T13:15:35.000Z | 2021-11-17T08:46:46.000Z | import pandas as pd
from random import sample
import networkx as nx
import numpy as np
from tqdm import tqdm, trange
import networkx as nx
import sys
sys.path.append("../")
sys.path.append("../Glucose")
from utils.utils import subject_list, object_list, group_list
from Glucose.utils.aser_to_glucose import generate_aser... | 43.086705 | 115 | 0.645157 |
a64124d932f1629d4dc088873129b8537dfa20ad | 1,821 | py | Python | samples/samplesPY/arch/axes_normalized.py | preisach/animations | 07dc9598eee7ed3f73e35b99dd6c44c525a976d5 | [
"MIT"
] | null | null | null | samples/samplesPY/arch/axes_normalized.py | preisach/animations | 07dc9598eee7ed3f73e35b99dd6c44c525a976d5 | [
"MIT"
] | null | null | null | samples/samplesPY/arch/axes_normalized.py | preisach/animations | 07dc9598eee7ed3f73e35b99dd6c44c525a976d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 1 12:21:56 2019
@author: m
"""
import matplotlib.pyplot as plt
# fig = plt.figure()
fig = plt.figure(figsize=(6,6))
# want some y padding
# oops there is surely a padding function, anyway, this works
plt.plot([-0.1, 1.1], [-0.2,1.2], col... | 31.947368 | 94 | 0.612301 |
11ed5fd766fc51d7d4393812fb02195037e1040e | 23,721 | py | Python | Play Tic-tac-toe against computer CLI.py | BigBIueWhale/play_Tic-tac-toe | 41e223d394d8aba383803730f3ec54c27dafbc71 | [
"Unlicense"
] | null | null | null | Play Tic-tac-toe against computer CLI.py | BigBIueWhale/play_Tic-tac-toe | 41e223d394d8aba383803730f3ec54c27dafbc71 | [
"Unlicense"
] | null | null | null | Play Tic-tac-toe against computer CLI.py | BigBIueWhale/play_Tic-tac-toe | 41e223d394d8aba383803730f3ec54c27dafbc71 | [
"Unlicense"
] | null | null | null | import copy
import random
import json
import pickle
def listPoss():
poss = [] #possibilities of game endings when x starts (symmetrical to 0 trarts), there are 255168 of those
#poss contains the lists of the moves that led to the game endings. first value of each poss list of moves moves is the outcome of tho... | 44.091078 | 192 | 0.597277 |
79f0508cc5a21b673fda2a47bac8c8965f18b685 | 29 | py | Python | wt/macros.py | aarnav25/WorkingTitle | ab007b3c4d910b756da78355817e4442b24c7684 | [
"MIT"
] | null | null | null | wt/macros.py | aarnav25/WorkingTitle | ab007b3c4d910b756da78355817e4442b24c7684 | [
"MIT"
] | null | null | null | wt/macros.py | aarnav25/WorkingTitle | ab007b3c4d910b756da78355817e4442b24c7684 | [
"MIT"
] | 1 | 2018-03-12T22:50:15.000Z | 2018-03-12T22:50:15.000Z | """quote unquote scripts."""
| 14.5 | 28 | 0.655172 |
5fde535d514dba8ff8e60ba0fb77834492e76dc1 | 203 | py | Python | news-app-env/Scripts/django-admin.py | suryapalla/tell-me-news | 1c308e586074ed8d31500227ed808215afc9cf41 | [
"MIT"
] | null | null | null | news-app-env/Scripts/django-admin.py | suryapalla/tell-me-news | 1c308e586074ed8d31500227ed808215afc9cf41 | [
"MIT"
] | 5 | 2021-03-30T13:41:24.000Z | 2021-09-22T19:13:38.000Z | news-app-env/Scripts/django-admin.py | suryapalla/tell-me-news | 1c308e586074ed8d31500227ed808215afc9cf41 | [
"MIT"
] | null | null | null | #!c:\users\pakumar\django_projects\git_hub_projects\tell-me-news\news-app-env\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 33.833333 | 96 | 0.802956 |
34955960dd57cff39f62de6bf3a7253dbf9ed9c9 | 4,252 | py | Python | src/submission_plain.py | ternaus/kaggle_wallmart | 073dcf7bbc3e0ac6201b0aae0bba44f5fb71f835 | [
"MIT"
] | null | null | null | src/submission_plain.py | ternaus/kaggle_wallmart | 073dcf7bbc3e0ac6201b0aae0bba44f5fb71f835 | [
"MIT"
] | null | null | null | src/submission_plain.py | ternaus/kaggle_wallmart | 073dcf7bbc3e0ac6201b0aae0bba44f5fb71f835 | [
"MIT"
] | null | null | null | from __future__ import division
__author__ = 'Vladimir Iglovikov'
# import pandas as pd
import numpy as np
import os
import graphlab as gl
from graphlab import SFrame
import pandas as pd
def merge_data(df):
return ''.join([str(df["store_nbr"]), "_", str(df["item_nbr"]), "_", df["date"]])
ind = True
weather = ... | 26.08589 | 137 | 0.55762 |
03572997c74a8ac44bf388d308db733ec71033dc | 11,246 | py | Python | src/inference_rigid.py | octavian-ganea/equidock_public | ac2c754399bf20b50a27d86dbff4f6669788d47f | [
"MIT"
] | 73 | 2022-02-04T23:03:16.000Z | 2022-03-31T08:08:34.000Z | src/inference_rigid.py | octavian-ganea/equidock_public | ac2c754399bf20b50a27d86dbff4f6669788d47f | [
"MIT"
] | 6 | 2022-02-06T03:21:35.000Z | 2022-03-22T03:44:57.000Z | src/inference_rigid.py | octavian-ganea/equidock_public | ac2c754399bf20b50a27d86dbff4f6669788d47f | [
"MIT"
] | 21 | 2022-02-04T22:49:39.000Z | 2022-03-30T12:36:44.000Z | import os
import torch
os.environ['DGLBACKEND'] = 'pytorch'
from datetime import datetime as dt
from src.utils.protein_utils import preprocess_unbound_bound, protein_to_graph_unbound_bound
from biopandas.pdb import PandasPdb
from src.utils.train_utils import *
from src.utils.args import *
from src.utils.ot_utils imp... | 44.984 | 165 | 0.64165 |
e17ddf88e73770bffcba1a5a77a5cdb6144b19f6 | 1,490 | py | Python | aliyun-python-sdk-openanalytics-open/aliyunsdkopenanalytics_open/request/v20180619/GetRdsInstanceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-openanalytics-open/aliyunsdkopenanalytics_open/request/v20180619/GetRdsInstanceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-openanalytics-open/aliyunsdkopenanalytics_open/request/v20180619/GetRdsInstanceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.210526 | 98 | 0.774497 |
7d49c8a91505855ee1b0607fe6e0e03416f785e7 | 4,158 | py | Python | django_faker/templatetags/fakers.py | rpatterson/django-faker | 77df5f92fdf5e300e4b1ba512bbd82d3c0010108 | [
"MIT"
] | null | null | null | django_faker/templatetags/fakers.py | rpatterson/django-faker | 77df5f92fdf5e300e4b1ba512bbd82d3c0010108 | [
"MIT"
] | null | null | null | django_faker/templatetags/fakers.py | rpatterson/django-faker | 77df5f92fdf5e300e4b1ba512bbd82d3c0010108 | [
"MIT"
] | 2 | 2018-11-26T13:48:40.000Z | 2019-01-04T12:33:50.000Z | from inspect import getargspec
from django.template.base import TemplateSyntaxError
from django import template
from django.template.library import parse_bits
register = template.Library()
from django_faker import DjangoFaker
# *** Django allows for optional assignment out of box now with simple tags now ***
# def o... | 29.489362 | 87 | 0.588264 |
bbbf27c6425b5cc573de39c279b5fb12b1dd6338 | 2,258 | py | Python | plugins/snowflake/setup.py | tashay/dbt | 84420675e0c6dcef05b0c53908b326b59c7da23c | [
"Apache-2.0"
] | null | null | null | plugins/snowflake/setup.py | tashay/dbt | 84420675e0c6dcef05b0c53908b326b59c7da23c | [
"Apache-2.0"
] | null | null | null | plugins/snowflake/setup.py | tashay/dbt | 84420675e0c6dcef05b0c53908b326b59c7da23c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if sys.version_info < (3, 6):
print('Error: dbt does not support this version of Python.')
print('Please upgrade to Python 3.6 or higher.')
sys.exit(1)
from setuptools import setup
try:
from setuptools import find_namespace_packages
except ImportError:
#... | 30.931507 | 78 | 0.64039 |
7251a81a81d27c220bbcdb1664f4b427531d3934 | 6,537 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 40.85625 | 161 | 0.652746 |
a4a3f9c1156aa60f8aa386b6648c833bc0cfde9d | 1,439 | py | Python | test/persistent.py | leifdenby/rlite-py | 90f0726bfb8173d7afa4fc87d75e28b627c10020 | [
"BSD-2-Clause"
] | 73 | 2015-03-02T18:57:57.000Z | 2022-02-19T22:27:24.000Z | test/persistent.py | leifdenby/rlite-py | 90f0726bfb8173d7afa4fc87d75e28b627c10020 | [
"BSD-2-Clause"
] | 6 | 2015-03-26T04:06:45.000Z | 2017-04-09T23:04:38.000Z | test/persistent.py | leifdenby/rlite-py | 90f0726bfb8173d7afa4fc87d75e28b627c10020 | [
"BSD-2-Clause"
] | 8 | 2015-03-04T09:54:25.000Z | 2022-01-13T05:05:31.000Z | # coding=utf-8
from unittest import *
import os.path
import sys
import hirlite
class PersistentTest(TestCase):
PATH = 'rlite.rld'
def setUp(self):
if os.path.exists(PersistentTest.PATH):
os.unlink(PersistentTest.PATH)
self.rlite = hirlite.Rlite(PersistentTest.PATH)
def tearDo... | 39.972222 | 112 | 0.660876 |
f716f3a29096b6b3d1684fa66a9f8119736e670b | 468 | py | Python | contentcuration/contentcuration/migrations/0015_auto_20160914_1640.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2019-03-30T18:14:25.000Z | 2019-03-30T18:14:25.000Z | contentcuration/contentcuration/migrations/0015_auto_20160914_1640.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 4 | 2016-05-06T17:19:30.000Z | 2019-03-15T01:51:24.000Z | contentcuration/contentcuration/migrations/0015_auto_20160914_1640.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 4 | 2016-10-18T22:49:08.000Z | 2019-09-17T11:20:51.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-14 23:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0014_channel_language'),
]
operations = [
migrations.Alte... | 22.285714 | 58 | 0.623932 |
d3b92914a74b2a5966ec0869e4a3616cfcf636fd | 250 | py | Python | createdb.py | fijal/ocd | c1a96e322b8b8945299680c492d7fba137b3e5dd | [
"MIT"
] | null | null | null | createdb.py | fijal/ocd | c1a96e322b8b8945299680c492d7fba137b3e5dd | [
"MIT"
] | null | null | null | createdb.py | fijal/ocd | c1a96e322b8b8945299680c492d7fba137b3e5dd | [
"MIT"
] | null | null | null |
import sys
from sqlalchemy import create_engine
from ocd.model import meta
def create_db(url):
eng = create_engine(url)
with eng.connect():
meta.create_all(eng)
return eng
if __name__ == '__main__':
create_db(sys.argv[1]) | 16.666667 | 36 | 0.692 |
57d755ac16fbef46880ae2ebf5882b98f5d80179 | 229 | py | Python | pieseis/utils/config.py | JoeXinfa/pieseis | 4898cf7811c582ecb0bf02e18b326d21698d9c78 | [
"CC-BY-4.0"
] | 2 | 2018-11-19T16:16:51.000Z | 2020-04-05T01:47:56.000Z | pieseis/utils/config.py | JoeXinfa/pieseis | 4898cf7811c582ecb0bf02e18b326d21698d9c78 | [
"CC-BY-4.0"
] | 1 | 2020-02-24T15:52:47.000Z | 2020-02-24T15:52:47.000Z | pieseis/utils/config.py | JoeXinfa/pieseis | 4898cf7811c582ecb0bf02e18b326d21698d9c78 | [
"CC-BY-4.0"
] | 2 | 2019-09-15T14:29:29.000Z | 2020-04-05T01:48:56.000Z | """
This python config files sets the most used config constants and such
"""
#import os
NAME = "pieseis"
LOG_FILE = "pyseis.log"
# While debugging / developing, set by default to True
#DEBUG = os.getenv("DEBUG")
DEBUG = False
| 19.083333 | 69 | 0.716157 |
adaee8e36b8a2437264590a8ea934a00850409d1 | 969 | py | Python | tests/test_largest_factor.py | Melon-Bread/tdd-demo | 52c93b27cc496aa3950b8bb6eaf56a6c9d781271 | [
"MIT"
] | 2 | 2017-12-08T21:44:17.000Z | 2019-04-19T01:36:24.000Z | tests/test_largest_factor.py | Melon-Bread/tdd-demo | 52c93b27cc496aa3950b8bb6eaf56a6c9d781271 | [
"MIT"
] | null | null | null | tests/test_largest_factor.py | Melon-Bread/tdd-demo | 52c93b27cc496aa3950b8bb6eaf56a6c9d781271 | [
"MIT"
] | 3 | 2015-03-19T01:31:16.000Z | 2019-09-27T18:08:03.000Z | import pytest
from largest_factor import largest_factor
number_to_largest_prime_factor = {
2: 2,
3: 3,
5: 5,
2**2 * 13: 13,
2**3 * 3**2: 3,
5*7*11: 11,
5*7*11*11: 11,
2**100: 2,
}
@pytest.mark.parametrize('number, expected_largest_prime_factor', number_to_largest_prime_factor.items())
... | 28.5 | 105 | 0.732714 |
a56e29cf52c4e6d73f8229be40417d7e5b20db79 | 1,774 | py | Python | lib/sqlalchemy/sql/__init__.py | jmagnusson/sqlalchemy | 0e7904e730c3d2b0d3a394ad60010158ee29050c | [
"MIT"
] | null | null | null | lib/sqlalchemy/sql/__init__.py | jmagnusson/sqlalchemy | 0e7904e730c3d2b0d3a394ad60010158ee29050c | [
"MIT"
] | null | null | null | lib/sqlalchemy/sql/__init__.py | jmagnusson/sqlalchemy | 0e7904e730c3d2b0d3a394ad60010158ee29050c | [
"MIT"
] | null | null | null | # sql/__init__.py
# Copyright (C) 2005-2016 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
from .expression import (
Alias,
ClauseElement,
ColumnCollection,
Co... | 18.479167 | 77 | 0.654453 |
8656d3a2098e28bf55fe9235cf9297dd49baa69c | 2,064 | py | Python | applications/address/views.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/address/views.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/address/views.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.conf import settings
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from mighty.views import TemplateView, FormDescView
from mighty.applications.address import get_address_backend
from mighty.applications.a... | 38.222222 | 76 | 0.742733 |
2655fdc665fbb4a20fd4d4e2681705c2bd9cd455 | 1,916 | py | Python | tests/test_emulator/test_kernels.py | spencerhurt/Starfish | fd38aadbd94d83fcdf0ff8c3ce29d8aad6bea88a | [
"BSD-3-Clause"
] | 53 | 2015-01-21T19:26:37.000Z | 2021-05-13T16:23:26.000Z | tests/test_emulator/test_kernels.py | spencerhurt/Starfish | fd38aadbd94d83fcdf0ff8c3ce29d8aad6bea88a | [
"BSD-3-Clause"
] | 112 | 2015-01-20T11:11:27.000Z | 2021-06-01T13:57:28.000Z | tests/test_emulator/test_kernels.py | spencerhurt/Starfish | fd38aadbd94d83fcdf0ff8c3ce29d8aad6bea88a | [
"BSD-3-Clause"
] | 20 | 2015-01-13T22:45:03.000Z | 2021-05-20T22:47:10.000Z | import numpy as np
import pytest
from Starfish.emulator.kernels import rbf_kernel, batch_kernel
@pytest.fixture
def mock_params():
params = np.array((100, 1, 0.1), dtype=np.double) * np.random.randn(
200, 3
) + np.tile((6000, 4, 0), (200, 1))
return params
@pytest.fixture
def mock_kern_params()... | 34.214286 | 82 | 0.670146 |
f0d325201dfeda4833a85bd7148f4bdd3bd9f18e | 135 | py | Python | python_pillow/100.file.read_write.py | takenobu-hs/pixel-manipulation-examples | ceaefefd2d7bcf1fcce98cc09118c527f2cde42d | [
"BSD-3-Clause"
] | null | null | null | python_pillow/100.file.read_write.py | takenobu-hs/pixel-manipulation-examples | ceaefefd2d7bcf1fcce98cc09118c527f2cde42d | [
"BSD-3-Clause"
] | null | null | null | python_pillow/100.file.read_write.py | takenobu-hs/pixel-manipulation-examples | ceaefefd2d7bcf1fcce98cc09118c527f2cde42d | [
"BSD-3-Clause"
] | null | null | null |
from PIL import Image
#-- read pixels
im = Image.open('../images/img001.png').convert('RGB')
#-- save to png
im.save('z100.png')
| 11.25 | 54 | 0.637037 |
0a39512324cafb2ac792dcdb1a76bf96e77b759a | 314 | py | Python | core/providers/__init__.py | CarboniDavide/rtscan | 3fe447235d0534a7d66e7d6f5e8b9c00d8832b4f | [
"MIT"
] | null | null | null | core/providers/__init__.py | CarboniDavide/rtscan | 3fe447235d0534a7d66e7d6f5e8b9c00d8832b4f | [
"MIT"
] | null | null | null | core/providers/__init__.py | CarboniDavide/rtscan | 3fe447235d0534a7d66e7d6f5e8b9c00d8832b4f | [
"MIT"
] | null | null | null | from .socket_provider import SocketProvider
from .pcapy_provider import PcapyProvider
from .provider import Provider
from core.exceptions import *
class ProviderType():
Socket = "SocketProvider"
Pcapy = "PcapyProvider"
def create(providerType, device=None):
return globals()[providerType](device) | 28.545455 | 46 | 0.773885 |
d9529807e6c0843bc06c22c227df5d8e283d2fed | 837 | py | Python | restaurants_addresses_webscraping/restaurants_addresses_webscraping/spiders/restaurants_addresses_spider.py | calinjovrea/AIFinancialStatusTask | 47c032e9ddb7142ee8ef4eebca8c0126909f29f3 | [
"MIT"
] | null | null | null | restaurants_addresses_webscraping/restaurants_addresses_webscraping/spiders/restaurants_addresses_spider.py | calinjovrea/AIFinancialStatusTask | 47c032e9ddb7142ee8ef4eebca8c0126909f29f3 | [
"MIT"
] | null | null | null | restaurants_addresses_webscraping/restaurants_addresses_webscraping/spiders/restaurants_addresses_spider.py | calinjovrea/AIFinancialStatusTask | 47c032e9ddb7142ee8ef4eebca8c0126909f29f3 | [
"MIT"
] | null | null | null | import scrapy
class AddressSpider(scrapy.Spider):
name = "addressesofrestaurants"
def start_requests(self):
urls = [
'https://tosseduk.com/locations/baker-street/',
'https://www.gbk.co.uk/location/covent-garden?address',
'https://www.superfishuk.co.uk/branche... | 33.48 | 104 | 0.593787 |
17153c2c7c152ef0bd143fd6e67bf1d9fbb3dd32 | 1,489 | py | Python | benchmark/kernel/sort_pool.py | itamblyn/pytorch_geometric | 67ed16492863378b8434b03713a75924f0cc5df1 | [
"MIT"
] | 2 | 2020-08-06T16:14:15.000Z | 2021-11-08T07:33:21.000Z | benchmark/kernel/sort_pool.py | ChenShengsGitHub/pytorch_geometric | 86308313d6f1af56e5931e2ca89bb1a867c10ff3 | [
"MIT"
] | 1 | 2021-11-29T18:14:13.000Z | 2021-11-29T18:14:13.000Z | benchmark/kernel/sort_pool.py | ChenShengsGitHub/pytorch_geometric | 86308313d6f1af56e5931e2ca89bb1a867c10ff3 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from torch.nn import Linear, Conv1d
from torch_geometric.nn import SAGEConv, global_sort_pool
class SortPool(torch.nn.Module):
def __init__(self, dataset, num_layers, hidden):
super().__init__()
self.k = 30
self.conv1 = SAGEConv(dataset.num_feat... | 34.627907 | 66 | 0.611148 |
e757ccf3825a81d98e3b312f4195613b1ebbc4f2 | 1,897 | py | Python | gs_manager/servers/__init__.py | AngellusMortis/game_server_manager | f288a5dee08acee83cca6935c742e0e82cc281ff | [
"MIT"
] | 6 | 2017-12-11T20:42:37.000Z | 2021-01-17T02:24:44.000Z | gs_manager/servers/__init__.py | AngellusMortis/game_server_manager | f288a5dee08acee83cca6935c742e0e82cc281ff | [
"MIT"
] | null | null | null | gs_manager/servers/__init__.py | AngellusMortis/game_server_manager | f288a5dee08acee83cca6935c742e0e82cc281ff | [
"MIT"
] | 1 | 2020-07-27T18:37:41.000Z | 2020-07-27T18:37:41.000Z | import importlib
import inspect
import sys
from typing import List, Optional
from gs_manager.servers.base import (
STATUS_FAILED,
STATUS_PARTIAL_FAIL,
STATUS_SUCCESS,
BaseServer,
EmptyServer,
)
from gs_manager.servers.generic import (
JavaServer,
RconServer,
ScreenServer,
SteamServe... | 24.320513 | 71 | 0.656827 |
aa73c431ecd8b59c21f79dbf209cefec258347a3 | 3,205 | py | Python | deep_rl/component/memory_lineworld.py | psurya1994/successor-feature-representations | efbd5ad49d574aebee68762d1f2c1a0a4a2b8b28 | [
"MIT"
] | null | null | null | deep_rl/component/memory_lineworld.py | psurya1994/successor-feature-representations | efbd5ad49d574aebee68762d1f2c1a0a4a2b8b28 | [
"MIT"
] | null | null | null | deep_rl/component/memory_lineworld.py | psurya1994/successor-feature-representations | efbd5ad49d574aebee68762d1f2c1a0a4a2b8b28 | [
"MIT"
] | 1 | 2021-04-30T08:14:15.000Z | 2021-04-30T08:14:15.000Z | import numpy as np
import gym
from gym import spaces
import matplotlib.pyplot as plt
import random
from PIL import Image, ImageDraw, ImageFont
class MemoryLineWorld(gym.Env):
def __init__(self, size=5, p=0, horizon=100):
# Setting things up
self.updates = 0
self.size = size # size of the... | 28.616071 | 140 | 0.583775 |
b7d897ed0d62b06fd474c3ac0dbf62be0c4d372b | 3,694 | py | Python | TBConsumer.py | PHT-Medic/central-train-builder | 4e557a30dbfd8a96df577e1ce550268cf46f6d22 | [
"MIT"
] | null | null | null | TBConsumer.py | PHT-Medic/central-train-builder | 4e557a30dbfd8a96df577e1ce550268cf46f6d22 | [
"MIT"
] | 19 | 2021-11-22T12:20:33.000Z | 2022-03-15T11:14:32.000Z | TBConsumer.py | PHT-EU/central-train-builder | 4e557a30dbfd8a96df577e1ce550268cf46f6d22 | [
"MIT"
] | null | null | null | import pika
from train_lib.clients import Consumer, PHTClient
from train_lib.clients.rabbitmq import LOG_FORMAT
import json
from dotenv import load_dotenv, find_dotenv
import os
import logging
from builder.train_builder import TrainBuilder, BuildStatus
from loguru import logger
from builder.messages import BuilderResp... | 37.313131 | 114 | 0.652139 |
a1fdfc0392e7ec3a879817b9fecafadf5a6b62b5 | 1,727 | py | Python | misc.py | xw-hu/DGNL-Net | 44e8516429fe8a4e7db615573454b24f51f595cc | [
"BSD-2-Clause"
] | 12 | 2020-10-20T07:16:05.000Z | 2022-03-16T13:28:44.000Z | misc.py | xw-hu/DGNL-Net | 44e8516429fe8a4e7db615573454b24f51f595cc | [
"BSD-2-Clause"
] | null | null | null | misc.py | xw-hu/DGNL-Net | 44e8516429fe8a4e7db615573454b24f51f595cc | [
"BSD-2-Clause"
] | 3 | 2021-09-19T10:57:41.000Z | 2022-03-04T11:36:37.000Z | import os
import random
from torch.autograd import Variable
import torch
class AvgMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
sel... | 26.166667 | 91 | 0.568037 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.