hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
50aad8671045ef73ebdd66a68ab6ad51ab1d12d9 | 5,781 | py | Python | allennlp/data/token_indexers/pretrained_transformer_mismatched_indexer.py | lgessler/allennlp | 0e64b4d3281808fac0fe00cc5b56e5378dbb7615 | [
"Apache-2.0"
] | 1 | 2021-05-18T01:26:52.000Z | 2021-05-18T01:26:52.000Z | allennlp/data/token_indexers/pretrained_transformer_mismatched_indexer.py | lgessler/allennlp | 0e64b4d3281808fac0fe00cc5b56e5378dbb7615 | [
"Apache-2.0"
] | 66 | 2020-10-26T18:47:03.000Z | 2022-03-29T13:04:30.000Z | allennlp/data/token_indexers/pretrained_transformer_mismatched_indexer.py | lgessler/allennlp | 0e64b4d3281808fac0fe00cc5b56e5378dbb7615 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Any, Optional
import logging
from overrides import overrides
import torch
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.vocabulary import Vocabulary
from allennlp.data.tokenizers.token import Token
from allennlp.data.token_indexers import PretrainedTransform... | 44.469231 | 161 | 0.691403 |
bb5ff90b334da4ff55b749fdcceb78e6b7652ee9 | 177 | py | Python | atest/testdata/test_libraries/nön_äscii_dïr/valid.py | robotframework/robotframework | 8b149711c0d20869ac707041ab1086d87efd3c4d | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | atest/testdata/test_libraries/nön_äscii_dïr/valid.py | robotframework/robotframework | 8b149711c0d20869ac707041ab1086d87efd3c4d | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | atest/testdata/test_libraries/nön_äscii_dïr/valid.py | robotframework/robotframework | 8b149711c0d20869ac707041ab1086d87efd3c4d | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | def keyword_in_non_ascii_dir():
return "Keyword in 'nön_äscii_dïr'!"
def failing_keyword_in_non_ascii_dir():
raise AssertionError("Keyword in 'nön_äscii_dïr' fails!")
| 25.285714 | 61 | 0.768362 |
a8b20c2cd29f7135c03d042d55d405ff5304ae7f | 3,954 | py | Python | tests/datasets/test_nasa_marine_debris.py | RitwikGupta/torchgeo | 14c19e35c2b17f9cd6f2dcbdc0968283aa89fbbb | [
"MIT"
] | null | null | null | tests/datasets/test_nasa_marine_debris.py | RitwikGupta/torchgeo | 14c19e35c2b17f9cd6f2dcbdc0968283aa89fbbb | [
"MIT"
] | null | null | null | tests/datasets/test_nasa_marine_debris.py | RitwikGupta/torchgeo | 14c19e35c2b17f9cd6f2dcbdc0968283aa89fbbb | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import glob
import os
import shutil
from pathlib import Path
from typing import Generator
import matplotlib.pyplot as plt
import pytest
import torch
import torch.nn as nn
from _pytest.monkeypatch import MonkeyPatch
from tor... | 34.99115 | 87 | 0.66692 |
5e73f3fb71fb6601867dd11e282bda93ad5eabf7 | 29,217 | py | Python | codes/e_utils/replay_buffer.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | codes/e_utils/replay_buffer.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | codes/e_utils/replay_buffer.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | 1 | 2021-11-23T12:30:37.000Z | 2021-11-23T12:30:37.000Z | import math
import random
import operator
import sys
import numpy as np
from codes.e_utils.experience import ExperienceSource, ExperienceSourceFirstLast
from codes.e_utils.experience_single import ExperienceSourceSingleEnvFirstLast
class TrajectoryBuffer:
def __init__(self, experience_source):
self.expe... | 34.617299 | 120 | 0.577609 |
3f72ccf5cddee8bbafb195e3360ca7fa736a5fd9 | 23,989 | py | Python | tensorflow/python/ops/data_flow_ops.py | hholst80/tenorflow | 79df325975402e03df89747947ff5b7f18407c52 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/data_flow_ops.py | hholst80/tenorflow | 79df325975402e03df89747947ff5b7f18407c52 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/data_flow_ops.py | hholst80/tenorflow | 79df325975402e03df89747947ff5b7f18407c52 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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 by applicable law or a... | 37.25 | 81 | 0.714911 |
705df2b433856b87121a6b9854afc9c1385aeef4 | 1,553 | py | Python | monk/gluon/models/params.py | gstearmit/monk_v1 | 89184ae27dc6d134620034d5b12aa86473ea47ba | [
"Apache-2.0"
] | null | null | null | monk/gluon/models/params.py | gstearmit/monk_v1 | 89184ae27dc6d134620034d5b12aa86473ea47ba | [
"Apache-2.0"
] | 9 | 2020-01-28T21:40:39.000Z | 2022-02-10T01:24:06.000Z | monk/gluon/models/params.py | abhi-kumar/monk_kaggle_bengali_ai | 12a6c654446e887706c1a8bed82fccf8a98ce356 | [
"Apache-2.0"
] | 1 | 2020-10-07T12:57:44.000Z | 2020-10-07T12:57:44.000Z | from gluon.models.imports import *
from system.imports import *
from gluon.models.models import combined_list_lower
@accepts(str, dict, post_trace=True)
@TraceFunction(trace_args=False, trace_rv=False)
def set_model_name(name, system_dict):
if(name not in combined_list_lower):
msg = "Model name {} not in {... | 33.042553 | 74 | 0.719897 |
74ffb811f8ed0fb3aca358e798814645f4d623aa | 212 | py | Python | src/app/api/ping.py | goldytech/fastapi-rnd | 3249b55d87c96b70a60e028df76eade6c04721c0 | [
"MIT"
] | 1 | 2021-11-17T12:59:35.000Z | 2021-11-17T12:59:35.000Z | src/app/api/ping.py | goldytech/fastapi-rnd | 3249b55d87c96b70a60e028df76eade6c04721c0 | [
"MIT"
] | null | null | null | src/app/api/ping.py | goldytech/fastapi-rnd | 3249b55d87c96b70a60e028df76eade6c04721c0 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
router = APIRouter()
@router.get("/ping")
async def pong():
# some async operation could happen here
# example: `notes = await get_all_notes()`
return {"ping": "pong"} | 21.2 | 46 | 0.674528 |
ab458bcef85a3a3aa240db3dbe65bf04ec292bc5 | 24,362 | py | Python | rllib/env/multi_agent_env.py | richardliao/ray | 9eb1635055d93741d263d200bd700708e3d38841 | [
"Apache-2.0"
] | null | null | null | rllib/env/multi_agent_env.py | richardliao/ray | 9eb1635055d93741d263d200bd700708e3d38841 | [
"Apache-2.0"
] | null | null | null | rllib/env/multi_agent_env.py | richardliao/ray | 9eb1635055d93741d263d200bd700708e3d38841 | [
"Apache-2.0"
] | null | null | null | import gym
import logging
from typing import Callable, Dict, List, Tuple, Type, Optional, Union, Set
from ray.rllib.env.base_env import BaseEnv
from ray.rllib.utils.annotations import ExperimentalAPI, override, PublicAPI, \
DeveloperAPI
from ray.rllib.utils.typing import AgentID, EnvCreator, EnvID, EnvType, \
... | 37.94704 | 79 | 0.589443 |
c8e8a6398cc8771a23a7377780f121aea39c1ca0 | 12,440 | py | Python | tests/test_markdown.py | mitya57/pymarkups | adb36c6d1ba674e026227ced97110ff47224996f | [
"BSD-3-Clause"
] | 3 | 2015-01-08T10:26:41.000Z | 2015-02-19T13:41:46.000Z | tests/test_markdown.py | mitya57/pymarkups | adb36c6d1ba674e026227ced97110ff47224996f | [
"BSD-3-Clause"
] | null | null | null | tests/test_markdown.py | mitya57/pymarkups | adb36c6d1ba674e026227ced97110ff47224996f | [
"BSD-3-Clause"
] | null | null | null | # vim: ts=8:sts=8:sw=8:noexpandtab
# This file is part of python-markups test suite
# License: 3-clause BSD, see LICENSE file
# Copyright: (C) Dmitry Shachnev, 2012-2021
from markups.markdown import MarkdownMarkup, _canonicalized_ext_names
from os.path import join
from tempfile import TemporaryDirectory
import unitte... | 33.085106 | 115 | 0.694453 |
fc17bbc6839a7d954a5f5ec480ecddcbec6addbf | 1,087 | py | Python | setup.py | pymetrics/cookiecutter-pypackage | 59328c468b51713a1b01fd3e8dbdc8c1cf0a831b | [
"BSD-3-Clause"
] | null | null | null | setup.py | pymetrics/cookiecutter-pypackage | 59328c468b51713a1b01fd3e8dbdc8c1cf0a831b | [
"BSD-3-Clause"
] | 4 | 2021-11-18T14:46:50.000Z | 2021-11-29T07:36:35.000Z | setup.py | pymetrics/cookiecutter-pypackage | 59328c468b51713a1b01fd3e8dbdc8c1cf0a831b | [
"BSD-3-Clause"
] | null | null | null | # !/usr/bin/env python
from distutils.core import setup
setup(
name="cookiecutter-python-library",
packages=[],
version="0.2.0",
description="Cookiecutter template for a Python library",
author="Pymetrics, Inc.",
license="BSD",
url="https://github.com/pymetrics/cookiecutter-python-library"... | 31.057143 | 70 | 0.594296 |
0ad134cac31d602dccf7d3121ebf88c19fa0bfec | 2,642 | py | Python | src/inst_NARVAL.py | hlruh/serval | f2b43737aa865f7b5f9fb1fdb5d25483f37b068c | [
"MIT"
] | 28 | 2017-10-31T22:26:05.000Z | 2022-03-15T18:18:18.000Z | src/inst_NARVAL.py | hlruh/serval | f2b43737aa865f7b5f9fb1fdb5d25483f37b068c | [
"MIT"
] | 50 | 2018-01-11T13:47:03.000Z | 2022-03-11T08:57:58.000Z | src/inst_NARVAL.py | hlruh/serval | f2b43737aa865f7b5f9fb1fdb5d25483f37b068c | [
"MIT"
] | 8 | 2019-04-24T14:56:33.000Z | 2022-01-18T08:28:15.000Z | from read_spec import *
from arrays import Arrays
# Instrument parameters
name = __name__[5:]
obsloc = dict(lat=42.9333, lon= 0.1333, elevation=2869.4)
obsname = None
pat = '*.fits'
iomax = 40
#pmax = 7800 - 300
pmax = -300
#oset = ':66'
snmax = 1900
maskfile = 'telluric_mask_carm_short.dat'
# Instrument read fun... | 29.355556 | 112 | 0.571537 |
d3c228015a2233245ff1fbb62ea8a55ceb8e250d | 869 | py | Python | src/billing/migrations/0023_auto_20160425_1220.py | paveu/srvup_rest | 97491df4106d5e8b951c6117770fe74072612e49 | [
"MIT"
] | 1 | 2015-10-10T16:49:30.000Z | 2015-10-10T16:49:30.000Z | src/billing/migrations/0023_auto_20160425_1220.py | paveu/srvup_rest | 97491df4106d5e8b951c6117770fe74072612e49 | [
"MIT"
] | null | null | null | src/billing/migrations/0023_auto_20160425_1220.py | paveu/srvup_rest | 97491df4106d5e8b951c6117770fe74072612e49 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('billing', '0022_auto_20160422_2020'),
]
operations = [
migrations.Alte... | 29.965517 | 139 | 0.631761 |
0e09a46a6d658bff42421b85f3708c9190dd39ef | 478 | py | Python | minion/errors.py | timofurrer/minion-ci | 411d0ea6638fb37d7e170cc8c8c5815304cc9f5c | [
"MIT"
] | 49 | 2016-03-07T06:42:40.000Z | 2021-03-06T02:43:02.000Z | minion/errors.py | timofurrer/minion-ci | 411d0ea6638fb37d7e170cc8c8c5815304cc9f5c | [
"MIT"
] | 16 | 2016-03-08T07:20:52.000Z | 2017-04-21T18:15:12.000Z | minion/errors.py | timofurrer/minion-ci | 411d0ea6638fb37d7e170cc8c8c5815304cc9f5c | [
"MIT"
] | 9 | 2016-03-29T22:08:52.000Z | 2021-06-16T16:29:30.000Z | """
`minion-ci` is a minimalist, decentralized, flexible Continuous Integration Server for hackers.
This module contains the exceptions specific to `minion` errors.
:copyright: (c) by Timo Furrer
:license: MIT, see LICENSE for details
"""
class MinionError(Exception):
"""Exception which is raised... | 29.875 | 99 | 0.723849 |
72d8c238a2e1817098eefcae18b0a3b56aedeb6b | 1,875 | py | Python | paddlex/interpret/core/interpretation.py | Channingss/PaddleX | 06fe9552472f0379ff1a16c339c9784c973b5a04 | [
"Apache-2.0"
] | 3 | 2020-05-12T03:09:13.000Z | 2020-06-18T02:50:34.000Z | paddlex/interpret/core/interpretation.py | wyc880622/PaddleX | f001960b7359f3a88b7dd96e1f34500b90566ceb | [
"Apache-2.0"
] | null | null | null | paddlex/interpret/core/interpretation.py | wyc880622/PaddleX | f001960b7359f3a88b7dd96e1f34500b90566ceb | [
"Apache-2.0"
] | 1 | 2020-05-18T07:06:28.000Z | 2020-05-18T07:06:28.000Z | #copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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 l... | 36.057692 | 89 | 0.696533 |
2177a7a5e622a623db5afca53545157c7bcc5d39 | 1,375 | py | Python | api/analyses/analyses.py | capdragon/cannlytics | 47eeda80b1faf54d709def3641d9476501508fec | [
"MIT"
] | null | null | null | api/analyses/analyses.py | capdragon/cannlytics | 47eeda80b1faf54d709def3641d9476501508fec | [
"MIT"
] | null | null | null | api/analyses/analyses.py | capdragon/cannlytics | 47eeda80b1faf54d709def3641d9476501508fec | [
"MIT"
] | null | null | null | """
Analyses Views | Cannlytics API
Created: 4/21/2021
API to interface with cannabis regulation information.
"""
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
@api_view(['GET', 'POST', 'DELETE'])
def analyses(request, format=None):
... | 30.555556 | 86 | 0.690909 |
4bec77a28acc049066498aaeac09943c25f0e2df | 2,008 | py | Python | setup.py | angelsantosa/django-simple-mail | bac536af0acfdcfe006338b0da9d44c3db91b274 | [
"MIT"
] | 1 | 2020-01-17T15:56:24.000Z | 2020-01-17T15:56:24.000Z | setup.py | angelsantosa/django-simple-mail | bac536af0acfdcfe006338b0da9d44c3db91b274 | [
"MIT"
] | null | null | null | setup.py | angelsantosa/django-simple-mail | bac536af0acfdcfe006338b0da9d44c3db91b274 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import simple_mail
from setuptools import setup, find_packages
README = os.path.join(os.path.dirname(__file__), 'README.rst')
# When running tests using tox, README.md is not found
try:
with open(README) as file:
long_description = file.read()
except Exception:
long_de... | 32.918033 | 76 | 0.608068 |
ca132b45c241e394b9896801cdbae65dba12d032 | 3,291 | py | Python | nplusone/ext/sqlalchemy.py | jsl-takino/nplusone | 8137b102f01a6da2a44af874257568f5c05fe624 | [
"MIT"
] | 1 | 2022-02-22T07:42:58.000Z | 2022-02-22T07:42:58.000Z | nplusone/ext/sqlalchemy.py | jsl-takino/nplusone | 8137b102f01a6da2a44af874257568f5c05fe624 | [
"MIT"
] | null | null | null | nplusone/ext/sqlalchemy.py | jsl-takino/nplusone | 8137b102f01a6da2a44af874257568f5c05fe624 | [
"MIT"
] | 1 | 2021-08-23T05:38:31.000Z | 2021-08-23T05:38:31.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import inspect
import itertools
from sqlalchemy.orm import query
from sqlalchemy.orm import loading
from sqlalchemy.orm import attributes
from sqlalchemy.orm import strategies
from nplusone.core import signals
def to_key(instance):
model = type(in... | 25.913386 | 84 | 0.673959 |
1c82d9fcc2e7d9515f70eb527b9fe0b037d9e707 | 2,943 | py | Python | tools/marvin/marvin/deployAndRun.py | cinderella/incubator-cloudstack | 0af2fafcdc374ee7f09f78391b386fd6acbdf5c2 | [
"Apache-2.0"
] | null | null | null | tools/marvin/marvin/deployAndRun.py | cinderella/incubator-cloudstack | 0af2fafcdc374ee7f09f78391b386fd6acbdf5c2 | [
"Apache-2.0"
] | null | null | null | tools/marvin/marvin/deployAndRun.py | cinderella/incubator-cloudstack | 0af2fafcdc374ee7f09f78391b386fd6acbdf5c2 | [
"Apache-2.0"
] | 1 | 2019-05-02T23:20:53.000Z | 2019-05-02T23:20:53.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... | 43.925373 | 182 | 0.703024 |
0b7f71f2c97773a3330b509b3de5f8fe223ab1fe | 2,143 | py | Python | Spy-Game/code.py | lakshit-sharma/greyatom-python-for-data-science | 55a6e5a4c54a4f7135cc09fb287d2f2fa1d36413 | [
"MIT"
] | null | null | null | Spy-Game/code.py | lakshit-sharma/greyatom-python-for-data-science | 55a6e5a4c54a4f7135cc09fb287d2f2fa1d36413 | [
"MIT"
] | null | null | null | Spy-Game/code.py | lakshit-sharma/greyatom-python-for-data-science | 55a6e5a4c54a4f7135cc09fb287d2f2fa1d36413 | [
"MIT"
] | null | null | null | # --------------
##File path for the file
file_path
#Code starts here
def read_file(path):
file = open(path, 'r')
sentence = file.readline()
file.close()
return sentence
sample_message = read_file(file_path)
# --------------
#Code starts here
message_1 = read_file(file_path_1)
message_2 ... | 18.474138 | 71 | 0.664956 |
ba22ef264f10c4f7a4e49d9ce0c61e57c347e46c | 1,202 | py | Python | netado/urls.py | Ciwara/neta | c8c31a3846ea6e8f8baaa70d5fb19ebac3c7a425 | [
"Apache-2.0"
] | null | null | null | netado/urls.py | Ciwara/neta | c8c31a3846ea6e8f8baaa70d5fb19ebac3c7a425 | [
"Apache-2.0"
] | 5 | 2016-11-03T16:45:51.000Z | 2017-03-28T10:17:30.000Z | netado/urls.py | Ciwara/neta | c8c31a3846ea6e8f8baaa70d5fb19ebac3c7a425 | [
"Apache-2.0"
] | null | null | null | """netado URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 38.774194 | 79 | 0.706323 |
292697beb33121295e9c9bbef5b57f5616226830 | 10,426 | py | Python | EvalBox/Attack/AdvAttack/ba.py | Yzx835/AISafety | eb09551814898c7f6d86641b47faf7845c948640 | [
"MIT"
] | 32 | 2020-10-20T06:12:48.000Z | 2022-03-30T03:31:24.000Z | EvalBox/Attack/AdvAttack/ba.py | Yzx835/AISafety | eb09551814898c7f6d86641b47faf7845c948640 | [
"MIT"
] | 2 | 2021-03-24T13:54:50.000Z | 2021-10-11T13:37:31.000Z | EvalBox/Attack/AdvAttack/ba.py | Yzx835/AISafety | eb09551814898c7f6d86641b47faf7845c948640 | [
"MIT"
] | 19 | 2020-10-22T05:42:51.000Z | 2022-02-04T07:07:39.000Z | #!/usr/bin/env python
# coding=UTF-8
"""
@Author: Linna
@LastEditors: Linna
@Description:
@Date: 2019-04-26 11:00:10
@LastEditTime: 2019-04-26
"""
import numpy as np
import torch
from torch.autograd import Variable
from EvalBox.Attack.AdvAttack.attack import Attack
class BA(Attack):
def __init__(self, model=None... | 35.222973 | 99 | 0.544025 |
88ba051697d9354695483192fdfb2e5e255e6d23 | 562 | py | Python | foodtaskerapp/migrations/0006_auto_20191207_1139.py | Kgotso-Koete/foodTasker-Restaurant-web-app | 2812983660ec2a1bf210085e202cafaf2c92b3ae | [
"MIT"
] | 10 | 2020-03-28T15:08:59.000Z | 2021-12-09T18:14:04.000Z | foodtaskerapp/migrations/0006_auto_20191207_1139.py | Kgotso-Koete/foodTasker-Restaurant-web-app | 2812983660ec2a1bf210085e202cafaf2c92b3ae | [
"MIT"
] | 5 | 2020-02-12T03:21:28.000Z | 2021-06-10T22:19:36.000Z | foodtaskerapp/migrations/0006_auto_20191207_1139.py | Kgotso-Koete/foodTasker-Restaurant-web-app | 2812983660ec2a1bf210085e202cafaf2c92b3ae | [
"MIT"
] | 10 | 2020-04-11T16:07:08.000Z | 2021-12-12T15:36:50.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2019-12-07 11:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('foodtaskerapp', '0005_orderdetails'),
]
operations =... | 25.545455 | 131 | 0.656584 |
1f62c5758453ea8d6efc1466807a573b2bd85270 | 6,800 | py | Python | src/meltano/core/plugin/project_plugin.py | learningequality/meltano | b1383d9d97053792f9880bd7a1becee95f7c6e73 | [
"MIT"
] | 1 | 2021-03-04T01:29:23.000Z | 2021-03-04T01:29:23.000Z | src/meltano/core/plugin/project_plugin.py | learningequality/meltano | b1383d9d97053792f9880bd7a1becee95f7c6e73 | [
"MIT"
] | null | null | null | src/meltano/core/plugin/project_plugin.py | learningequality/meltano | b1383d9d97053792f9880bd7a1becee95f7c6e73 | [
"MIT"
] | 2 | 2021-07-23T06:18:07.000Z | 2022-03-04T03:56:55.000Z | import copy
import logging
from typing import Optional
from meltano.core.setting_definition import SettingDefinition
from meltano.core.utils import flatten, uniques_in
from .base import PluginDefinition, PluginRef, PluginType, Variant
from .factory import base_plugin_factory
logger = logging.getLogger(__name__)
cl... | 34.693878 | 142 | 0.637647 |
a32bf8cd91eba6fa3329fc8f8e526a7da7d70c00 | 1,995 | py | Python | strainrec_app/routes/strains_routes.py | bw-ft-med-cabinet-4/DS | d718120cf7544240f914557f5a2473968e68dd33 | [
"MIT"
] | null | null | null | strainrec_app/routes/strains_routes.py | bw-ft-med-cabinet-4/DS | d718120cf7544240f914557f5a2473968e68dd33 | [
"MIT"
] | null | null | null | strainrec_app/routes/strains_routes.py | bw-ft-med-cabinet-4/DS | d718120cf7544240f914557f5a2473968e68dd33 | [
"MIT"
] | 1 | 2020-10-15T21:54:04.000Z | 2020-10-15T21:54:04.000Z | from flask import Blueprint, render_template, redirect, jsonify, Response
import json
from bson import json_util
from strainrec_app.recommender import load_model, data
from strainrec_app.leafly_recommender import load_model as leafly_model
from strainrec_app.services.mongo_service import strains_collection
strains_rou... | 31.171875 | 90 | 0.715789 |
2d0d0c07f2f686aeb119adab4875094809880aa1 | 1,381 | py | Python | 00 - Very Basics/10-set-and-dictionary.py | vladimirioan82/fg-study-python-from-0-to-expert | 501952e365edd8dce74d79453291a4563c24691d | [
"Apache-2.0"
] | null | null | null | 00 - Very Basics/10-set-and-dictionary.py | vladimirioan82/fg-study-python-from-0-to-expert | 501952e365edd8dce74d79453291a4563c24691d | [
"Apache-2.0"
] | null | null | null | 00 - Very Basics/10-set-and-dictionary.py | vladimirioan82/fg-study-python-from-0-to-expert | 501952e365edd8dce74d79453291a4563c24691d | [
"Apache-2.0"
] | null | null | null | '''
Sets and Dictionaries
'''
# sets - sets are mutable
A = {1, 0, 6, 7, 9, 9, 6, 10, 25, 66, 38}
B = set({0, 6, 9, 25, 40, 90, 125, 654, 826})
print(A, type(A))
print(B, type(B))
print(10 in A)
print(666 in B)
for element in A:
print(element)
A.add(75)
print(A)
print(A.pop())
A.remove(38)
A.add(4)
A.add(697)
A.... | 21.578125 | 64 | 0.577842 |
e539353e724cc20017d97db3854ef159ccbb3ce9 | 19,551 | py | Python | main.py | Maxime26s/6GEI311-Lab5 | 339d43453302ccbe02da8545f8fc798bc33e3f2c | [
"MIT"
] | 1 | 2021-11-16T04:43:55.000Z | 2021-11-16T04:43:55.000Z | main.py | Maxime26s/6GEI311-Lab5 | 339d43453302ccbe02da8545f8fc798bc33e3f2c | [
"MIT"
] | null | null | null | main.py | Maxime26s/6GEI311-Lab5 | 339d43453302ccbe02da8545f8fc798bc33e3f2c | [
"MIT"
] | null | null | null | # pip install -r requirements.txt
import tkinter
import numpy as np
from tkinter import *
import tkinter as tk
from tkinter import ttk
from functools import partial
from tkinter.filedialog import askopenfilename
from PIL import Image, ImageTk, ImageDraw
from image_processing import ImageProcessing
import cv2
from imuti... | 36.681051 | 88 | 0.58621 |
3ad781b7e43eab77e8eb267efabd983cbc2f7d30 | 687 | py | Python | src/utils/python/arc/paths.py | maikenp/arc | 994ec850c73affb75e81ab9056cb8146ba75fa9f | [
"Apache-2.0"
] | null | null | null | src/utils/python/arc/paths.py | maikenp/arc | 994ec850c73affb75e81ab9056cb8146ba75fa9f | [
"Apache-2.0"
] | null | null | null | src/utils/python/arc/paths.py | maikenp/arc | 994ec850c73affb75e81ab9056cb8146ba75fa9f | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import os
try:
# try to import -generated file
from .paths_dist import *
except ImportError:
# use defaults
if 'ARC_LOCATION' in os.environ:
ARC_LOCATION = os.environ['ARC_LOCATION']
else:
ARC_LOCATION = '/usr'
ARC_LIBEXEC_DIR = ARC_L... | 26.423077 | 60 | 0.679767 |
23b19f0b5109c38e5d0ae1768cd4b44c475e4d74 | 1,628 | py | Python | lib/oeqa/runtime/cases/node_state_manager.py | sashko/meta-bistro | 9c123a4e2af62f253e351bf978156894bbc4da4f | [
"MIT"
] | 14 | 2015-09-30T07:26:58.000Z | 2020-05-02T16:22:14.000Z | lib/oeqa/runtime/cases/node_state_manager.py | sashko/meta-bistro | 9c123a4e2af62f253e351bf978156894bbc4da4f | [
"MIT"
] | 135 | 2015-05-13T14:51:41.000Z | 2019-09-06T13:35:17.000Z | lib/oeqa/runtime/cases/node_state_manager.py | sashko/meta-bistro | 9c123a4e2af62f253e351bf978156894bbc4da4f | [
"MIT"
] | 38 | 2015-06-08T20:34:00.000Z | 2021-09-01T09:48:10.000Z | import os
from oeqa.oetest import oeRuntimeTest
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.utils.decorators import skipUnlessPassed
class NodeStateManagerDaemonTest(OERuntimeTestCase):
def test_nsm_installed(self):
(status, _) = self.target.run('rpm -qa | grep node-state-manager')
... | 44 | 100 | 0.705774 |
3cddb65e386fd54253599d6a976165bd0750af39 | 759 | py | Python | alipay/aop/api/response/ZolozIdentificationZolozidGetResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/ZolozIdentificationZolozidGetResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/ZolozIdentificationZolozidGetResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class ZolozIdentificationZolozidGetResponse(AlipayResponse):
def __init__(self):
super(ZolozIdentificationZolozidGetResponse, self).__init__()
self._result_in... | 29.192308 | 110 | 0.72859 |
7817851674bf7e48c499e046a626efe90368bba8 | 2,389 | py | Python | src/urban_meal_delivery/forecasts/methods/arima.py | webartifex/urban-meal-delivery | 0f60640bc09fab142815d1a8eaea44653c3fc467 | [
"MIT"
] | 1 | 2021-03-29T21:41:51.000Z | 2021-03-29T21:41:51.000Z | src/urban_meal_delivery/forecasts/methods/arima.py | webartifex/urban-meal-delivery | 0f60640bc09fab142815d1a8eaea44653c3fc467 | [
"MIT"
] | null | null | null | src/urban_meal_delivery/forecasts/methods/arima.py | webartifex/urban-meal-delivery | 0f60640bc09fab142815d1a8eaea44653c3fc467 | [
"MIT"
] | null | null | null | """A wrapper around R's "auto.arima" function."""
import pandas as pd
from rpy2 import robjects
from rpy2.robjects import pandas2ri
def predict(
training_ts: pd.Series,
forecast_interval: pd.DatetimeIndex,
*,
frequency: int,
seasonal_fit: bool = False,
) -> pd.DataFrame:
"""Predict with an au... | 31.025974 | 80 | 0.627878 |
5a90d9ace461cf019ebdc61671e3ef526641d2c8 | 9,431 | py | Python | src/gms/derive_level_paths.py | hohe12ly/inundation-mapping | d133addd4d730b5c468dcf1a8f7dfab35c55cbd7 | [
"Info-ZIP"
] | null | null | null | src/gms/derive_level_paths.py | hohe12ly/inundation-mapping | d133addd4d730b5c468dcf1a8f7dfab35c55cbd7 | [
"Info-ZIP"
] | null | null | null | src/gms/derive_level_paths.py | hohe12ly/inundation-mapping | d133addd4d730b5c468dcf1a8f7dfab35c55cbd7 | [
"Info-ZIP"
] | null | null | null | #!/usr/bin/env python3
from stream_branches import StreamNetwork
import argparse
from utils.shared_functions import get_fossid_from_huc8
import geopandas as gpd
def Derive_level_paths(in_stream_network, out_stream_network,branch_id_attribute,
out_stream_network_dissolved=None,huc_id=None,
... | 55.804734 | 143 | 0.504188 |
9bd019301ac492ca65904113cbd61611ae81fa2b | 3,690 | py | Python | PhysicsTools/NanoAOD/python/isotracks_cff.py | AndrissP/cmssw | b03578d2a2573923af5db50d0508baf3bd6a208e | [
"Apache-2.0"
] | null | null | null | PhysicsTools/NanoAOD/python/isotracks_cff.py | AndrissP/cmssw | b03578d2a2573923af5db50d0508baf3bd6a208e | [
"Apache-2.0"
] | null | null | null | PhysicsTools/NanoAOD/python/isotracks_cff.py | AndrissP/cmssw | b03578d2a2573923af5db50d0508baf3bd6a208e | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
from PhysicsTools.NanoAOD.common_cff import *
from PhysicsTools.NanoAOD.nano_eras_cff import *
finalIsolatedTracks = cms.EDProducer("IsolatedTrackCleaner",
tracks = cms.InputTag("isolatedTracks"),
cut = cms.string("((pt>5 && (abs(pdgId) == 11 || abs(pdgId) == 13)) || pt... | 62.542373 | 322 | 0.704336 |
865b3b4495a68339e31e77bfbcb393d24b032152 | 9,381 | py | Python | tools/gh_api.py | equinaut/statsmodels | 6fe8d4e351416727641db4c3d3552f4ec4f46d0e | [
"BSD-3-Clause"
] | 1 | 2020-05-09T08:42:52.000Z | 2020-05-09T08:42:52.000Z | tools/gh_api.py | equinaut/statsmodels | 6fe8d4e351416727641db4c3d3552f4ec4f46d0e | [
"BSD-3-Clause"
] | null | null | null | tools/gh_api.py | equinaut/statsmodels | 6fe8d4e351416727641db4c3d3552f4ec4f46d0e | [
"BSD-3-Clause"
] | 1 | 2020-05-09T08:42:58.000Z | 2020-05-09T08:42:58.000Z | """Functions for Github API requests.
Copied from IPython 9e82bc5
https://github.com/ipython/ipython/blob/master/tools/gh_api.py
"""
from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import os
import re
import sys
from datetime import datetime
import requests
import getpass... | 30.067308 | 94 | 0.62456 |
ef1bfecc1914544fcdc8aeda7dfa3e2e3c991430 | 1,363 | py | Python | server_status/__init__.py | airtonix/django-server-status | 5bd732c6a56b2f4a816142592ded23f2dc2500ad | [
"MIT"
] | 2 | 2015-09-11T23:29:46.000Z | 2021-06-18T02:59:50.000Z | server_status/__init__.py | airtonix/django-server-status | 5bd732c6a56b2f4a816142592ded23f2dc2500ad | [
"MIT"
] | null | null | null | server_status/__init__.py | airtonix/django-server-status | 5bd732c6a56b2f4a816142592ded23f2dc2500ad | [
"MIT"
] | null | null | null |
def autodiscover():
import copy
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
from .conf import settings
from .registry import plugins
"""
Auto-discover INSTALLED_APPS plugin modules and fail silently when
not present. T... | 41.30303 | 84 | 0.666178 |
844ed94ffbd0247bc066796115e06e62ed058853 | 7,894 | py | Python | xentica/seeds/patterns.py | a5kin/xentica | ca08fac9f85af71c9d6d98545a33d50323f851b3 | [
"MIT"
] | 23 | 2018-02-24T23:38:54.000Z | 2022-02-16T15:20:46.000Z | xentica/seeds/patterns.py | a5kin/xentica | ca08fac9f85af71c9d6d98545a33d50323f851b3 | [
"MIT"
] | 39 | 2017-11-20T21:54:30.000Z | 2020-09-01T12:43:57.000Z | xentica/seeds/patterns.py | a5kin/xentica | ca08fac9f85af71c9d6d98545a33d50323f851b3 | [
"MIT"
] | 4 | 2019-04-23T03:56:44.000Z | 2021-05-14T11:12:54.000Z | """
The module containing different patterns for CA seed initialization.
Each pattern class have one mandatory method ``generate()`` which is
called automatically at the initialization stage.
Patterns are intended for use in
:class:`Experiment <xentica.core.experiments.Experiment>` classes.
See the example of general... | 28.810219 | 79 | 0.606157 |
3281707efa74a8c0c22a4bfa08c5575adffa7ad7 | 2,630 | py | Python | PyLexicon/core.py | LordFlashmeow/PyLexicon | cc9ebb863f9365c335dc443dd6f90163029436de | [
"MIT"
] | null | null | null | PyLexicon/core.py | LordFlashmeow/PyLexicon | cc9ebb863f9365c335dc443dd6f90163029436de | [
"MIT"
] | null | null | null | PyLexicon/core.py | LordFlashmeow/PyLexicon | cc9ebb863f9365c335dc443dd6f90163029436de | [
"MIT"
] | null | null | null | import re
import requests
from bs4 import BeautifulSoup
def _get_soup_object(url, parser="html.parser"):
return BeautifulSoup(requests.get(url).text, parser)
def define(word):
""" Looks up and defines a word
Args:
word: a single word string
Returns:
A dictionary
... | 23.909091 | 70 | 0.54981 |
b82eb8619c6ac1351e653b348e21c85c7a8d1fa8 | 3,274 | py | Python | Numpy_basics.py | yashika-5/summer19_python | e0fb252b6d6577ce8c68cac6155ae2b90c1e9073 | [
"Apache-2.0"
] | null | null | null | Numpy_basics.py | yashika-5/summer19_python | e0fb252b6d6577ce8c68cac6155ae2b90c1e9073 | [
"Apache-2.0"
] | null | null | null | Numpy_basics.py | yashika-5/summer19_python | e0fb252b6d6577ce8c68cac6155ae2b90c1e9073 | [
"Apache-2.0"
] | null | null | null |
# coding: utf-8
# In[1]:
my_list =[1,2,3]
# In[47]:
import numpy as np
import pandas as pd
# In[5]:
arr = np.array(my_list)
arr
# In[19]:
arr.dtype
# In[7]:
my_mat = [[1,2,300],[34,23,41],[78,34,87]]
# In[8]:
np.array(my_mat)
# In[9]:
np.arange(0,10)
# In[10]:
np.arange(0,11,3)
# In[11]... | 5.172196 | 73 | 0.459988 |
9363177ea33de4226bd1deb503365a58ce2b6a92 | 403 | py | Python | python/validating-credit-card-number.py | gajubadge11/HackerRank-1 | 7b136ccaa1ed47ae737467ace6b494c720ccb942 | [
"MIT"
] | 340 | 2018-06-17T19:45:56.000Z | 2022-03-22T02:26:15.000Z | python/validating-credit-card-number.py | gajubadge11/HackerRank-1 | 7b136ccaa1ed47ae737467ace6b494c720ccb942 | [
"MIT"
] | 3 | 2021-02-02T17:17:29.000Z | 2021-05-18T10:06:04.000Z | python/validating-credit-card-number.py | gajubadge11/HackerRank-1 | 7b136ccaa1ed47ae737467ace6b494c720ccb942 | [
"MIT"
] | 229 | 2019-04-20T08:28:49.000Z | 2022-03-31T04:23:52.000Z | import re
if __name__ == "__main__":
t = int(input().strip())
for _ in range(t):
num = "".join(input())
if (re.match(r'^[456]', num) and
(re.match(r'([\d]{4}-){3}[\d]{4}$', num) or
re.match(r'[\d]{16}', num)) and
not re.search(r'(\d)\1{3,}', num.replace... | 26.866667 | 64 | 0.419355 |
afbe440870a09411371d2cb6c2139c1651f4aa27 | 20,356 | py | Python | python/cuml/test/test_fil.py | frankier/cuml | c2f246a923232a63c65082036a3bd1278a2fa7d7 | [
"Apache-2.0"
] | null | null | null | python/cuml/test/test_fil.py | frankier/cuml | c2f246a923232a63c65082036a3bd1278a2fa7d7 | [
"Apache-2.0"
] | null | null | null | python/cuml/test/test_fil.py | frankier/cuml | c2f246a923232a63c65082036a3bd1278a2fa7d7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 41.290061 | 79 | 0.599283 |
58d6499fe5f83790af723707e91fcfdbf8d51384 | 2,018 | py | Python | tests/integration/scollection_lazy_search_test.py | KalinkinaMaria/selene | 859e1102c85740b52af8d0f08dd6b6490b4bd2ff | [
"MIT"
] | null | null | null | tests/integration/scollection_lazy_search_test.py | KalinkinaMaria/selene | 859e1102c85740b52af8d0f08dd6b6490b4bd2ff | [
"MIT"
] | 1 | 2021-06-02T04:21:17.000Z | 2021-06-02T04:21:17.000Z | tests/integration/scollection_lazy_search_test.py | vkarpenko/selene | 4776357430c940be38f38be9981006dd156f9730 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selene import config
from selene.common.none_object import NoneObject
from selene.driver import SeleneDriver
from tests.acceptance.helpers.helper import get_test_driver
from tests.integration.helpers.givenpage import GivenPage
__author__ = 'yashaka'
driver = NoneObject('driver') ... | 28.828571 | 74 | 0.635778 |
29dba1d8340f76e670b37a695d97e000b06b77de | 125 | py | Python | Curso/ExMundo1/Ex008MetrosCent.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/ExMundo1/Ex008MetrosCent.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/ExMundo1/Ex008MetrosCent.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | n = int(input('Digite o numero de metros: '))
print('{} metros são {} centimetros e {} milimetros'.format(n, n*100, n*1000))
| 41.666667 | 78 | 0.656 |
eece83d859fe01f8a6b7c04691c86b5dc45f0969 | 4,630 | py | Python | explorer/exporters.py | worthwhile/django-sql-explorer | 394778be99278f2aedbed4bea6b6ecb30b928330 | [
"MIT"
] | null | null | null | explorer/exporters.py | worthwhile/django-sql-explorer | 394778be99278f2aedbed4bea6b6ecb30b928330 | [
"MIT"
] | null | null | null | explorer/exporters.py | worthwhile/django-sql-explorer | 394778be99278f2aedbed4bea6b6ecb30b928330 | [
"MIT"
] | null | null | null | from django.db import DatabaseError
from django.core.serializers.json import DjangoJSONEncoder
import json
import string
import sys
from datetime import datetime
PY3 = sys.version_info[0] == 3
if PY3:
import csv
else:
import unicodecsv as csv
from django.utils.module_loading import import_string
from . import ... | 28.404908 | 116 | 0.602376 |
b6700053532f4b6e1140c1bf988bbfef17c32423 | 3,914 | py | Python | tests/test_project/settings.py | resulto-admin/django-static-url | 138799d6783b1ada0857a9e95c62f2ee40981462 | [
"BSD-3-Clause"
] | 2 | 2016-11-16T19:16:06.000Z | 2016-11-16T19:16:31.000Z | tests/test_project/settings.py | powergo/django-static-url | 138799d6783b1ada0857a9e95c62f2ee40981462 | [
"BSD-3-Clause"
] | 1 | 2016-11-16T13:32:23.000Z | 2016-11-16T13:35:19.000Z | tests/test_project/settings.py | powergo/django-static-url | 138799d6783b1ada0857a9e95c62f2ee40981462 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
# Import source code dir
# This ensures that we can import `django_static_url.xyz...` from within the tests/
# folder containing all the tests from the lib code.
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
sys.path.insert(0, os.path.join(os.getcwd()... | 24.616352 | 85 | 0.607818 |
0f004abb8e24c731a3090093183c98a2575d94e1 | 370 | py | Python | ippon/cup_phase/serializers.py | morynicz/ippon_back | dce901bfc649c6f8efbbf0907654e0860606b3e3 | [
"MIT"
] | null | null | null | ippon/cup_phase/serializers.py | morynicz/ippon_back | dce901bfc649c6f8efbbf0907654e0860606b3e3 | [
"MIT"
] | 13 | 2018-12-22T15:30:56.000Z | 2022-03-12T00:22:31.000Z | ippon/cup_phase/serializers.py | morynicz/ippon_back | dce901bfc649c6f8efbbf0907654e0860606b3e3 | [
"MIT"
] | 2 | 2019-06-01T11:28:23.000Z | 2020-03-27T15:19:11.000Z | from rest_framework import serializers
import ippon.models
class CupPhaseSerializer(serializers.ModelSerializer):
class Meta:
model = ippon.models.cup_phase.CupPhase
fields = (
'id',
'tournament',
'name',
'fight_length',
'final_fight_len... | 21.764706 | 54 | 0.578378 |
f722d732521d717904d23e60794bd5ed17668867 | 3,488 | py | Python | projects/anosql/test/python/conftest.py | arrdem/source | df9aae1253ed415ade3a2b59e8a0996ff659543d | [
"MIT"
] | 4 | 2021-08-17T15:47:38.000Z | 2021-10-06T01:59:32.000Z | projects/anosql/test/python/conftest.py | arrdem/source | df9aae1253ed415ade3a2b59e8a0996ff659543d | [
"MIT"
] | 8 | 2021-08-14T17:47:08.000Z | 2021-09-20T20:22:47.000Z | projects/anosql/test/python/conftest.py | arrdem/source | df9aae1253ed415ade3a2b59e8a0996ff659543d | [
"MIT"
] | 1 | 2021-10-09T21:24:35.000Z | 2021-10-09T21:24:35.000Z | import csv
import os
import sqlite3
import pytest
BLOGDB_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "blogdb")
USERS_DATA_PATH = os.path.join(BLOGDB_PATH, "data", "users_data.csv")
BLOGS_DATA_PATH = os.path.join(BLOGDB_PATH, "data", "blogs_data.csv")
def populate_sqlite3_db(db_path):
conn =... | 28.357724 | 87 | 0.497133 |
b3a7ff3076c1287f5856378b985ff2247bda87b7 | 1,662 | py | Python | tests/test_demand.py | EPAENERGYSTAR/epathermostat | 98aaf571fe8e15e1a372567776081fd9dae7e872 | [
"MIT"
] | 12 | 2017-03-08T23:17:44.000Z | 2021-10-15T15:56:30.000Z | tests/test_demand.py | EPAENERGYSTAR/epathermostat | 98aaf571fe8e15e1a372567776081fd9dae7e872 | [
"MIT"
] | 23 | 2017-10-24T00:07:37.000Z | 2021-07-15T14:42:31.000Z | tests/test_demand.py | EPAENERGYSTAR/epathermostat | 98aaf571fe8e15e1a372567776081fd9dae7e872 | [
"MIT"
] | 11 | 2017-03-22T22:35:30.000Z | 2021-01-01T22:30:14.000Z | import pandas as pd
import numpy as np
from numpy.testing import assert_allclose
import pytest
from .fixtures.thermostats import thermostat_type_1
from .fixtures.thermostats import core_heating_day_set_type_1_entire as core_heating_day_set_type_1
from .fixtures.thermostats import core_cooling_day_set_type_1_entire as... | 46.166667 | 121 | 0.847172 |
28e45871535d002b3a0bfdd3bab9b68bace2ac60 | 2,567 | py | Python | piexif/_common.py | hugovk/Piexif | 48ced13646e8e85cc0bf30be5874d644c28ccdd4 | [
"MIT"
] | 2 | 2018-12-19T19:55:47.000Z | 2019-09-27T12:26:10.000Z | piexif/_common.py | hugovk/Piexif | 48ced13646e8e85cc0bf30be5874d644c28ccdd4 | [
"MIT"
] | null | null | null | piexif/_common.py | hugovk/Piexif | 48ced13646e8e85cc0bf30be5874d644c28ccdd4 | [
"MIT"
] | null | null | null | import struct
from ._exceptions import InvalidImageDataError
def split_into_segments(data):
"""Slices JPEG meta data into a list from JPEG binary data.
"""
if data[0:2] != b"\xff\xd8":
raise InvalidImageDataError("Given data isn't JPEG.")
head = 2
segments = [b"\xff\xd8"]
while 1:
... | 27.021053 | 69 | 0.523568 |
5bbaaef7644c49cab0114822fa0e477de955e618 | 564 | py | Python | applications/tenant/managers.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/tenant/managers.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/tenant/managers.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.db import models
class RoleManager(models.Manager.from_queryset(models.QuerySet)):
def get_queryset(self):
return super().get_queryset()\
.annotate(sql_count=models.Count('roles_tenant'))
Selected_related = ('group', 'user', 'invitation')
Prefetch_related = ('roles',)
class TenantM... | 35.25 | 67 | 0.687943 |
37a7f7897f0812ad348057e44847ce1be01b61f1 | 3,039 | py | Python | benchmark_ofa_stereo.py | blackjack2015/once-for-all | f87e61ef7ad94e39bae01438b90d5d3ad43986c1 | [
"Apache-2.0"
] | null | null | null | benchmark_ofa_stereo.py | blackjack2015/once-for-all | f87e61ef7ad94e39bae01438b90d5d3ad43986c1 | [
"Apache-2.0"
] | null | null | null | benchmark_ofa_stereo.py | blackjack2015/once-for-all | f87e61ef7ad94e39bae01438b90d5d3ad43986c1 | [
"Apache-2.0"
] | null | null | null | # Once for All: Train One Network and Specialize it for Efficient Deployment
# Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, Song Han
# International Conference on Learning Representations (ICLR), 2020.
import os
import torch
import argparse
from ofa.stereo_matching.data_providers.stereo import StereoDataProvider
... | 30.69697 | 108 | 0.716025 |
e56c1fa82d45e61d9ce12da1bd0b9f59f27acbca | 10,453 | py | Python | tensorboard/plugins/mesh/mesh_plugin_test.py | BearerPipelineTest/tensorboard | 0fa03a9a8309dc137a15645c931e8b625bc3869c | [
"Apache-2.0"
] | null | null | null | tensorboard/plugins/mesh/mesh_plugin_test.py | BearerPipelineTest/tensorboard | 0fa03a9a8309dc137a15645c931e8b625bc3869c | [
"Apache-2.0"
] | null | null | null | tensorboard/plugins/mesh/mesh_plugin_test.py | BearerPipelineTest/tensorboard | 0fa03a9a8309dc137a15645c931e8b625bc3869c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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... | 39.149813 | 86 | 0.589687 |
916e021584a861ccf9813ff26a1189894bb98ed2 | 2,309 | py | Python | {{cookiecutter.git_project_name}}/tests/test_{{cookiecutter.project_slug}}.py | imAsparky/cookiecutter-py3-package | e007cac29c211bb6a931f2cebebab809e401f5d1 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.git_project_name}}/tests/test_{{cookiecutter.project_slug}}.py | imAsparky/cookiecutter-py3-package | e007cac29c211bb6a931f2cebebab809e401f5d1 | [
"BSD-3-Clause"
] | 116 | 2021-08-23T19:27:19.000Z | 2022-01-15T02:38:12.000Z | {{cookiecutter.git_project_name}}/tests/test_{{cookiecutter.project_slug}}.py | imAsparky/cookiecutter-py3-package | e007cac29c211bb6a931f2cebebab809e401f5d1 | [
"BSD-3-Clause"
] | 1 | 2021-08-31T20:44:09.000Z | 2021-08-31T20:44:09.000Z | #!/usr/bin/env python
"""Tests for `{{ cookiecutter.git_project_name }}` package."""
import unittest
import pytest
{%- if cookiecutter.command_line_interface | lower == 'click' %}
from click.testing import CliRunner
{%- endif %}
from {{cookiecutter.project_slug}} import {{cookiecutter.project_slug}}
{%- if cook... | 28.506173 | 78 | 0.660026 |
a66674ae813cf75ef50f250d5624e578bbb47d3a | 4,813 | py | Python | loaders/doc3dwc_loader.py | KongBOy/analyze_11_code | 1baef56ba0da74b67e653bbea013e3843034c3f0 | [
"MIT"
] | null | null | null | loaders/doc3dwc_loader.py | KongBOy/analyze_11_code | 1baef56ba0da74b67e653bbea013e3843034c3f0 | [
"MIT"
] | null | null | null | loaders/doc3dwc_loader.py | KongBOy/analyze_11_code | 1baef56ba0da74b67e653bbea013e3843034c3f0 | [
"MIT"
] | null | null | null | import os
from os.path import join as pjoin
import collections
import json
import torch
import numpy as np
import scipy.misc as m
import scipy.io as io
import matplotlib.pyplot as plt
import glob
import cv2
import random
from tqdm import tqdm
from torch.utils import data
from loaders.augmentationsk import data_aug, t... | 38.198413 | 196 | 0.563682 |
ea0c335504288728aa28eee0dd2c154190037174 | 157 | py | Python | plugins/sort_by_article_count/count.py | julianespinel/website | a16394cf878fdfd8e1fa86ed23779d31ec4f1316 | [
"MIT"
] | null | null | null | plugins/sort_by_article_count/count.py | julianespinel/website | a16394cf878fdfd8e1fa86ed23779d31ec4f1316 | [
"MIT"
] | 9 | 2020-08-30T19:52:19.000Z | 2021-10-03T16:55:45.000Z | plugins/sort_by_article_count/count.py | julianespinel/website | a16394cf878fdfd8e1fa86ed23779d31ec4f1316 | [
"MIT"
] | null | null | null | def sort_by_article_count(tags):
"""Return a number articles with the given tag."""
return sorted(tags, key=lambda tags: len(tags[1]), reverse=True)
| 39.25 | 68 | 0.713376 |
b37bf8f613d40848aa52a456f274c1f4c55c29dc | 2,361 | py | Python | Acceleration/memcached/regressionSims/testgen/memtest_manysets.py | pooyaww/Vivado_HLS_Samples | 6dc48bded1fc577c99404fc99c5089ae7279189a | [
"BSD-3-Clause"
] | 326 | 2016-07-06T01:50:43.000Z | 2022-03-31T21:50:19.000Z | Acceleration/memcached/regressionSims/testgen/memtest_manysets.py | asicguy/HLx_Examples | 249406bf7718c33d10a837ddd2ee71a683d481e8 | [
"BSD-3-Clause"
] | 10 | 2017-04-05T16:02:19.000Z | 2021-06-09T14:26:40.000Z | Acceleration/memcached/regressionSims/testgen/memtest_manysets.py | asicguy/HLx_Examples | 249406bf7718c33d10a837ddd2ee71a683d481e8 | [
"BSD-3-Clause"
] | 192 | 2016-08-31T09:15:18.000Z | 2022-03-01T11:28:12.000Z | #!/usr/bin/python
import memlib
keySizes = range(1,28)
valueSizes = keySizes[:]
keyChars = map(chr, range(97, 126))
valueChars1 = map(chr, range(65, 94))
valueChars2 = valueChars1[1:] + valueChars1[:1]
valueChars3 = valueChars1[2:] + valueChars1[:2]
valueChars4 = valueChars1[3:] + valueChars1[:3]
valueChars5 = value... | 31.905405 | 72 | 0.752647 |
ec8df2b48734d1aeaaff458650b3d5c47692eb41 | 567 | py | Python | hello.py | KianaLiu1/cgi-lab | 0685390ef1319ec6608821c0a78d62ac6d5d9e04 | [
"Apache-2.0"
] | null | null | null | hello.py | KianaLiu1/cgi-lab | 0685390ef1319ec6608821c0a78d62ac6d5d9e04 | [
"Apache-2.0"
] | null | null | null | hello.py | KianaLiu1/cgi-lab | 0685390ef1319ec6608821c0a78d62ac6d5d9e04 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os, json
#print all env variables as plain text
# print("Content-Type: text/plain")
# print()
# print(os.environ)
#print env variables as json
# print("Content-Type: application/json")
# print()
# print(json.dumps(dict(os.environ), indent = 2))
#print query parameter data in html
# pri... | 24.652174 | 64 | 0.712522 |
0a468b88c7630c3d697b10c7c91849e6f7c914a2 | 2,471 | py | Python | test/IECore/ops/maths/multiply/multiply-2.py | bradleyhenke/cortex | f8245cc6c9464b1de9e6c6e57068248198e63de0 | [
"BSD-3-Clause"
] | 386 | 2015-01-02T11:10:43.000Z | 2022-03-10T15:12:20.000Z | test/IECore/ops/maths/multiply/multiply-2.py | bradleyhenke/cortex | f8245cc6c9464b1de9e6c6e57068248198e63de0 | [
"BSD-3-Clause"
] | 484 | 2015-01-09T18:28:06.000Z | 2022-03-31T16:02:04.000Z | test/IECore/ops/maths/multiply/multiply-2.py | bradleyhenke/cortex | f8245cc6c9464b1de9e6c6e57068248198e63de0 | [
"BSD-3-Clause"
] | 99 | 2015-01-28T23:18:04.000Z | 2022-03-27T00:59:39.000Z | ##########################################################################
#
# Copyright (c) 2007-2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | 33.391892 | 76 | 0.674221 |
ace92815d8d90993c7378b71ba05c9e46c70b570 | 9,499 | py | Python | oauth_provider/views.py | ovidioreyna/django-oauth-plus | b9b64a3ac24fd11f471763c88462bbf3c53e46e6 | [
"BSD-3-Clause"
] | null | null | null | oauth_provider/views.py | ovidioreyna/django-oauth-plus | b9b64a3ac24fd11f471763c88462bbf3c53e46e6 | [
"BSD-3-Clause"
] | 4 | 2018-01-11T20:59:12.000Z | 2020-05-12T12:48:53.000Z | oauth_provider/views.py | ovidioreyna/django-oauth-plus | b9b64a3ac24fd11f471763c88462bbf3c53e46e6 | [
"BSD-3-Clause"
] | 3 | 2017-12-18T20:01:36.000Z | 2018-12-17T05:35:53.000Z | from __future__ import absolute_import
import oauth2 as oauth
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import get_callable
from django.http import HttpResponse, HttpResponseBadRequest
from djang... | 38.148594 | 127 | 0.68123 |
266ccc96f4e6ddfd7d31958d65b31f655a3002b6 | 11,655 | py | Python | fxparamest.py | henrikjuergens/guitar-fx-extraction | 442adab577a090e27de12d779a6d8a0aa917fe1f | [
"MIT"
] | 2 | 2020-09-06T07:55:17.000Z | 2020-09-19T21:19:01.000Z | fxparamest.py | henrikjuergens/guitar-fx-extraction | 442adab577a090e27de12d779a6d8a0aa917fe1f | [
"MIT"
] | null | null | null | fxparamest.py | henrikjuergens/guitar-fx-extraction | 442adab577a090e27de12d779a6d8a0aa917fe1f | [
"MIT"
] | 1 | 2021-12-17T18:14:02.000Z | 2021-12-17T18:14:02.000Z | """Estimates the parameters of the used Audio Effect"""
import os
from pathlib import Path
import pickle
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import librosa
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
import joblib
from keras import models, l... | 42.228261 | 109 | 0.62574 |
88a67d82e8f012f13c05c78896e8c1e075de5ae7 | 1,537 | py | Python | gym_pcgrl/gym_pcgrl/envs/probs/binary/binary_ctrl_prob.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | gym_pcgrl/gym_pcgrl/envs/probs/binary/binary_ctrl_prob.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | gym_pcgrl/gym_pcgrl/envs/probs/binary/binary_ctrl_prob.py | JiangZehua/control-pcgrl3D | f9b04e65e1cbf70b7306f4df251450d83c6fb2be | [
"MIT"
] | null | null | null | import numpy as np
from gym_pcgrl.envs.probs.binary.binary_prob import BinaryProblem
class BinaryCtrlProblem(BinaryProblem):
def __init__(self):
super(BinaryCtrlProblem, self).__init__()
self._max_path_length = np.ceil(self._width / 2) * (self._height) + np.floor(self._height/2)
# self._max... | 34.931818 | 116 | 0.597267 |
60f63c42839d834fe3adf6414fb5a6610df016d1 | 571 | py | Python | projects/writing/sigurd/migrations/0002_story.py | NikolaiSie/django | a19bb9813d7ed957d05edeeaf380988265aae49d | [
"Apache-2.0"
] | null | null | null | projects/writing/sigurd/migrations/0002_story.py | NikolaiSie/django | a19bb9813d7ed957d05edeeaf380988265aae49d | [
"Apache-2.0"
] | null | null | null | projects/writing/sigurd/migrations/0002_story.py | NikolaiSie/django | a19bb9813d7ed957d05edeeaf380988265aae49d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.6 on 2021-09-08 12:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sigurd', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Story',
fields=[
('id', mod... | 25.954545 | 117 | 0.567426 |
2c35f153b2fda4e85604530fbb76d550b0a75490 | 1,004 | py | Python | funcat/data/rt_data_from_tencent.py | xuan-wang/funcat | c4b184942564ab8a4092acb4907ab069fc44683c | [
"Apache-2.0"
] | 18 | 2019-05-30T01:00:38.000Z | 2022-01-03T15:46:25.000Z | funcat/data/rt_data_from_tencent.py | xuan-wang/funcat | c4b184942564ab8a4092acb4907ab069fc44683c | [
"Apache-2.0"
] | 5 | 2019-05-28T15:01:18.000Z | 2021-11-24T14:08:39.000Z | funcat/data/rt_data_from_tencent.py | xuan-wang/funcat | c4b184942564ab8a4092acb4907ab069fc44683c | [
"Apache-2.0"
] | 8 | 2020-10-30T10:03:02.000Z | 2021-12-04T07:20:36.000Z | import pandas as pd
import requests
import json
url = "http://qt.gtimg.cn/q="
def get_runtime_data(ts_code, token=None):
code_suffix = ts_code[-2:].lower() + ts_code[:-3]
if token:
text = requests.get(url + code_suffix + '&token=' + token)
else:
text = requests.get(url + code_suffix)
... | 25.1 | 66 | 0.498008 |
ef0717a316f58988738198f92d56d31ba0de5a60 | 2,317 | py | Python | cnet.py | cherepas/seed2sh | 3ca32fc425a1762ea9e29ece11732e1a9bb06b13 | [
"MIT"
] | null | null | null | cnet.py | cherepas/seed2sh | 3ca32fc425a1762ea9e29ece11732e1a9bb06b13 | [
"MIT"
] | null | null | null | cnet.py | cherepas/seed2sh | 3ca32fc425a1762ea9e29ece11732e1a9bb06b13 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
def getsize(new_hi,ker,srd):
pad = np.asarray((0,0))
dil = np.asarray((1,1))
new_size = np.asarray(new_hi)
ker = np.asarray(ker)
srd = np.asarray(srd)
return(tuple((np.squeeze(\
(new_size+2*pad-dil*[ke... | 38.616667 | 81 | 0.538196 |
c9e55aa32d3229f47c4d3e059797f3c7cece0f61 | 1,342 | py | Python | Day 5/password_generator.py | Jean-Bi/100DaysOfCodePython | 2069d1366c58e7d5f4cd30cfc786e9c2e44b82ca | [
"MIT"
] | null | null | null | Day 5/password_generator.py | Jean-Bi/100DaysOfCodePython | 2069d1366c58e7d5f4cd30cfc786e9c2e44b82ca | [
"MIT"
] | null | null | null | Day 5/password_generator.py | Jean-Bi/100DaysOfCodePython | 2069d1366c58e7d5f4cd30cfc786e9c2e44b82ca | [
"MIT"
] | null | null | null | #Password Generator Project
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers... | 36.27027 | 270 | 0.584203 |
0951b25c6b7672ec2e940ac79c5b0fcae5d7e0b0 | 8,877 | py | Python | mapboxgl/utils.py | bnaul/mapboxgl-jupyter | 01f401642961d1044f8bc86eac04de8bebe3705c | [
"MIT"
] | null | null | null | mapboxgl/utils.py | bnaul/mapboxgl-jupyter | 01f401642961d1044f8bc86eac04de8bebe3705c | [
"MIT"
] | null | null | null | mapboxgl/utils.py | bnaul/mapboxgl-jupyter | 01f401642961d1044f8bc86eac04de8bebe3705c | [
"MIT"
] | 1 | 2019-12-27T15:48:22.000Z | 2019-12-27T15:48:22.000Z | from .colors import color_ramps, common_html_colors
from chroma import Color, Scale
import geojson
import json
import base64
from io import BytesIO
import re
from matplotlib.image import imsave
from colour import Color as Colour
def row_to_geojson(row, lon, lat):
"""Convert a pandas dataframe row to a geojson for... | 34.011494 | 111 | 0.601893 |
f56c52dacefb236f06556ef19da44dc41ef1e287 | 2,314 | py | Python | routes/user.py | zaibacu/yt-flask-example | d85b9e4761b63ac710553ba1b44e854c1cbaa395 | [
"MIT"
] | 1 | 2021-03-07T14:07:29.000Z | 2021-03-07T14:07:29.000Z | routes/user.py | zaibacu/yt-flask-example | d85b9e4761b63ac710553ba1b44e854c1cbaa395 | [
"MIT"
] | null | null | null | routes/user.py | zaibacu/yt-flask-example | d85b9e4761b63ac710553ba1b44e854c1cbaa395 | [
"MIT"
] | null | null | null | import hashlib
from functools import wraps
from flask import Blueprint, session, redirect, render_template, request
from models import User
from database import db
bp = Blueprint("users", __name__)
def hash(password):
return hashlib.sha3_256(password.encode("UTF-8")).hexdigest()
def requires_login(fn):
... | 25.428571 | 92 | 0.61452 |
ba67daebffe310ed3ad05aec4da1f9117de6ed44 | 22,629 | py | Python | syft/serde/serde.py | robot-ai-machinelearning/PySyft | df7d539ad7643a93235249af05981578dd095a5a | [
"Apache-2.0"
] | 1 | 2019-12-29T15:20:44.000Z | 2019-12-29T15:20:44.000Z | syft/serde/serde.py | robot-ai-machinelearning/PySyft | df7d539ad7643a93235249af05981578dd095a5a | [
"Apache-2.0"
] | null | null | null | syft/serde/serde.py | robot-ai-machinelearning/PySyft | df7d539ad7643a93235249af05981578dd095a5a | [
"Apache-2.0"
] | null | null | null | """
This file exists to provide one common place for all serialization to occur
regardless of framework. As msgpack only supports basic types and binary formats
every type must be first be converted to one of these types. Thus, we've split our
functionality into three steps. When converting from a PySyft object (or col... | 39.7 | 115 | 0.728799 |
0ba1774a98bbb212454435b57ef476e328ba2e48 | 2,627 | py | Python | src/pyscaffold/contrib/setuptools_scm/hg.py | jleni/pyscaffold | 0d0ed09235ec6f0f608a1ae45a1fef26cb74ffde | [
"MIT"
] | 3 | 2021-05-28T14:55:18.000Z | 2022-01-18T08:38:11.000Z | src/pyscaffold/contrib/setuptools_scm/hg.py | jleni/pyscaffold | 0d0ed09235ec6f0f608a1ae45a1fef26cb74ffde | [
"MIT"
] | 2 | 2017-10-04T19:38:48.000Z | 2017-10-04T19:45:07.000Z | src/pyscaffold/contrib/setuptools_scm/hg.py | jleni/pyscaffold | 0d0ed09235ec6f0f608a1ae45a1fef26cb74ffde | [
"MIT"
] | 2 | 2018-10-03T09:37:36.000Z | 2019-07-31T02:13:58.000Z | import os
from .utils import do, trace, data_from_mime, has_command
from .version import meta, tags_to_versions
FILES_COMMAND = 'hg locate -I .'
def _hg_tagdist_normalize_tagcommit(root, tag, dist, node):
dirty = node.endswith('+')
node = 'h' + node.strip('+')
# Detect changes since the specified tag
... | 31.27381 | 79 | 0.574039 |
a99a1adbda277aa3ef6b3b59980e09cec889db71 | 1,138 | py | Python | chapter_4/4.11.py | frbaroni/ctci | ff2f308aae76ab0e3dde09c7f88f37b86073cb38 | [
"MIT"
] | null | null | null | chapter_4/4.11.py | frbaroni/ctci | ff2f308aae76ab0e3dde09c7f88f37b86073cb38 | [
"MIT"
] | null | null | null | chapter_4/4.11.py | frbaroni/ctci | ff2f308aae76ab0e3dde09c7f88f37b86073cb38 | [
"MIT"
] | null | null | null | import unittest
import random
import collections
from mytree import Tree
tree_items = [50, 25, 75, 10, 40, 65, 80]
tree = Tree.create_normal(tree_items)
# Cache 'size' on Tree insertion/remove
def tree_size(head):
def count(node):
if node is None:
return 0
else:
return 1 + ... | 26.465116 | 65 | 0.623023 |
3a7c21404d2ba6164bddea9909151e0c09744318 | 1,129 | py | Python | api/crawl_data.py | osamhack2020/WEB_Major-Ring_5mA | 6da90afb2fc0f206b094eab904ee993e848b1b4b | [
"MIT"
] | 2 | 2020-10-10T11:48:20.000Z | 2020-10-18T06:18:46.000Z | api/crawl_data.py | osamhack2020/WEB_Major-Ring_5mA | 6da90afb2fc0f206b094eab904ee993e848b1b4b | [
"MIT"
] | 2 | 2020-10-25T11:12:59.000Z | 2020-10-31T01:41:32.000Z | api/crawl_data.py | osamhack2020/WEB_Major-Ring_5mA | 6da90afb2fc0f206b094eab904ee993e848b1b4b | [
"MIT"
] | 2 | 2020-10-10T09:23:27.000Z | 2020-10-10T09:39:55.000Z | #api for crawling
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
def crawl_wevity(Contest, db):
for i in range(0, 99):
url = "https://www.wevity.com/?c=find&s=1&gp=" + str(i)
soup = BeautifulSoup(urlopen(url), "html.parser")
# 불필요 span 태그 제거
for span in s... | 49.086957 | 116 | 0.597874 |
3fc377648d5d6c9b5a6d0963bf856f574ef34a39 | 10,285 | py | Python | src/model_trainer.py | Sean1572/CloudSeg | c2b7b1bab8a350aec654f61323e33854ebc1547c | [
"MIT"
] | null | null | null | src/model_trainer.py | Sean1572/CloudSeg | c2b7b1bab8a350aec654f61323e33854ebc1547c | [
"MIT"
] | null | null | null | src/model_trainer.py | Sean1572/CloudSeg | c2b7b1bab8a350aec654f61323e33854ebc1547c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[2]:
#from google.colab import drive
#drive.mount('/content/drive')
# In[11]:
#rgb_img = '/content/drive/Shareddrives/ACM_Project_Team_3/HYTA-master/3GT/training'
#seg_img = '/content/drive/Shareddrives/ACM_Project_Team_3/HYTA-master/images/training'
#rgb_img = '/content... | 32.342767 | 158 | 0.615946 |
ff9503f91d32deecf6754577f53747592a43c4bc | 10,423 | py | Python | api/app.py | frco9/karl-segmentation | 84758aa42a8b3d7890ac6a58fa608753fdde0b92 | [
"MIT"
] | null | null | null | api/app.py | frco9/karl-segmentation | 84758aa42a8b3d7890ac6a58fa608753fdde0b92 | [
"MIT"
] | null | null | null | api/app.py | frco9/karl-segmentation | 84758aa42a8b3d7890ac6a58fa608753fdde0b92 | [
"MIT"
] | null | null | null | from __future__ import print_function
#api/app.py
import os
import requests
from flask import Flask, current_app, Response, json, jsonify, request
from flask_cors import CORS
import pandas as pd
import argparse
from datetime import datetime
import os
import sys
import time
import scipy.misc
import cv2
from PIL import I... | 36.065744 | 130 | 0.657968 |
db61eba8eb1ff0874a0c03ae47c874b12ab5e71c | 741 | py | Python | AddBinary67.py | Bit64L/LeetCode-Python- | 64847cbb1adcaca4561b949e8acc52e8e031a6cb | [
"MIT"
] | null | null | null | AddBinary67.py | Bit64L/LeetCode-Python- | 64847cbb1adcaca4561b949e8acc52e8e031a6cb | [
"MIT"
] | null | null | null | AddBinary67.py | Bit64L/LeetCode-Python- | 64847cbb1adcaca4561b949e8acc52e8e031a6cb | [
"MIT"
] | null | null | null | class Solution:
def addBinary(self, a, b):
"""
:type a: str
:type b: str
:rtype: str
"""
len_a = len(a) - 1
len_b = len(b) - 1
c = ""
accu, i = 0, 0
while len_a >= 0 or len_b >= 0:
if len_a >= 0 and len_b >= 0:
sum_ =... | 23.903226 | 53 | 0.407557 |
a4a14b8bdaefa312ab07f5255f38d2932f86a97a | 1,018 | py | Python | blog/migrations/0001_initial.py | Shawn9717/Neighberhood | d2cbc5e2489e56547703914f90fb663f8d1e92d0 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | Shawn9717/Neighberhood | d2cbc5e2489e56547703914f90fb663f8d1e92d0 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | Shawn9717/Neighberhood | d2cbc5e2489e56547703914f90fb663f8d1e92d0 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-01-07 19:41
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 33.933333 | 120 | 0.620825 |
18baf4f58c9ab3a682c1b1ac0ae1ff347e0395d0 | 613 | py | Python | 4a.py | znuxor/adventofcode2017 | 79d0df07f24ea8d2793df3b1c853a85b760791c1 | [
"BSD-3-Clause"
] | null | null | null | 4a.py | znuxor/adventofcode2017 | 79d0df07f24ea8d2793df3b1c853a85b760791c1 | [
"BSD-3-Clause"
] | null | null | null | 4a.py | znuxor/adventofcode2017 | 79d0df07f24ea8d2793df3b1c853a85b760791c1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
from collections import defaultdict
with open('4a_data.txt', 'r') as problem_input:
data_input = problem_input.read().split('\n')[:-1]
# data_input = [
# 'aa bb cc dd ee',
# 'aa bb cc dd aa',
# 'aa bb cc dd aaa'
# ]
print... | 19.774194 | 54 | 0.595432 |
c76a4b0117ac73c49fa05b5ce2e8151204a522ac | 565 | py | Python | codeforces/switches-and-lamps-985b.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | 2 | 2018-01-18T11:01:36.000Z | 2021-12-20T18:14:48.000Z | codeforces/switches-and-lamps-985b.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | null | null | null | codeforces/switches-and-lamps-985b.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | null | null | null | # import random
# n, m = 2000, 2000
# print (n, m)
# for i in range(n):
# s = []
# for j in range(m):
# # if random.randint(0, 10) % 2 == 1:
# s.append('1')
# # else:
# # s.append('0')
# print (''.join(s))
n, m = map(int, input().split())
sums = [0] * m
strs = []
for i in range(n):
s = input()
strs.appen... | 18.225806 | 40 | 0.497345 |
18fcbd565e1e2623144773f02a21b2a5d3c72c6e | 2,605 | py | Python | audacityAnnotation2WAVs.py | ShireeshPyreddy/pyAudioAnalysis | 50276482f52710c322711fd5159c4d4fc229d64c | [
"Apache-2.0"
] | null | null | null | audacityAnnotation2WAVs.py | ShireeshPyreddy/pyAudioAnalysis | 50276482f52710c322711fd5159c4d4fc229d64c | [
"Apache-2.0"
] | null | null | null | audacityAnnotation2WAVs.py | ShireeshPyreddy/pyAudioAnalysis | 50276482f52710c322711fd5159c4d4fc229d64c | [
"Apache-2.0"
] | null | null | null | import glob
import os
import audioBasicIO
import sys
import csv
import scipy.io.wavfile as wavfile
def annotation2files(wavFile, csvFile):
'''
Break an audio stream to segments of interest,
defined by a csv file
- wavFile: path to input wavfile
- csvFile: path to cs... | 38.880597 | 139 | 0.597313 |
e40f6da8840b6dffbb7e7ae9f4c4a95301a05991 | 45,005 | py | Python | model/backbone/inception/v1bn.py | ahu-hpt/AOMD | 8d99dbb803feaef55fc089bfb3399d2fb21d55d8 | [
"Apache-2.0"
] | 2 | 2020-08-24T07:57:16.000Z | 2022-01-16T02:06:40.000Z | model/backbone/inception/v1bn.py | ahu-hpt/AOMD | 8d99dbb803feaef55fc089bfb3399d2fb21d55d8 | [
"Apache-2.0"
] | null | null | null | model/backbone/inception/v1bn.py | ahu-hpt/AOMD | 8d99dbb803feaef55fc089bfb3399d2fb21d55d8 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
__all__ = ['InceptionV1BN']
pretrained_settings = {
'bninception': {
'imagenet': {
# Was ported using python2 (may trigger warning)
'url': 'http://data.lip6.fr/cadene/pretrainedmodels/bn_inception-239d22... | 84.755179 | 160 | 0.769914 |
f6c74546ea131447c55e77562dab545fa4025daa | 17,999 | py | Python | nested_inline/admin.py | lexygon/django-nested-inline | 38e9aca6ccad3a242fa76c37d8e1aed7bce9a7ad | [
"MIT"
] | null | null | null | nested_inline/admin.py | lexygon/django-nested-inline | 38e9aca6ccad3a242fa76c37d8e1aed7bce9a7ad | [
"MIT"
] | null | null | null | nested_inline/admin.py | lexygon/django-nested-inline | 38e9aca6ccad3a242fa76c37d8e1aed7bce9a7ad | [
"MIT"
] | null | null | null | from django import VERSION
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.options import reverse, InlineModelAdmin
from django.core.exceptions import PermissionDenied
from django.forms.formsets import all_valid
from django.http import Http404
from django.utils.decora... | 46.033248 | 156 | 0.607034 |
342bba8b6a5911ea6808c55d3ab89582a6f80b41 | 153 | py | Python | PythonScript/PythonIntermedio/cap_2/excepciones.py | FranklinA/CoursesAndSelfStudy | 63a699d6df7eef52190b608e2dd5728f7aa7264a | [
"MIT"
] | null | null | null | PythonScript/PythonIntermedio/cap_2/excepciones.py | FranklinA/CoursesAndSelfStudy | 63a699d6df7eef52190b608e2dd5728f7aa7264a | [
"MIT"
] | null | null | null | PythonScript/PythonIntermedio/cap_2/excepciones.py | FranklinA/CoursesAndSelfStudy | 63a699d6df7eef52190b608e2dd5728f7aa7264a | [
"MIT"
] | null | null | null | #
lista=[2,4]
try:
print(lista[5])
except IndexError:
print("Error: error en el indice")
else:
print("No hay error")
finally:
print("Se ejecutó")
| 10.928571 | 35 | 0.666667 |
50d270f27cc825b4c04ac94bc88d24f7d1b275fa | 1,016 | py | Python | minos/examples/ga/dataset.py | qorrect/sisy | 4c279f3a47109395d57521b5c8144b18693737fc | [
"Apache-2.0"
] | 6 | 2017-09-15T03:14:10.000Z | 2019-12-03T04:15:21.000Z | minos/examples/ga/dataset.py | qorrect/sisy | 4c279f3a47109395d57521b5c8144b18693737fc | [
"Apache-2.0"
] | 2 | 2017-09-21T01:49:42.000Z | 2017-09-23T16:33:01.000Z | minos/examples/ga/dataset.py | qorrect/sisy | 4c279f3a47109395d57521b5c8144b18693737fc | [
"Apache-2.0"
] | null | null | null | '''
Created on Feb 19, 2017
@author: julien
'''
from keras.datasets import reuters
from keras.preprocessing.text import Tokenizer
from keras.utils import np_utils
from minos.train.utils import SimpleBatchIterator
import numpy as np
def get_reuters_dataset(batch_size, max_words):
(X_train, y_train), (X_test, y_... | 29.882353 | 96 | 0.727362 |
12c75356ac20e8703cbd02be9c25d28e94bef503 | 3,527 | py | Python | setup.py | vanvalenlab/deepcell-tf | ec48625be3206bcc513783856bc42bd221bac9d0 | [
"Apache-2.0"
] | 250 | 2018-09-19T23:55:06.000Z | 2022-03-30T02:20:52.000Z | setup.py | vanvalenlab/deepcell-tf | ec48625be3206bcc513783856bc42bd221bac9d0 | [
"Apache-2.0"
] | 251 | 2018-09-21T17:09:43.000Z | 2022-02-28T19:04:50.000Z | setup.py | vanvalenlab/deepcell-tf | ec48625be3206bcc513783856bc42bd221bac9d0 | [
"Apache-2.0"
] | 64 | 2018-11-29T15:22:15.000Z | 2022-03-21T03:37:43.000Z | # Copyright 2016-2021 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 34.920792 | 80 | 0.641622 |
f4a4af31c61b48838b4fdc20ddb101ea1125f1ec | 9,913 | py | Python | flow/core/rewards.py | kristery/flow | 2638f8137541424af8de23159260d73c571f2e04 | [
"MIT"
] | null | null | null | flow/core/rewards.py | kristery/flow | 2638f8137541424af8de23159260d73c571f2e04 | [
"MIT"
] | null | null | null | flow/core/rewards.py | kristery/flow | 2638f8137541424af8de23159260d73c571f2e04 | [
"MIT"
] | null | null | null | """A series of reward functions."""
import numpy as np
def desired_velocity(env, fail=False, edge_list=None):
r"""Encourage proximity to a desired velocity.
This function measures the deviation of a system of vehicles from a
user-specified desired velocity peaking when all vehicles in the ring
are s... | 30.130699 | 79 | 0.650963 |
fb4a3d7f4c619e2e4b1d522128897b6eb49b0ba8 | 1,602 | py | Python | techa/cycle.py | havocesp/techa | 518f90805b0728466836993b88e820bc8b0405b1 | [
"Unlicense"
] | 21 | 2018-06-04T13:46:02.000Z | 2021-12-19T01:20:12.000Z | techa/cycle.py | havocesp/techa | 518f90805b0728466836993b88e820bc8b0405b1 | [
"Unlicense"
] | null | null | null | techa/cycle.py | havocesp/techa | 518f90805b0728466836993b88e820bc8b0405b1 | [
"Unlicense"
] | 7 | 2018-09-29T05:53:33.000Z | 2020-12-27T10:02:30.000Z | # -*- coding: utf-8 -*-
"""
Cycle Indicators
"""
import pandas as pd
from talib.abstract import Function
__all__ = ['HT_DCPERIOD', 'HT_DCPHASE', 'HT_SINE', 'HT_TRENDMODE', 'HT_PHASOR']
def HT_DCPERIOD(data):
"""
Hilbert Transform
Dominant Cycle Period
:param pd.DataFrame data: pandas DataFrame with... | 21.36 | 79 | 0.672285 |
dc97e6322a1abe417b1cfbf39bc2b756cc9fe0dd | 197,492 | py | Python | venv/Lib/site-packages/xero_python/payrollnz/api/payroll_nz_api.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/xero_python/payrollnz/api/payroll_nz_api.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/xero_python/payrollnz/api/payroll_nz_api.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Xero Payroll NZ
This is the Xero Payroll API for orgs in the NZ region. # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
"""
OpenAPI spec version: 2.10.4
"""
import importlib
import re # noqa: F401
from xero_python import exceptions
from... | 35.38015 | 248 | 0.594814 |
44d6d325a716310d1708dea98a9467670d05773d | 6,649 | py | Python | Simulation_pypuf/bb84_xorpuf4_adaptive.py | mayaobobby/hybridpuf_simulation | 2497f4afd62e635fc607af7aa8436b3a387c2d44 | [
"Apache-2.0"
] | null | null | null | Simulation_pypuf/bb84_xorpuf4_adaptive.py | mayaobobby/hybridpuf_simulation | 2497f4afd62e635fc607af7aa8436b3a387c2d44 | [
"Apache-2.0"
] | null | null | null | Simulation_pypuf/bb84_xorpuf4_adaptive.py | mayaobobby/hybridpuf_simulation | 2497f4afd62e635fc607af7aa8436b3a387c2d44 | [
"Apache-2.0"
] | null | null | null | import netsquid as ns
import numpy as np
import os, sys
import matplotlib.pyplot as plt
from pathlib import Path
import pypuf.simulation, pypuf.io
from challenge_test import arbitrary_challenges
from apuf_attack import *
seed_puf_instances = []
seed_challenge_instances = []
'''
Description: The number of CRPs per s... | 28.054852 | 127 | 0.716348 |
ec3a53d2f8c4a78203e68823d35608c43901876b | 574 | py | Python | block/BlockGrassBlock.py | uuk0/mcpython-4 | 1ece49257b3067027cc43b452a2fc44908d3514c | [
"MIT"
] | 2 | 2019-08-21T08:23:45.000Z | 2019-09-25T13:20:28.000Z | block/BlockGrassBlock.py | uuk0/mcpython-4 | 1ece49257b3067027cc43b452a2fc44908d3514c | [
"MIT"
] | 11 | 2019-08-21T08:46:01.000Z | 2021-09-08T01:18:04.000Z | block/BlockGrassBlock.py | uuk0/mcpython-4 | 1ece49257b3067027cc43b452a2fc44908d3514c | [
"MIT"
] | 5 | 2019-08-30T08:19:57.000Z | 2019-10-26T03:31:16.000Z | """mcpython - a minecraft clone written in python licenced under MIT-licence
authors: uuk, xkcdjerry
original game by forgleman licenced under MIT-licence
minecraft by Mojang
blocks based on 1.14.4.jar of minecraft, downloaded on 20th of July, 2019"""
import globals as G
from . import Block
@G.registry
class BlockG... | 22.96 | 76 | 0.695122 |
ccf217f069fa7ac180dfef39b4e4bd705acb1163 | 743 | py | Python | tinymce/urls.py | yychen/django-tinymce | 8aca4af6d6be06e68c2fce2779679875b11c302e | [
"MIT"
] | 1 | 2019-04-15T10:28:49.000Z | 2019-04-15T10:28:49.000Z | tinymce/urls.py | vstoykov/django-tinymce | 1df8fe70f081419e7e79ed8c9f8d1a2644c814df | [
"MIT"
] | 9 | 2019-12-05T20:37:07.000Z | 2022-02-10T12:34:48.000Z | tinymce/urls.py | vstoykov/django-tinymce | 1df8fe70f081419e7e79ed8c9f8d1a2644c814df | [
"MIT"
] | 1 | 2022-03-27T05:19:58.000Z | 2022-03-27T05:19:58.000Z | # Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
try:
from django.conf.urls import url, patterns
except:
from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('tinymce.views',
url(r'^js/textareas/(?P<name>.+)/$', 'textareas_js', name='t... | 41.277778 | 93 | 0.664872 |
99a71515f39edd2452617c4e4f775f04e23693df | 1,322 | py | Python | arcade/gl/__init__.py | thecodinghyrax/arcade | 3d38ab42ce06e737f48240223484aa7706ffa11c | [
"MIT"
] | null | null | null | arcade/gl/__init__.py | thecodinghyrax/arcade | 3d38ab42ce06e737f48240223484aa7706ffa11c | [
"MIT"
] | null | null | null | arcade/gl/__init__.py | thecodinghyrax/arcade | 3d38ab42ce06e737f48240223484aa7706ffa11c | [
"MIT"
] | null | null | null | """
**Fair warning: This module contains the low level rendering API for arcade
and is only recommended for more advanced users**
This modules contains a wrapper over OpenGL 3.3 core making OpenGL
more reasonable to work with and easier to learn.
The API is based on `ModernGL <https://github.com/moderngl/moderngl>`_ i... | 30.045455 | 102 | 0.757943 |
5b3b46045c3dec29d887fb8daf89d1c0a4cc34dc | 9,199 | py | Python | respa_o365/calendar_sync.py | codepointtku/respa | bb9cd8459d5562569f976dbc609ec41ceecc8023 | [
"MIT"
] | null | null | null | respa_o365/calendar_sync.py | codepointtku/respa | bb9cd8459d5562569f976dbc609ec41ceecc8023 | [
"MIT"
] | 38 | 2020-01-24T11:30:53.000Z | 2022-01-28T12:42:47.000Z | respa_o365/calendar_sync.py | codepointtku/respa | bb9cd8459d5562569f976dbc609ec41ceecc8023 | [
"MIT"
] | 14 | 2020-02-26T08:17:34.000Z | 2021-09-14T07:57:21.000Z | import logging
import json
from django.db import transaction, DatabaseError
from respa_o365.respa_availabilility_repository import RespaAvailabilityRepository
from respa_o365.o365_availability_repository import O365AvailabilityRepository
import string
import random
from django.conf import settings
from django.utils.d... | 52.267045 | 321 | 0.718448 |
57e145891d2a045185dc3153905933cfc77d6d38 | 538 | py | Python | manage.py | nibinn/Rnd | e306b3da3af5e9da66d11436bc7abf3a77f50573 | [
"MIT"
] | null | null | null | manage.py | nibinn/Rnd | e306b3da3af5e9da66d11436bc7abf3a77f50573 | [
"MIT"
] | null | null | null | manage.py | nibinn/Rnd | e306b3da3af5e9da66d11436bc7abf3a77f50573 | [
"MIT"
] | null | null | null | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | 29.888889 | 73 | 0.674721 |
3012c72d3cba79e4781a2da3a0883b10b7220092 | 3,452 | py | Python | app/app/settings.py | daveholly57/recipe-app-api | 41bef8bf7baf1a8cf17f1be4cf930e4e4f231569 | [
"MIT"
] | null | null | null | app/app/settings.py | daveholly57/recipe-app-api | 41bef8bf7baf1a8cf17f1be4cf930e4e4f231569 | [
"MIT"
] | null | null | null | app/app/settings.py | daveholly57/recipe-app-api | 41bef8bf7baf1a8cf17f1be4cf930e4e4f231569 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bui... | 25.57037 | 91 | 0.687717 |
16b12944a81906e7889598a6abc4eea87a1cd167 | 639 | py | Python | code/exampleStrats/aaratio.py | yoyoyonono/PrisonersDilemmaTournament | 3b960e5549908ab0cc62c856427ccb7c867ab0a3 | [
"MIT"
] | null | null | null | code/exampleStrats/aaratio.py | yoyoyonono/PrisonersDilemmaTournament | 3b960e5549908ab0cc62c856427ccb7c867ab0a3 | [
"MIT"
] | null | null | null | code/exampleStrats/aaratio.py | yoyoyonono/PrisonersDilemmaTournament | 3b960e5549908ab0cc62c856427ccb7c867ab0a3 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Literal, Tuple, Union
import random
import numpy as np
def strategy(history: np.ndarray, memory: Union[Dict[str, Any], None]) -> Tuple[int, Union[Dict[str, Any], None]]:
#First Round
if history.shape[1] == 0:
memory = {}
memory['next_prediction'] = 1
retur... | 29.045455 | 114 | 0.5759 |
c38d017f6de121cc57d2bc60400334730975b902 | 4,531 | py | Python | melp/libs/helices.py | maximilianKoeper/melp | 863d1c55a36adf29f3508e15ecd5ed0a77544f53 | [
"MIT"
] | 1 | 2021-12-07T10:00:23.000Z | 2021-12-07T10:00:23.000Z | melp/libs/helices.py | maximilianKoeper/melp | 863d1c55a36adf29f3508e15ecd5ed0a77544f53 | [
"MIT"
] | null | null | null | melp/libs/helices.py | maximilianKoeper/melp | 863d1c55a36adf29f3508e15ecd5ed0a77544f53 | [
"MIT"
] | 1 | 2021-11-15T13:41:06.000Z | 2021-11-15T13:41:06.000Z | import numpy as np
from scipy.optimize import minimize, brute
from melp.libs import mathfunctions as mf
# DEBUG: Delete after testing is finished
# import matplotlib.pyplot as plt
class Helices:
def __init__(self, vx, vy, vz, px, py, pz, htype, tile_pos):
self.bfield = -1
self.z0 = vz
... | 30.823129 | 143 | 0.543368 |
73bf3fd2ed97af265af2bf92646c82b27c3d79b0 | 21,935 | py | Python | test/functional/test_framework/util.py | HuntCoinDeveloper/huntcoin | 99198152d21b58ce598f46783074b64113cc5e64 | [
"MIT"
] | 2 | 2019-05-13T02:10:08.000Z | 2019-05-26T14:47:29.000Z | test/functional/test_framework/util.py | HuntCoinDeveloper/huntcoin | 99198152d21b58ce598f46783074b64113cc5e64 | [
"MIT"
] | null | null | null | test/functional/test_framework/util.py | HuntCoinDeveloper/huntcoin | 99198152d21b58ce598f46783074b64113cc5e64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | 38.147826 | 119 | 0.650331 |
c694fcd4b988155371f12972811bd006b7a2dfc1 | 14,548 | py | Python | vsphere/datadog_checks/vsphere/metrics.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | vsphere/datadog_checks/vsphere/metrics.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | vsphere/datadog_checks/vsphere/metrics.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from pyVmomi import vim
# https://code.vmware.com/apis/358/vsphere/doc/cpu_counters.html
# Set of metrics that are emitted as percentages between 0 and 100. For those metrics, we divide the value by 100
# to g... | 30.756871 | 113 | 0.681949 |
e31c12bd64cd6bd69b8053c71bea1c69b001d67a | 1,064 | py | Python | ml_demo/predict.py | mmqm4544/rta | 6e34e4f9eace2f58bb7376603de6f144a0b0658b | [
"MIT"
] | 2 | 2019-02-14T02:33:15.000Z | 2019-02-14T02:33:17.000Z | ml_demo/predict.py | mmqm4544/rta | 6e34e4f9eace2f58bb7376603de6f144a0b0658b | [
"MIT"
] | null | null | null | ml_demo/predict.py | mmqm4544/rta | 6e34e4f9eace2f58bb7376603de6f144a0b0658b | [
"MIT"
] | null | null | null | import os
from sklearn.externals import joblib
from preprocessing import SQLPreprocessor
from db import DBClient
class Predictor(object):
def __init__(self, modelId):
self.modelId = modelId
self.client = DBClient.create()
def run(self, **kargs):
modelId = self.modelId
table_... | 32.242424 | 93 | 0.656015 |
c5c20c58e115804390fa0f6a754ec30f5878c038 | 3,984 | py | Python | test/functional/wallet_scriptaddress2.py | PuertoRicoCoin/prtc | e5e9da6028c22fe353bfb3a06bb735f563678019 | [
"MIT"
] | null | null | null | test/functional/wallet_scriptaddress2.py | PuertoRicoCoin/prtc | e5e9da6028c22fe353bfb3a06bb735f563678019 | [
"MIT"
] | null | null | null | test/functional/wallet_scriptaddress2.py | PuertoRicoCoin/prtc | e5e9da6028c22fe353bfb3a06bb735f563678019 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test new PuertoRicoTainoCoin multisig prefix functionality.
#
from test_framework.test_framework imp... | 39.058824 | 112 | 0.650853 |
63c4b7105ca9d02b92a93948879588e1e469a213 | 2,098 | py | Python | day14/reindeer_race.py | JulienCote/advent_of_code_2015 | 567a589c6b1c161ebfba8dcf1b9f3bc1bf6e0d00 | [
"MIT"
] | null | null | null | day14/reindeer_race.py | JulienCote/advent_of_code_2015 | 567a589c6b1c161ebfba8dcf1b9f3bc1bf6e0d00 | [
"MIT"
] | null | null | null | day14/reindeer_race.py | JulienCote/advent_of_code_2015 | 567a589c6b1c161ebfba8dcf1b9f3bc1bf6e0d00 | [
"MIT"
] | null | null | null | import copy
reindeers = {}
race_time = 2503
def distance_based_race():
winner_distance = 0
for reindeer in reindeers.values():
full_cycle = race_time // (reindeer[1] + reindeer[2])
remaining_time_last_cycle = race_time % (reindeer[1] + reindeer[2])
remaining_distance_last_cycle = remai... | 37.464286 | 126 | 0.632031 |
9034a574b7f1b034ff83a63bd57ac98b92ff0d51 | 1,267 | py | Python | satgenpy/tests/test_basic.py | KaushikChavali/hypatia | 6f701ce0fe745fe2687c75e5c90b5f235e6b1ce5 | [
"MIT"
] | 70 | 2020-10-31T03:53:11.000Z | 2022-03-30T12:22:24.000Z | satgenpy/tests/test_basic.py | KaushikChavali/hypatia | 6f701ce0fe745fe2687c75e5c90b5f235e6b1ce5 | [
"MIT"
] | 9 | 2021-03-19T06:20:24.000Z | 2022-03-18T14:03:47.000Z | satgenpy/tests/test_basic.py | KaushikChavali/hypatia | 6f701ce0fe745fe2687c75e5c90b5f235e6b1ce5 | [
"MIT"
] | 39 | 2020-10-02T11:59:08.000Z | 2022-03-27T16:41:06.000Z | # The MIT License (MIT)
#
# Copyright (c) 2020 ETH Zurich
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 40.870968 | 80 | 0.770324 |
5afdcfdbcc3f45e501cc9c8305ec79e5cbd016d2 | 42,170 | py | Python | custos-client-sdks/custos-python-sdk/build/lib/custos/server/integration/UserManagementService_pb2.py | apache/airavata-custos | 075dd26c364b5b5abe8a4f2b226b2de30474f8e4 | [
"Apache-2.0"
] | 10 | 2019-05-21T22:42:35.000Z | 2022-03-25T15:58:09.000Z | custos-client-sdks/custos-python-sdk/build/lib/custos/server/integration/UserManagementService_pb2.py | apache/airavata-custos | 075dd26c364b5b5abe8a4f2b226b2de30474f8e4 | [
"Apache-2.0"
] | 83 | 2019-02-22T12:22:14.000Z | 2022-03-30T13:42:47.000Z | custos-client-sdks/custos-python-sdk/build/lib/custos/server/integration/UserManagementService_pb2.py | apache/airavata-custos | 075dd26c364b5b5abe8a4f2b226b2de30474f8e4 | [
"Apache-2.0"
] | 20 | 2019-02-22T08:10:05.000Z | 2021-11-07T19:37:04.000Z | # -*- coding: utf-8 -*-
# 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... | 55.124183 | 7,123 | 0.779298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.