hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 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 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bd0d3e125e8fa9cf371de0d2149bace1dd5a5ff2 | 11,845 | py | Python | ufotest/plugin.py | the16thpythonist/ufotest | 8c94e4227180328e6c29d6700c9a5f4aaecab3d2 | [
"MIT"
] | null | null | null | ufotest/plugin.py | the16thpythonist/ufotest | 8c94e4227180328e6c29d6700c9a5f4aaecab3d2 | [
"MIT"
] | 3 | 2021-03-19T15:52:59.000Z | 2022-01-13T03:32:31.000Z | ufotest/plugin.py | the16thpythonist/ufotest | 8c94e4227180328e6c29d6700c9a5f4aaecab3d2 | [
"MIT"
] | null | null | null |
"""
PLANNING
So I want the plugin manager to work really similar to how the hook system in Wordpress works:
https://developer.wordpress.org/plugins/hooks/
Thats because I already have a lot of experience with that system and I kind of really like it. It just makes sense
and is rather intuitive to use. The main point ... | 50.190678 | 119 | 0.690756 | import os
import sys
import importlib.util
from typing import Any, Callable, Tuple
from collections import defaultdict
"""
PLANNING
So I want the plugin manager to work really similar to how the hook system in Wordpress works:
https://developer.wordpress.org/plugins/hooks/
Thats because I already have a lot of exper... | 0 | 1,690 | 0 | 9,321 | 0 | 0 | 0 | 9 | 134 |
5d86b35f3db11dad55a452934b8cb9df5ddcae92 | 951 | py | Python | src/applications/train_siamesenet.py | myelinio/SpectralNet | 9366942b7b98f6c2abf7159101feddbcc7c1bee5 | [
"MIT"
] | null | null | null | src/applications/train_siamesenet.py | myelinio/SpectralNet | 9366942b7b98f6c2abf7159101feddbcc7c1bee5 | [
"MIT"
] | null | null | null | src/applications/train_siamesenet.py | myelinio/SpectralNet | 9366942b7b98f6c2abf7159101feddbcc7c1bee5 | [
"MIT"
] | null | null | null | """
"""
import argparse
import keras.backend.tensorflow_backend as ktf
from applications.config import get_siamese_config
from applications.siamesenet import run_net
from core.data import load_siamese_data
from core.util import get_session
# add directories in src/ to path
# sys.path.insert(0, os.path.abspath(os.pat... | 28.818182 | 101 | 0.774974 | """
"""
import argparse
import os
import h5py
import keras.backend.tensorflow_backend as ktf
import tensorflow as tf
from applications.config import get_siamese_config
from applications.siamesenet import run_net
from core.data import build_siamese_data, load_siamese_data
from core.util import get_session
# add dire... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 67 |
218b5905c37ae4ce27c82b8d0a072722a71447ef | 2,657 | py | Python | consent_manager/consent_manager/urls.py | crs4/health-gateway | e18d945b593fa5efcebe7ee33f7e8991bbe1803d | [
"MIT"
] | 5 | 2018-05-16T22:58:01.000Z | 2020-01-14T11:12:17.000Z | consent_manager/consent_manager/urls.py | PhilanthroLab/health-gateway | e18d945b593fa5efcebe7ee33f7e8991bbe1803d | [
"MIT"
] | 10 | 2018-04-13T15:56:49.000Z | 2019-12-05T08:57:47.000Z | consent_manager/consent_manager/urls.py | PhilanthroLab/health-gateway | e18d945b593fa5efcebe7ee33f7e8991bbe1803d | [
"MIT"
] | 6 | 2019-10-02T08:39:12.000Z | 2020-06-23T00:18:03.000Z | # Copyright (c) 2017-2018 CRS4
#
# 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, merge, publish, distribut... | 51.096154 | 118 | 0.733534 | # Copyright (c) 2017-2018 CRS4
#
# 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, merge, publish, distribut... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 23 |
e449ed54a476bf75fa0b35cf1c0a2f427c5e7128 | 2,944 | py | Python | src/sentry/web/frontend/integration_extension_configuration.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/frontend/integration_extension_configuration.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/frontend/integration_extension_configuration.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
| 35.902439 | 106 | 0.650815 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.utils.http import urlencode
from django.http import HttpResponseRedirect
from sentry.integrations.pipeline import IntegrationPipeline
from sentry.web.frontend.base import BaseView
from sentry.models import Organization
c... | 0 | 0 | 0 | 2,579 | 0 | 0 | 0 | 144 | 180 |
f9f1ab3479a8fdfb4a582f1ffff596182f66eccb | 90 | py | Python | Day 7/question3.py | shivang-prabhu/python-assignment-project | e61e1b683425fb595699bbb432d0932c97c064e4 | [
"MIT"
] | null | null | null | Day 7/question3.py | shivang-prabhu/python-assignment-project | e61e1b683425fb595699bbb432d0932c97c064e4 | [
"MIT"
] | null | null | null | Day 7/question3.py | shivang-prabhu/python-assignment-project | e61e1b683425fb595699bbb432d0932c97c064e4 | [
"MIT"
] | null | null | null | lis=[(1,2,3),[1,2],['a','hit','less']]
ils=[x for i in lis for x in i]
print(ils)
| 15 | 39 | 0.488889 | lis=[(1,2,3),[1,2],['a','hit','less']]
ils=[x for i in lis for x in i]
print(ils)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0085ac811da723708422c8c30d24151ea39a0afd | 2,010 | py | Python | PDF_FILES_MANIPULATING/B.PdfFileWriter Class/PDF_Writer_class.py | OblackatO/Network-Security | c954676453d0767e2f27cea622835e3e353b1134 | [
"MIT"
] | null | null | null | PDF_FILES_MANIPULATING/B.PdfFileWriter Class/PDF_Writer_class.py | OblackatO/Network-Security | c954676453d0767e2f27cea622835e3e353b1134 | [
"MIT"
] | null | null | null | PDF_FILES_MANIPULATING/B.PdfFileWriter Class/PDF_Writer_class.py | OblackatO/Network-Security | c954676453d0767e2f27cea622835e3e353b1134 | [
"MIT"
] | null | null | null | from PyPDF2 import PdfFileReader, PdfFileWriter
file1 = open('pdf1.pdf','rb')
file2 = open('output.pdf','wb')
filer = PdfFileReader(file1)
filew = PdfFileWriter()
#Cloning PDF reader with its properties ; see notes to see other ways to do this
try:
filew.cloneDocumentFromReader(filer)
except Exception as e:
print('N... | 26.447368 | 127 | 0.722886 | from PyPDF2 import PdfFileReader, PdfFileWriter
file1 = open('pdf1.pdf','rb')
file2 = open('output.pdf','wb')
filer = PdfFileReader(file1)
filew = PdfFileWriter()
#Cloning PDF reader with its properties ; see notes to see other ways to do this
try:
filew.cloneDocumentFromReader(filer)
except Exception as e:
print('N... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
01f1fb2e77ea7fc86324dfc1128000ce1b7d0f74 | 2,907 | py | Python | bot/player_commands/invite.py | UP929312/CommunityBot | c16294e8ff4f47d9a1e8c18c9cd4011e7ebbd67a | [
"Apache-2.0"
] | 1 | 2021-06-15T07:31:13.000Z | 2021-06-15T07:31:13.000Z | bot/player_commands/invite.py | UP929312/CommunityBot | c16294e8ff4f47d9a1e8c18c9cd4011e7ebbd67a | [
"Apache-2.0"
] | 1 | 2021-06-01T10:14:32.000Z | 2021-06-02T10:54:12.000Z | bot/player_commands/invite.py | UP929312/CommunityBot | c16294e8ff4f47d9a1e8c18c9cd4011e7ebbd67a | [
"Apache-2.0"
] | 2 | 2021-06-01T10:59:15.000Z | 2021-06-03T18:29:36.000Z |
#'''
#'''
'''
def custom_check():
print("Check!")
print((ctx.channel.permissions_for(ctx.guild.me)).send_messages)
return (ctx.channel.permissions_for(ctx.guild.me)).send_messages
#'''
'''
This is what I used for commands
def allowed_channels(allowed_channels_list):
async def predicate(ctx):
... | 45.421875 | 457 | 0.674235 | import discord # type: ignore
from discord.ext import commands # type: ignore
from discord.commands import permissions # type: ignore
from utils import guild_ids
#'''
def custom_check(ctx):
print("This will be printed on startup")
print(a)
return (ctx.channel.permissions_for(ctx.guild.me)).send_message... | 0 | 477 | 1,182 | 374 | 0 | 196 | 0 | 29 | 182 |
72f3c2e08e9ae118285ffeb74909e773b471c6c8 | 20,579 | py | Python | batch/batch/cloud/azure/driver/create_instance.py | daniel-goldstein/hail | 88d7f312882eaf22d16c9d58c1223e5469c98cab | [
"MIT"
] | null | null | null | batch/batch/cloud/azure/driver/create_instance.py | daniel-goldstein/hail | 88d7f312882eaf22d16c9d58c1223e5469c98cab | [
"MIT"
] | 19 | 2022-03-03T20:11:41.000Z | 2022-03-30T20:31:57.000Z | batch/batch/cloud/azure/driver/create_instance.py | daniel-goldstein/hail | 88d7f312882eaf22d16c9d58c1223e5469c98cab | [
"MIT"
] | null | null | null | import logging
import os
log = logging.getLogger('create_instance')
BATCH_WORKER_IMAGE = os.environ['HAIL_BATCH_WORKER_IMAGE']
log.info(f'BATCH_WORKER_IMAGE {BATCH_WORKER_IMAGE}')
| 38.828302 | 184 | 0.542592 | from typing import Any, Dict, Optional
import base64
import json
import logging
import os
from shlex import quote as shq
from gear.cloud_config import get_global_config
from ....batch_configuration import (DOCKER_ROOT_IMAGE, DOCKER_PREFIX, DEFAULT_NAMESPACE,
INTERNAL_GATEWAY_IP)
f... | 0 | 0 | 0 | 0 | 0 | 19,852 | 0 | 296 | 246 |
c976e216d8c906c85552f7ac3a219e05322c54d4 | 7,582 | py | Python | avacloud_client_python/models/stlb_reference_dto.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | 1 | 2019-01-12T18:10:24.000Z | 2019-01-12T18:10:24.000Z | avacloud_client_python/models/stlb_reference_dto.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | avacloud_client_python/models/stlb_reference_dto.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
| 29.387597 | 136 | 0.595489 | # coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class STLBReferenceDto(object):
"""NOTE: This class is auto... | 0 | 3,734 | 0 | 3,569 | 0 | 0 | 0 | -31 | 105 |
d8461cf5c51d4e051e54d79bad3280158598aa60 | 735 | py | Python | aiodownload/example/03_each.py | jelloslinger/aiodownload | 29b3bc49cdaec9615933d326b338865fd903571c | [
"MIT"
] | 10 | 2017-05-25T23:02:00.000Z | 2020-04-04T16:18:56.000Z | aiodownload/example/03_each.py | jelloslinger/aiodownload | 29b3bc49cdaec9615933d326b338865fd903571c | [
"MIT"
] | null | null | null | aiodownload/example/03_each.py | jelloslinger/aiodownload | 29b3bc49cdaec9615933d326b338865fd903571c | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 22.272727 | 79 | 0.62585 | import aiodownload
from aiodownload.example import logger
class Example:
def __init__(self, number, flag):
self.number = number
self.flag = flag
def main():
examples = [Example(i, True if i % 2 == 0 else False) for i in range(0, 5)]
url_map = lambda x: 'https://httpbin.org/links/{}'.for... | 0 | 0 | 0 | 86 | 0 | 503 | 0 | 14 | 90 |
9869308c3f4a32c54000e48993e39c0f4609d453 | 3,017 | py | Python | ExerciciosPython/aula016.py | MecaFlavio/Exercicios-Python-3-Curso-em-Video | b93272c15b19b04deff73f1b0a684a0b49313edf | [
"MIT"
] | null | null | null | ExerciciosPython/aula016.py | MecaFlavio/Exercicios-Python-3-Curso-em-Video | b93272c15b19b04deff73f1b0a684a0b49313edf | [
"MIT"
] | null | null | null | ExerciciosPython/aula016.py | MecaFlavio/Exercicios-Python-3-Curso-em-Video | b93272c15b19b04deff73f1b0a684a0b49313edf | [
"MIT"
] | null | null | null | # Aula 16 - Vaiaveis compostas: Tuplas
lanche = ('hamburger', 'suco', 'pizza', 'pudim') # tupla criada, pode ser criada sem parenteses np python 3
print(lanche) # mostra a tupla em parenteses e os seus elementos
print(lanche[1]) # mostra o elemento 1 da tupla
print(lanche[-1]) # mostra o elemento -1 da tupla
# Tu... | 41.902778 | 117 | 0.724892 | # Aula 16 - Vaiaveis compostas: Tuplas
lanche = ('hamburger', 'suco', 'pizza', 'pudim') # tupla criada, pode ser criada sem parenteses np python 3
print(lanche) # mostra a tupla em parenteses e os seus elementos
print(lanche[1]) # mostra o elemento 1 da tupla
print(lanche[-1]) # mostra o elemento -1 da tupla
# Tu... | 50 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ae8673c11ee0d05cecd9bcd7bafd2969050210b0 | 35 | py | Python | src/common/definitions.py | mehrdad-shokri/macro_pack | bcc39728ae70f99e95998cbb48a8beb9e7697031 | [
"Apache-2.0"
] | 3 | 2020-10-10T01:55:54.000Z | 2021-09-30T11:49:02.000Z | src/common/definitions.py | mehrdad-shokri/macro_pack | bcc39728ae70f99e95998cbb48a8beb9e7697031 | [
"Apache-2.0"
] | null | null | null | src/common/definitions.py | mehrdad-shokri/macro_pack | bcc39728ae70f99e95998cbb48a8beb9e7697031 | [
"Apache-2.0"
] | 1 | 2022-03-26T00:55:01.000Z | 2022-03-26T00:55:01.000Z |
VERSION="1.9.4"
LOGLEVEL = "INFO" | 8.75 | 17 | 0.628571 |
VERSION="1.9.4"
LOGLEVEL = "INFO" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b4711b50dd2309b5e08e0c12639a56fa2342aea3 | 675 | py | Python | homeassistant/components/airly/const.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | homeassistant/components/airly/const.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 54 | 2020-11-17T07:04:57.000Z | 2022-03-31T06:45:39.000Z | homeassistant/components/airly/const.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Constants for Airly integration."""
ATTR_API_ADVICE = "ADVICE"
ATTR_API_CAQI = "CAQI"
ATTR_API_CAQI_DESCRIPTION = "DESCRIPTION"
ATTR_API_CAQI_LEVEL = "LEVEL"
ATTR_API_HUMIDITY = "HUMIDITY"
ATTR_API_PM1 = "PM1"
ATTR_API_PM10 = "PM10"
ATTR_API_PM10_LIMIT = "PM10_LIMIT"
ATTR_API_PM10_PERCENT = "PM10_PERCENT"
ATTR_API_P... | 30.681818 | 65 | 0.786667 | """Constants for Airly integration."""
ATTR_API_ADVICE = "ADVICE"
ATTR_API_CAQI = "CAQI"
ATTR_API_CAQI_DESCRIPTION = "DESCRIPTION"
ATTR_API_CAQI_LEVEL = "LEVEL"
ATTR_API_HUMIDITY = "HUMIDITY"
ATTR_API_PM1 = "PM1"
ATTR_API_PM10 = "PM10"
ATTR_API_PM10_LIMIT = "PM10_LIMIT"
ATTR_API_PM10_PERCENT = "PM10_PERCENT"
ATTR_API_P... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e0c262fa2f0a9220966a57cff9f22df7b123f5f | 10,939 | py | Python | picoCTF-web/api/shell_servers.py | NNHSSE201819/picoCTF | eae563c2e68dce85a1c426d086b422dc25649003 | [
"MIT"
] | null | null | null | picoCTF-web/api/shell_servers.py | NNHSSE201819/picoCTF | eae563c2e68dce85a1c426d086b422dc25649003 | [
"MIT"
] | null | null | null | picoCTF-web/api/shell_servers.py | NNHSSE201819/picoCTF | eae563c2e68dce85a1c426d086b422dc25649003 | [
"MIT"
] | null | null | null | import json
import api
import spur
from api.common import (check, InternalException, safe_fail, validate, WebException)
from voluptuous import Length, Required, Schema
server_schema = Schema(
{
Required("name"):
check(
("Name must be a reasonable string.", [str,
... | 28.339378 | 86 | 0.588811 | import json
import api
import pymongo
import spur
from api.common import (check, InternalException, safe_fail, validate,
WebException)
from voluptuous import Length, Required, Schema
server_schema = Schema(
{
Required("name"):
check(
("Name must be a reasonable ... | 0 | 0 | 0 | 0 | 0 | 909 | 0 | 17 | 45 |
beaff1178d4740cb4337f374ec7eb5c81cf74ca9 | 494 | py | Python | project_euler/49.py | huangshenno1/project_euler | 8a3c91fd11bcb6a6a830e963b1d5aed3f5ff787d | [
"MIT"
] | null | null | null | project_euler/49.py | huangshenno1/project_euler | 8a3c91fd11bcb6a6a830e963b1d5aed3f5ff787d | [
"MIT"
] | null | null | null | project_euler/49.py | huangshenno1/project_euler | 8a3c91fd11bcb6a6a830e963b1d5aed3f5ff787d | [
"MIT"
] | null | null | null | maxn = 10000
isprime = [False] * 2 + [True] * maxn
for i in range(2, maxn):
if isprime[i]:
j = i*i
while j < maxn:
isprime[j] = False
j += i
for a in range(1000, 10000):
if isprime[a]:
code = encode(a)
for inc in range(1, 4500):
b = a + inc
c = a + inc * 2
if c >= 10000:
break
if isprim... | 17.034483 | 47 | 0.534413 | maxn = 10000
isprime = [False] * 2 + [True] * maxn
for i in range(2, maxn):
if isprime[i]:
j = i*i
while j < maxn:
isprime[j] = False
j += i
def encode(x):
ret = 0
while x > 0:
ret += (x % 10)**3
x = x / 10
return ret
for a in range(1000, 10000):
if isprime[a]:
code = encode(a)
for inc in range... | 0 | 0 | 0 | 0 | 0 | 62 | 0 | 0 | 23 |
065c36d678b37e87f02d2042268e88eb0f4fc4f8 | 2,260 | py | Python | experiment.py | meetjannik/deep-q-network | a6d01817e8b53591c5aa09018d9831d1f06b7f47 | [
"MIT"
] | 1 | 2022-03-25T13:22:41.000Z | 2022-03-25T13:22:41.000Z | experiment.py | meetjannik/dqn | a6d01817e8b53591c5aa09018d9831d1f06b7f47 | [
"MIT"
] | null | null | null | experiment.py | meetjannik/dqn | a6d01817e8b53591c5aa09018d9831d1f06b7f47 | [
"MIT"
] | null | null | null | import argparse
from src.algorithm import deep_q_learning
from datetime import datetime
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# see Extended Data Table 1
parser.add_argument('--mini_batch_size', default=32)
parser.add_argument('--replay_memory_size', default=100000) # 10000... | 42.641509 | 114 | 0.74115 | import argparse
import logging
import os
from src.algorithm import deep_q_learning
from torch.utils.tensorboard import SummaryWriter
import warnings
import gym
from src.agent import DQNAgent
from src.environment import DQNEnvironment
from datetime import datetime
if __name__ == '__main__':
parser = argparse.Ar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 155 |
cee91e0a7cd69bd9e810fde981d454c673db94a7 | 4,746 | py | Python | is_even_nn.py | phschoepf/isEvenNN | 975ab4d936ab669550919a0eb91d9acffd8a4820 | [
"MIT"
] | null | null | null | is_even_nn.py | phschoepf/isEvenNN | 975ab4d936ab669550919a0eb91d9acffd8a4820 | [
"MIT"
] | null | null | null | is_even_nn.py | phschoepf/isEvenNN | 975ab4d936ab669550919a0eb91d9acffd8a4820 | [
"MIT"
] | null | null | null | import struct
def binary_float(num: float, network=True) -> list[float]:
"""Convert a float to a 32-long list of bits according to IEEE 754.
:param: num number to be converted, must be float
:param: network format in network byte order, i.e. big endian. Default True.
:returns: list of float, either... | 37.666667 | 117 | 0.600295 | import torch
import random
import struct
from torch import nn
from torch.utils.data import TensorDataset, DataLoader
from typing import Union
class IsEvenNN(object):
def __init__(self, optimizer=torch.optim.Adam, criterion=nn.L1Loss()):
self.device = torch.device("cuda" if torch.cuda.is_available() else "... | 0 | 0 | 0 | 2,989 | 0 | 949 | 0 | 18 | 225 |
e20ae054adaddd3e168e05dc5a2073da1717e776 | 3,132 | py | Python | data/crop_frames.py | Aggrathon/TrafficSignRecognizer | e8425eb967baa39b4f57f2636eb3566a291e926b | [
"Apache-2.0"
] | null | null | null | data/crop_frames.py | Aggrathon/TrafficSignRecognizer | e8425eb967baa39b4f57f2636eb3566a291e926b | [
"Apache-2.0"
] | null | null | null | data/crop_frames.py | Aggrathon/TrafficSignRecognizer | e8425eb967baa39b4f57f2636eb3566a291e926b | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
main()
| 40.153846 | 157 | 0.683589 |
import os
import pygame
from config import DIR_FRAMES_POTENTIAL, DIR_FRAMES_SIGNS, DIR_CROPPED_SIGNS, DIR_FRAMES_NO_SIGNS, IMAGE_HEIGHT, IMAGE_WIDTH, IMAGES_PER_SECOND, CROPPED_SIZE
from window import Window, get_rnd_filename, save_cropped
def no_sign(images, window, index, last):
os.rename(os.path.join(DIR_FRAM... | 0 | 0 | 0 | 0 | 0 | 2,712 | 0 | 152 | 227 |
7371bd623568cf774e17cfe3b560b41b5586c054 | 4,749 | py | Python | starthinker_ui/account/models.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 138 | 2018-11-28T21:42:44.000Z | 2022-03-30T17:26:35.000Z | starthinker_ui/account/models.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 36 | 2019-02-19T18:33:20.000Z | 2022-01-24T18:02:44.000Z | starthinker_ui/account/models.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 54 | 2018-12-06T05:47:32.000Z | 2022-02-21T22:01:01.000Z | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 30.248408 | 111 | 0.695936 | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 0 | 35 | 0 | 3,080 | 0 | 478 | 0 | 162 | 249 |
1cd8854e57629a270ecee576f8e3a1125e739dfe | 543 | py | Python | scripts/HumSensor.py | leardilap/monitoring | f0cf2c49ff1be4c33237d005899a842f0cdd6c8e | [
"MIT"
] | 1 | 2021-07-01T13:32:05.000Z | 2021-07-01T13:32:05.000Z | scripts/HumSensor.py | leardilap/monitoring | f0cf2c49ff1be4c33237d005899a842f0cdd6c8e | [
"MIT"
] | null | null | null | scripts/HumSensor.py | leardilap/monitoring | f0cf2c49ff1be4c33237d005899a842f0cdd6c8e | [
"MIT"
] | 1 | 2021-07-01T13:43:13.000Z | 2021-07-01T13:43:13.000Z | #!/usr/bin/python3.4
import snap7
client = snap7.client.Client()
client.connect('137.138.192.181', 0, 0)
topo = client.db_read(402,36,1)
topo2 = client.db_read(402,44,1)
print(hex(topo[0]), hex(topo2[0]))
print(topo[0]&0b00001, topo2[0]&0b00001)
#for probe in probes:
# byte_index=probes[probe]
# x = ... | 19.392857 | 67 | 0.694291 | #!/usr/bin/python3.4
import socket
import pickle
import struct
import serial
import time
from datetime import datetime
import sys
import math
import snap7
client = snap7.client.Client()
client.connect('137.138.192.181', 0, 0)
topo = client.db_read(402,36,1)
topo2 = client.db_read(402,44,1)
print(hex(topo[0]), h... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -55 | 177 |
6d2a659f5d9c0423ed4e59aac625ef2b6e383780 | 2,849 | py | Python | switchboard/tests_mailer.py | Duke-GCB/D4S2 | 47bef4b632967440608f2cc7a3fc31c32b2060fa | [
"MIT"
] | null | null | null | switchboard/tests_mailer.py | Duke-GCB/D4S2 | 47bef4b632967440608f2cc7a3fc31c32b2060fa | [
"MIT"
] | 138 | 2016-09-23T18:09:18.000Z | 2022-03-03T15:50:19.000Z | switchboard/tests_mailer.py | Duke-GCB/D4S2 | 47bef4b632967440608f2cc7a3fc31c32b2060fa | [
"MIT"
] | null | null | null |
TEST_EMAIL_FROM_ADDRESS='noreply@domain.com'
| 44.515625 | 135 | 0.67357 | from django.test import TestCase, override_settings
from switchboard.mailer import generate_message
TEST_EMAIL_FROM_ADDRESS='noreply@domain.com'
@override_settings(EMAIL_FROM_ADDRESS=TEST_EMAIL_FROM_ADDRESS)
class MailerTestCase(TestCase):
def setUp(self):
self.reply_to_email = 'sender@domain.com'
... | 0 | 2,679 | 0 | 0 | 0 | 0 | 0 | 56 | 67 |
0be45e1af6aebf70bf6117504616061c6e554fe6 | 26,842 | py | Python | hio-yocto-bsp/sources/poky/bitbake/lib/bb/utils.py | qiangzai00001/hio-prj | 060ff97fe21093b1369db78109d5b730b2b181c8 | [
"MIT"
] | null | null | null | hio-yocto-bsp/sources/poky/bitbake/lib/bb/utils.py | qiangzai00001/hio-prj | 060ff97fe21093b1369db78109d5b730b2b181c8 | [
"MIT"
] | null | null | null | hio-yocto-bsp/sources/poky/bitbake/lib/bb/utils.py | qiangzai00001/hio-prj | 060ff97fe21093b1369db78109d5b730b2b181c8 | [
"MIT"
] | null | null | null | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake Utility Functions
"""
# Copyright (C) 2004 Michael Lauer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the F... | 30.536974 | 181 | 0.558006 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake Utility Functions
"""
# Copyright (C) 2004 Michael Lauer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the F... | 0 | 265 | 0 | 0 | 0 | 6,501 | 0 | 30 | 526 |
c5651ec77827e83298c54cb4e4debd5496125923 | 12,198 | py | Python | processing/process_i3.py | jrbourbeau/cr-composition | e9efb4b713492aaf544b5dd8bb67280d4f108056 | [
"MIT"
] | null | null | null | processing/process_i3.py | jrbourbeau/cr-composition | e9efb4b713492aaf544b5dd8bb67280d4f108056 | [
"MIT"
] | 7 | 2017-08-29T16:20:04.000Z | 2018-06-12T16:58:36.000Z | processing/process_i3.py | jrbourbeau/cr-composition | e9efb4b713492aaf544b5dd8bb67280d4f108056 | [
"MIT"
] | 1 | 2018-04-03T20:56:40.000Z | 2018-04-03T20:56:40.000Z | #!/usr/bin/env python
import time
import argparse
import math
from icecube import (tableio, astro, dataclasses, icetray, stochastics, millipede, ddddr)
from icecube.frame_object_diff.segments import uncompress
from icecube.tableio import I3TableWriter
from icecube.hdfwriter import I3HDFTableService
from icecube imp... | 38.847134 | 177 | 0.573537 | #!/usr/bin/env python
import time
import argparse
import os
import socket
import math
import numpy as np
from icecube import (dataio, tableio, astro, toprec, dataclasses, icetray,
phys_services, stochastics, millipede, ddddr)
from icecube.frame_object_diff.segments import uncompress
from I3Tray i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 155 | 110 |
e0a8289301e4db8851bea0a9a53eea67e7e71287 | 1,855 | py | Python | tools/datasource-scaffold/sample/driver.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 89 | 2015-09-30T21:42:17.000Z | 2022-03-28T16:31:19.000Z | tools/datasource-scaffold/sample/driver.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 4 | 2015-12-13T13:06:53.000Z | 2016-01-03T19:51:28.000Z | tools/datasource-scaffold/sample/driver.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 43 | 2015-11-04T15:54:27.000Z | 2021-12-10T14:24:03.000Z | # Copyright 2018 - Vitrage team
#
# 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 writi... | 31.440678 | 75 | 0.665768 | # Copyright 2018 - Vitrage team
#
# 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 writi... | 0 | 37 | 0 | 1,045 | 0 | 0 | 0 | 68 | 68 |
f7ee1f24b14f79bec3c0f87115d4358f7cab5e57 | 487 | py | Python | regression.py | iklasky/timemachines | 1820fa9453d31d4daaeff75274a935c7455febe3 | [
"MIT"
] | 253 | 2021-01-08T17:33:30.000Z | 2022-03-21T17:32:36.000Z | regression.py | iklasky/timemachines | 1820fa9453d31d4daaeff75274a935c7455febe3 | [
"MIT"
] | 65 | 2021-01-20T16:43:35.000Z | 2022-03-30T19:07:22.000Z | regression.py | iklasky/timemachines | 1820fa9453d31d4daaeff75274a935c7455febe3 | [
"MIT"
] | 28 | 2021-02-04T14:58:30.000Z | 2022-01-17T04:35:17.000Z | from timemachines.skatertools.testing.allregressiontests import REGRESSION_TESTS
import time
import random
TIMEOUT = 60*5
# Regression tests run occasionally to check various parts of hyper-param spaces, etc.
if __name__=='__main__':
start_time = time.time()
elapsed = time.time()-start_time
while elapsed ... | 30.4375 | 86 | 0.718686 | from timemachines.skatertools.testing.allregressiontests import REGRESSION_TESTS
import time
import random
TIMEOUT = 60*5
# Regression tests run occasionally to check various parts of hyper-param spaces, etc.
if __name__=='__main__':
start_time = time.time()
elapsed = time.time()-start_time
while elapsed ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
84889cac9a9464c3bad718622ffe3da6e2bd9c35 | 1,644 | py | Python | bootstrap/hack/send_ks_request.py | NunoEdgarGFlowHub/kubeflow | a31dbbf823a0e67299e32596f93556743f851748 | [
"Apache-2.0"
] | 3 | 2018-07-12T08:21:26.000Z | 2019-03-19T07:12:58.000Z | bootstrap/hack/send_ks_request.py | NunoEdgarGFlowHub/kubeflow | a31dbbf823a0e67299e32596f93556743f851748 | [
"Apache-2.0"
] | 12 | 2020-09-26T01:21:07.000Z | 2022-02-26T03:19:38.000Z | bootstrap/hack/send_ks_request.py | NunoEdgarGFlowHub/kubeflow | a31dbbf823a0e67299e32596f93556743f851748 | [
"Apache-2.0"
] | 1 | 2022-02-11T03:20:23.000Z | 2022-02-11T03:20:23.000Z | #!/usr/bin/python
"""A script for manual testing and experimenting with the ks server.
TODO(jlewi): Should we use this as the basis for doing
E2E integration testing? We can run the server in a subprocess.
Send requests to it and then run various checks on the results.
"""
import logging
if __name__ == "__main__":
... | 26.516129 | 73 | 0.596107 | #!/usr/bin/python
"""A script for manual testing and experimenting with the ks server.
TODO(jlewi): Should we use this as the basis for doing
E2E integration testing? We can run the server in a subprocess.
Send requests to it and then run various checks on the results.
"""
import argparse
import datetime
import loggi... | 0 | 0 | 0 | 0 | 0 | 954 | 0 | -18 | 89 |
19591d9b51ef2bf50ec02199353bedf627aa8ee6 | 5,009 | py | Python | dataset.py | Mikubill/GAN-ConvLSTM | 943525f62a3ab462a625c72534b3188cd583d839 | [
"MIT"
] | 16 | 2020-07-12T07:21:40.000Z | 2022-02-18T03:32:15.000Z | dataset.py | Mikubill/GAN-ConvLSTM | 943525f62a3ab462a625c72534b3188cd583d839 | [
"MIT"
] | null | null | null | dataset.py | Mikubill/GAN-ConvLSTM | 943525f62a3ab462a625c72534b3188cd583d839 | [
"MIT"
] | 11 | 2020-08-05T08:42:38.000Z | 2022-03-21T02:16:37.000Z | import torch.utils.data as data
| 37.94697 | 119 | 0.577161 | import glob
import numpy as np
import time
import zarr
import torch
import torch.utils.data as data
class RadarDataset(data.Dataset):
def __init__(self, train=True, threshold=None, n_frames_input=10, n_frames_output=10):
"""
param num_objects: a list of number of possible objects.
"""
... | 0 | 0 | 0 | 4,861 | 0 | 0 | 0 | -42 | 156 |
718b0b9db199ec23f0b4a0698e32a31c6e0cfa05 | 3,031 | py | Python | losses/CRFLoss.py | woailaosang/NeuronBlocks | a0f87ff312cce2c0af84ecf24f5c764119846537 | [
"MIT"
] | 1,257 | 2019-05-06T21:25:16.000Z | 2022-03-19T11:06:49.000Z | losses/CRFLoss.py | heavenAsk/NeuronBlocks | 9b08bb8ac7ceca874c8f2541d610bc8d3278fb22 | [
"MIT"
] | 37 | 2019-05-07T00:16:13.000Z | 2021-12-31T11:55:44.000Z | losses/CRFLoss.py | heavenAsk/NeuronBlocks | 9b08bb8ac7ceca874c8f2541d610bc8d3278fb22 | [
"MIT"
] | 186 | 2019-05-07T00:36:40.000Z | 2022-02-28T20:47:19.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import torch.nn as nn
import torch.autograd as autograd
| 42.690141 | 152 | 0.628835 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import torch
import torch.nn as nn
import torch.autograd as autograd
class CRFLoss(nn.Module):
"""CRFLoss
use for crf output layer for sequence tagging task.
"""
def __init__(self):
super(CRFLoss,... | 0 | 0 | 0 | 2,844 | 0 | 0 | 0 | -9 | 46 |
86c4550eebbbafd8546a59d0d4e37ec2c2cb639e | 2,442 | py | Python | bin/sha1sum.py | yjqiang/stash | 83dd0367b2a260f69afbe59738ae9ae523f8f1d1 | [
"MIT"
] | 1 | 2019-04-16T14:01:03.000Z | 2019-04-16T14:01:03.000Z | bin/sha1sum.py | yjqiang/stash | 83dd0367b2a260f69afbe59738ae9ae523f8f1d1 | [
"MIT"
] | null | null | null | bin/sha1sum.py | yjqiang/stash | 83dd0367b2a260f69afbe59738ae9ae523f8f1d1 | [
"MIT"
] | null | null | null | '''
Get sha1 hash of a file or string.
usage: sha1sum.py [-h] [-c] [file [file ...]]
positional arguments:
file String or file to hash.
optional arguments:
-h, --help show this help message and exit
-c, --check Check a file with sha1 hashes and file names for a match.
format:
... | 24.918367 | 107 | 0.546274 | '''
Get sha1 hash of a file or string.
usage: sha1sum.py [-h] [-c] [file [file ...]]
positional arguments:
file String or file to hash.
optional arguments:
-h, --help show this help message and exit
-c, --check Check a file with sha1 hashes and file names for a match.
format:
... | 0 | 0 | 0 | 0 | 0 | 830 | 0 | -17 | 137 |
61fb73cf6d88aa52e0624ce208b48d5549f7053c | 297 | py | Python | rses/src/rses_config.py | iScrE4m/RSES | 88299f105ded8838243eab8b25ab1626c97d1179 | [
"MIT"
] | 1 | 2022-02-16T15:06:22.000Z | 2022-02-16T15:06:22.000Z | rses/src/rses_config.py | djetelina/RSES | 88299f105ded8838243eab8b25ab1626c97d1179 | [
"MIT"
] | null | null | null | rses/src/rses_config.py | djetelina/RSES | 88299f105ded8838243eab8b25ab1626c97d1179 | [
"MIT"
] | null | null | null | # coding=utf-8
"""Configuration"""
import os
SECRET_KEY: str = os.environ.get('SECRET_KEY', 'SUPER_SECRET')
PORT: int = int(os.environ.get('PORT', 5000))
DATABASE_URL: str = os.environ.get('RSES_DB_URL') or os.environ.get('DATABASE_URL')
# Do you want a flask client
RSES_WEB_CLIENT: bool = True
| 29.7 | 83 | 0.727273 | # coding=utf-8
"""Configuration"""
import os
SECRET_KEY: str = os.environ.get('SECRET_KEY', 'SUPER_SECRET')
PORT: int = int(os.environ.get('PORT', 5000))
DATABASE_URL: str = os.environ.get('RSES_DB_URL') or os.environ.get('DATABASE_URL')
# Do you want a flask client
RSES_WEB_CLIENT: bool = True
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
34b4b3db094d6213c2a373133001a45d15786d56 | 965 | py | Python | linear_regression/linear_sample.py | kwoshvick/NSE-Stock-Price-Prediction | 87e16f72db149dc44220f626b009f5ad0df93839 | [
"MIT"
] | 4 | 2018-04-14T13:04:13.000Z | 2021-07-31T10:28:45.000Z | linear_regression/linear_sample.py | kwoshvick/NSE-Stock-Price-Prediction | 87e16f72db149dc44220f626b009f5ad0df93839 | [
"MIT"
] | null | null | null | linear_regression/linear_sample.py | kwoshvick/NSE-Stock-Price-Prediction | 87e16f72db149dc44220f626b009f5ad0df93839 | [
"MIT"
] | 2 | 2019-11-06T16:28:52.000Z | 2021-02-27T15:02:25.000Z | import quandl
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn import preprocessing, cross_validation
df = quandl.get("WIKI/AMZN")
df = df[['Adj. Close']]
# print(df)
#
# exit()
forecast_out = int(30) # predicting 30 days into future
df['Prediction'] = df[['Adj. Close']].shift(-... | 21.444444 | 104 | 0.734715 | import quandl
import pandas as pd
import numpy as np
import datetime
from sklearn.linear_model import LinearRegression
from sklearn import preprocessing, cross_validation
df = quandl.get("WIKI/AMZN")
df = df[['Adj. Close']]
# print(df)
#
# exit()
forecast_out = int(30) # predicting 30 days into future
df['Predi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 44 |
48370d44d560e01da2f2aaf8cce12b36f338523e | 1,614 | py | Python | surfactant_example/mco/mco.py | force-h2020/force-bdss-plugin-surfactant-example | ba442f2b39919f7d071f4384f8eaba0d99f44b1f | [
"BSD-2-Clause",
"MIT"
] | null | null | null | surfactant_example/mco/mco.py | force-h2020/force-bdss-plugin-surfactant-example | ba442f2b39919f7d071f4384f8eaba0d99f44b1f | [
"BSD-2-Clause",
"MIT"
] | null | null | null | surfactant_example/mco/mco.py | force-h2020/force-bdss-plugin-surfactant-example | ba442f2b39919f7d071f4384f8eaba0d99f44b1f | [
"BSD-2-Clause",
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
def get_labels(parameters):
"""Generates numerical labels for each categorical
MCOParameter"""
label_dict = {}
label = 1
for parameter in parameters:
if hasattr(parameter, "categories"):
for name in parameter.categories:
... | 26.9 | 75 | 0.644981 | import logging
from itertools import product
from force_bdss.api import BaseMCO, DataValue
log = logging.getLogger(__name__)
class MCO(BaseMCO):
def run(self, evaluator):
parameters = evaluator.mco_model.parameters
log.info("Doing MCO run")
for input_parameters in parameter_grid_gene... | 0 | 0 | 0 | 755 | 276 | 0 | 0 | 32 | 91 |
d5c2a2ea0392abd06d1c10b0bc3c56f563ffe4fa | 18,142 | py | Python | kadi/events/orbit_funcs.py | jzuhone/kadi | de4885327d256e156cfe42b2b1700775f5b4d6cf | [
"BSD-3-Clause"
] | 1 | 2015-07-30T18:33:14.000Z | 2015-07-30T18:33:14.000Z | kadi/events/orbit_funcs.py | jzuhone/kadi | de4885327d256e156cfe42b2b1700775f5b4d6cf | [
"BSD-3-Clause"
] | 104 | 2015-01-20T18:44:36.000Z | 2022-03-29T18:51:55.000Z | kadi/events/orbit_funcs.py | jzuhone/kadi | de4885327d256e156cfe42b2b1700775f5b4d6cf | [
"BSD-3-Clause"
] | 2 | 2018-08-23T02:36:08.000Z | 2020-03-13T19:24:36.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division
import re
import os
import logging
from pathlib import Path
import numpy as np
from Chandra.Time import DateTime
ORBIT_POINTS_DTYPE = [('date', 'U21'), ('name', 'U8'),
('orbit_num', 'i4'), ('descr... | 37.483471 | 92 | 0.582461 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import division
import re
import os
import logging
from pathlib import Path
import numpy as np
from Chandra.Time import DateTime
class NotFoundError(Exception):
pass
ORBIT_POINTS_DTYPE = [('date', 'U21'), ('name', 'U8'),
... | 0 | 0 | 0 | 19 | 0 | 710 | 0 | 0 | 103 |
5cd9f650b1f362a40ccd5a144d5d9a5ffbad63c2 | 496 | py | Python | proxy_info.py | leonardlinde/timeandtemp | 93e9ad16b2027fd9c261052c22a5977b86326550 | [
"Artistic-2.0"
] | null | null | null | proxy_info.py | leonardlinde/timeandtemp | 93e9ad16b2027fd9c261052c22a5977b86326550 | [
"Artistic-2.0"
] | null | null | null | proxy_info.py | leonardlinde/timeandtemp | 93e9ad16b2027fd9c261052c22a5977b86326550 | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python
"""
ZMQ proxy for info queues.
Publish Queue: tcp:5550
"""
# these are the ports we are doing proxy for
proxies = ['5551']
if __name__ == '__main__':
main_proxy_info()
| 19.076923 | 44 | 0.645161 | #!/usr/bin/env python
"""
ZMQ proxy for info queues.
Publish Queue: tcp:5550
"""
import zmq
# these are the ports we are doing proxy for
proxies = ['5551']
def main_proxy_info():
ctx = zmq.Context()
frontend = ctx.socket(zmq.XSUB)
for proxy in proxies:
queue = "tcp://localhost:" + proxy
... | 0 | 0 | 0 | 0 | 0 | 262 | 0 | -11 | 45 |
cbd374562181bcc96852448acfde95f41dd9a8a0 | 665 | py | Python | pipupgradeall.py | cxu-fork/pipupgradeall | fcca62aa0c334d9f9eca8323c7d17f228d937ee7 | [
"MIT"
] | null | null | null | pipupgradeall.py | cxu-fork/pipupgradeall | fcca62aa0c334d9f9eca8323c7d17f228d937ee7 | [
"MIT"
] | null | null | null | pipupgradeall.py | cxu-fork/pipupgradeall | fcca62aa0c334d9f9eca8323c7d17f228d937ee7 | [
"MIT"
] | null | null | null | import subprocess
def get_all_pythons():
'''https://stackoverflow.com/a/52123490'''
output, err = subprocess.Popen(
['which', '-a', 'python', 'python3','python2'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
).communicate()
return output.decode('utf8').split('\n')[:-1]
| 28.913043 | 70 | 0.601504 | import pkg_resources, subprocess
import os
def get_all_pythons():
'''https://stackoverflow.com/a/52123490'''
output, err = subprocess.Popen(
['which', '-a', 'python', 'python3','python2'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
).communicate()
return output.decode('utf8').s... | 0 | 0 | 0 | 0 | 0 | 306 | 0 | 3 | 45 |
f9dd03bbc7a06c0128823c1731550097c86554b1 | 3,934 | py | Python | data_augment.py | steven7woo/fair_regression_reduction | 7650cb6cc82a499555a42b9d12b7dde598a0dbeb | [
"MIT"
] | 9 | 2020-06-23T08:02:07.000Z | 2022-03-31T13:02:04.000Z | data_augment.py | steven7woo/fair_regression_reduction | 7650cb6cc82a499555a42b9d12b7dde598a0dbeb | [
"MIT"
] | null | null | null | data_augment.py | steven7woo/fair_regression_reduction | 7650cb6cc82a499555a42b9d12b7dde598a0dbeb | [
"MIT"
] | 4 | 2020-06-23T08:02:15.000Z | 2021-01-29T07:33:16.000Z | """
Augment the dataset according to the loss functions.
Input:
- a regression data set (x, a, y), which may be obtained using the data_parser
- loss function
- Theta, a set of thresholds in between 0 and 1
Output:
a weighted classification dataset (X, A, Y, W)
"""
import numpy as np
import pandas as pd
from itertool... | 34.508772 | 164 | 0.649212 | """
Augment the dataset according to the loss functions.
Input:
- a regression data set (x, a, y), which may be obtained using the data_parser
- loss function
- Theta, a set of thresholds in between 0 and 1
Output:
a weighted classification dataset (X, A, Y, W)
"""
import functools
import numpy as np
import pandas a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 67 |
8cda1db85b5e021df45ef0efebcd0d5ea4ba37db | 253 | py | Python | unileaks/task.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | unileaks/task.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | unileaks/task.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null |
assert unique('aa') == False
assert unique('abadkjsld') == False
assert unique('aa') == False
assert unique('fsl') == True | 25.3 | 38 | 0.632411 | def unique(st):
if not st: return False
for i, e in enumerate(st):
if e in st[i+1:]: return False
return True
assert unique('aa') == False
assert unique('abadkjsld') == False
assert unique('aa') == False
assert unique('fsl') == True | 0 | 0 | 0 | 0 | 0 | 108 | 0 | 0 | 22 |
35e018437aeddfe7aeac17401bf8b28c29cda12f | 10,304 | py | Python | asciidoxy/model.py | RerrerBuub/asciidoxy | 3402f37d59e30975e9919653465839e396f05513 | [
"Apache-2.0"
] | null | null | null | asciidoxy/model.py | RerrerBuub/asciidoxy | 3402f37d59e30975e9919653465839e396f05513 | [
"Apache-2.0"
] | null | null | null | asciidoxy/model.py | RerrerBuub/asciidoxy | 3402f37d59e30975e9919653465839e396f05513 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019-2021, TomTom (http://tomtom.com).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.047619 | 100 | 0.604911 | # Copyright (C) 2019-2021, TomTom (http://tomtom.com).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 0 | 0 | 9,300 | 0 | 90 | 0 | 16 | 252 |
327e26f3a8e2db00df03eb9d007c2805c3966eea | 6,616 | py | Python | webapp/new_jp_webhook.py | motionbug/JAWA | 5b525b02cf3eb123c0e9d0e54286c3c92135b1c5 | [
"MIT"
] | 1 | 2019-11-20T15:22:02.000Z | 2019-11-20T15:22:02.000Z | webapp/new_jp_webhook.py | motionbug/JAWA | 5b525b02cf3eb123c0e9d0e54286c3c92135b1c5 | [
"MIT"
] | null | null | null | webapp/new_jp_webhook.py | motionbug/JAWA | 5b525b02cf3eb123c0e9d0e54286c3c92135b1c5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# encoding: utf-8
from flask import (Blueprint)
new_jp = Blueprint('webhooks', __name__)
| 31.061033 | 105 | 0.659915 | #!/usr/bin/python
# encoding: utf-8
import os
import json
from time import sleep
import signal
import requests
import re
from werkzeug import secure_filename
from flask import (Flask, request, render_template,
session, redirect, url_for, escape,
send_from_directory, Blueprint, abort)
new_jp = Blueprint('webhooks',... | 0 | 6,262 | 0 | 0 | 0 | 0 | 0 | 69 | 177 |
cc7ed11991087ba45f1beeb9889cef1936cabc0b | 7,743 | py | Python | zerovl/core/initial.py | zerovl/ZeroVL | b48794e74fed0f80adf5fa3010481064411c4182 | [
"MIT"
] | 14 | 2022-01-19T08:08:29.000Z | 2022-03-10T05:55:36.000Z | zerovl/core/initial.py | zerovl/ZeroVL | b48794e74fed0f80adf5fa3010481064411c4182 | [
"MIT"
] | 2 | 2022-02-25T14:35:47.000Z | 2022-03-01T03:11:13.000Z | zerovl/core/initial.py | zerovl/ZeroVL | b48794e74fed0f80adf5fa3010481064411c4182 | [
"MIT"
] | 3 | 2022-02-09T01:23:11.000Z | 2022-02-15T11:45:30.000Z | import os
import torch
import torch.distributed as distributed
from zerovl.utils import ENV
from zerovl.utils import (logger)
try:
except ImportError:
logger.warning(f'=> ImportError: can not import apex, '
f'distribute training with apex will raise error')
__all__ = ['init_device', 'init_resu... | 41.18617 | 116 | 0.665375 | import os
import random
import numpy as np
import torch
import torch.distributed as distributed
from torch.nn import SyncBatchNorm
from zerovl.models import PIPELINE
from zerovl.utils import ENV, build_from_cfg
from zerovl.utils import (
is_list_of,
logger
)
try:
from apex.parallel import convert_syncbn_... | 0 | 0 | 0 | 0 | 0 | 6,844 | 0 | 78 | 207 |
c57bd23194af74cd729e526403ce1a9ad5f1615c | 3,587 | py | Python | data_facility_admin/test_serializers.py | NYU-CI/dfadmin | 071f38c62aea8ef8bf4ae82dbd672694e719b9bf | [
"CC0-1.0"
] | 1 | 2021-04-08T05:22:35.000Z | 2021-04-08T05:22:35.000Z | data_facility_admin/test_serializers.py | NYU-CI/dfadmin | 071f38c62aea8ef8bf4ae82dbd672694e719b9bf | [
"CC0-1.0"
] | 8 | 2019-08-05T18:16:07.000Z | 2019-10-29T18:42:53.000Z | data_facility_admin/test_serializers.py | NYU-CI/dfadmin | 071f38c62aea8ef8bf4ae82dbd672694e719b9bf | [
"CC0-1.0"
] | 2 | 2019-09-11T15:24:32.000Z | 2020-01-08T20:34:05.000Z | ''' tests for the serializers '''
# from django.test import TestCase
from unittest import main
LDAP_USER_EXAMPLE = ('uid=chiahsuanyang,ou=People,dc=adrf,dc=info',
{
'gidNumber': ['502'],
'givenName': ['Chia-Hsuan'],
'homeDi... | 42.2 | 116 | 0.529969 | ''' tests for the serializers '''
# from django.test import TestCase
from unittest import TestCase, main
from .serializers import _get_attr_value, UserLDAPSerializer
from .models import User
from django.conf import settings
LDAP_USER_EXAMPLE = ('uid=chiahsuanyang,ou=People,dc=adrf,dc=info',
{
... | 0 | 0 | 0 | 1,598 | 0 | 0 | 0 | 63 | 89 |
52448c51322f77371ccc497045df46eda63d3b7d | 595 | py | Python | listBoxGui.py | sairam1318/GUI | bd1892a2162993129008fccae0bfccfc11a90f2d | [
"Unlicense"
] | null | null | null | listBoxGui.py | sairam1318/GUI | bd1892a2162993129008fccae0bfccfc11a90f2d | [
"Unlicense"
] | null | null | null | listBoxGui.py | sairam1318/GUI | bd1892a2162993129008fccae0bfccfc11a90f2d | [
"Unlicense"
] | null | null | null | root = Tk()
root.title("Place Order")
root.geometry("400x400")
scrollbar = Scrollbar(root)
scrollbar.pack(side= RIGHT, fill = Y)
lbx = Listbox(root, yscrollcommand = scrollbar.set)
# lbx.insert(1, "firstItem")
# lbx.insert(2, "secondItem")
# lbx.insert(3, "thirdItem")
# lbx.insert(4, "fourthItem")
# lbx.insert(ACTIV... | 24.791667 | 63 | 0.705882 | from tkinter import *
import tkinter.messagebox as tmsg
root = Tk()
root.title("Place Order")
root.geometry("400x400")
scrollbar = Scrollbar(root)
scrollbar.pack(side= RIGHT, fill = Y)
lbx = Listbox(root, yscrollcommand = scrollbar.set)
# lbx.insert(1, "firstItem")
# lbx.insert(2, "secondItem")
# lbx.insert(3, "thir... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 44 |
b186f2bb37c1c02a3541b691a40fae430a1eb611 | 733 | py | Python | src/examples_in_my_book/general_problems/dicts/delete_duplicate_char_str.py | lucidrohit/Over-100-Exercises-Python-and-Algorithms | 62345c7d7c9cc2269f240d134189645fc96c3e80 | [
"MIT"
] | 2 | 2022-01-07T11:46:32.000Z | 2022-02-24T08:44:31.000Z | src/examples_in_my_book/general_problems/dicts/delete_duplicate_char_str.py | lucidrohit/Over-100-Exercises-Python-and-Algorithms | 62345c7d7c9cc2269f240d134189645fc96c3e80 | [
"MIT"
] | null | null | null | src/examples_in_my_book/general_problems/dicts/delete_duplicate_char_str.py | lucidrohit/Over-100-Exercises-Python-and-Algorithms | 62345c7d7c9cc2269f240d134189645fc96c3e80 | [
"MIT"
] | 1 | 2021-10-01T15:35:05.000Z | 2021-10-01T15:35:05.000Z | #!/usr/bin/python3
# mari von steinkirch @2013
# steinkirch at gmail
import string
def delete_unique_word(str1):
''' find and delete all the duplicate characters in a string '''
# create ordered dict
table_c = { key : 0 for key in string.ascii_lowercase}
# fill the table with the chars in the ... | 22.212121 | 69 | 0.626194 | #!/usr/bin/python3
# mari von steinkirch @2013
# steinkirch at gmail
import string
def delete_unique_word(str1):
''' find and delete all the duplicate characters in a string '''
# create ordered dict
table_c = { key : 0 for key in string.ascii_lowercase}
# fill the table with the chars in the ... | 0 | 0 | 0 | 0 | 0 | 101 | 0 | 0 | 23 |
727c4486f448ccb721c96d168d510c9534143afd | 3,034 | py | Python | solve.py | jnobre/lxmls-toolkit-2017 | 528da3377723cb9a048d13ac80786408d16df88d | [
"MIT"
] | null | null | null | solve.py | jnobre/lxmls-toolkit-2017 | 528da3377723cb9a048d13ac80786408d16df88d | [
"MIT"
] | null | null | null | solve.py | jnobre/lxmls-toolkit-2017 | 528da3377723cb9a048d13ac80786408d16df88d | [
"MIT"
] | null | null | null | '''
This script solves the exercises of days that have been completed. Jut in case
the students did not made it by their own.
'''
import sys
import urllib2
def download_and_replace(url, target_file):
'''
Downloads file through http with progress report. Version by PabloG
obtained in stack overflow
... | 31.936842 | 82 | 0.584377 | '''
This script solves the exercises of days that have been completed. Jut in case
the students did not made it by their own.
'''
import sys
import urllib2
def download_and_replace(url, target_file):
'''
Downloads file through http with progress report. Version by PabloG
obtained in stack overflow
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2fda3ae9e6226aa99b7882ca2e12b4c4a56e15b4 | 1,928 | py | Python | config.py | SuYehTarn/CS651-Group8-Feedback_Forum | d1163442aea81214c4dfa8de1d353ec719bfa7ab | [
"MIT"
] | null | null | null | config.py | SuYehTarn/CS651-Group8-Feedback_Forum | d1163442aea81214c4dfa8de1d353ec719bfa7ab | [
"MIT"
] | null | null | null | config.py | SuYehTarn/CS651-Group8-Feedback_Forum | d1163442aea81214c4dfa8de1d353ec719bfa7ab | [
"MIT"
] | null | null | null | """Module of app configuration"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}
| 28.352941 | 88 | 0.664938 | """Module of app configuration"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
"""Class of configuration"""
# Form
SECRET_KEY = os.environ.get('SECRET_KEY') or \
b'\x876\xeb_\xc9<?\xb8r\xcak\r[\xa0\xf4\xfe\xdbP\xae\x17\x15S\xa5^'
# Mail
MAIL_SERVER... | 0 | 72 | 0 | 1,510 | 0 | 0 | 0 | 0 | 92 |
1510b6a1d7776841a261956bbaff5f23788763b2 | 1,356 | py | Python | setup.py | zhu327/doge | 60991418a0cfedc5b65d1e20cb5c11ec741bd021 | [
"Apache-2.0"
] | 163 | 2018-03-19T07:58:07.000Z | 2022-03-25T02:25:20.000Z | setup.py | zhu327/doge | 60991418a0cfedc5b65d1e20cb5c11ec741bd021 | [
"Apache-2.0"
] | 5 | 2018-12-03T03:32:09.000Z | 2021-03-31T08:38:06.000Z | setup.py | zhu327/doge | 60991418a0cfedc5b65d1e20cb5c11ec741bd021 | [
"Apache-2.0"
] | 34 | 2018-03-26T05:30:38.000Z | 2022-03-10T15:49:31.000Z | # coding: utf8
from setuptools import find_packages, setup
setup(
name="dogerpc",
version="0.1.4",
description="A RPC Framework",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Timmy",
author_email="zhu327@gmail.com",
url="http://git... | 28.851064 | 73 | 0.631268 | # coding: utf8
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
... | 0 | 0 | 0 | 256 | 0 | 0 | 0 | 23 | 68 |
60f5a16ffdb91d357d35d22f435ec0fc68cde35e | 965 | py | Python | sleap/io/format/text.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 156 | 2020-05-01T18:43:43.000Z | 2022-03-25T10:31:18.000Z | sleap/io/format/text.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 299 | 2020-04-20T16:37:52.000Z | 2022-03-31T23:54:48.000Z | sleap/io/format/text.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 41 | 2020-05-14T15:25:21.000Z | 2022-03-25T12:44:54.000Z | """
Adaptor for reading and writing any generic text file.
This is a good example of a very simple adaptor class.
"""
| 20.978261 | 56 | 0.634197 | """
Adaptor for reading and writing any generic text file.
This is a good example of a very simple adaptor class.
"""
from .adaptor import Adaptor, SleapObjectType
from .filehandle import FileHandle
class TextAdaptor(Adaptor):
@property
def handles(self):
return SleapObjectType.misc
@property
... | 0 | 160 | 0 | 580 | 0 | 0 | 0 | 37 | 68 |
7f7c346e86720cd9bd906e6e836249ca0cd3f0ca | 10,237 | py | Python | data/extractBench.py | tharrry/sphincsplus | 7f01ec4b24ae38ed386098aa4b68d60252778d83 | [
"CC0-1.0"
] | null | null | null | data/extractBench.py | tharrry/sphincsplus | 7f01ec4b24ae38ed386098aa4b68d60252778d83 | [
"CC0-1.0"
] | null | null | null | data/extractBench.py | tharrry/sphincsplus | 7f01ec4b24ae38ed386098aa4b68d60252778d83 | [
"CC0-1.0"
] | null | null | null |
#rearrangeNumber(kg, s, v)
#
#
#(kg, s, v) = extractNumber('ref.txt')
#(kgs_c, kgr_c, ss_c, sr_c, vs_c, vr_c) = rearrangeNumber(kg, s, v)
#kg_matrix = addToMatrix(kg_matrix, kgs_c, kgr_c, 0)
#s_matrix = addToMatrix(s_matrix, ss_c, sr_c, 0)
#v_matrix = addToMatrix(v_matrix, vs_c, vr_c,... | 44.316017 | 117 | 0.489108 | class Results:
def __init__(self, filename):
(self.kg, self.s, self.v) = extractNumber (filename)
self.name = filename.split('.')[0]
def __str__(self):
print("")
print("benchmark results of {}:".format(self.name))
print("")
print("key gen:")
... | 0 | 0 | 0 | 6,341 | 0 | 2,692 | 0 | 0 | 122 |
2cecc5f76b3bc4957e1b411f13df9e0537dd69d1 | 753 | py | Python | macro/tutorial/bundles/03_bundle_parameters.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | 5 | 2019-10-14T01:06:57.000Z | 2021-02-02T16:33:06.000Z | macro/tutorial/bundles/03_bundle_parameters.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | macro/tutorial/bundles/03_bundle_parameters.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from gna.bundle import execute_bundle
from gna.configurator import NestedDict, uncertaindict
from gna.env import env
#
# Bundle configuration
#
cfg = NestedDict(
bundle = dict(
name='parameters',
version='ex01',
),
pars = uncertaindict(
[
( 'par... | 20.916667 | 69 | 0.549801 | #!/usr/bin/env python
import load
from gna.bundle import execute_bundle
from gna.configurator import NestedDict, uncertaindict, uncertain
from gna.env import env
#
# Bundle configuration
#
cfg = NestedDict(
bundle = dict(
name='parameters',
version='ex01',
),
pars = uncertaindict(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 23 |
4729aae3bcd366dd822d5493901808145392f045 | 361 | py | Python | team10_project/message/urls.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | team10_project/message/urls.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | 10 | 2020-06-05T19:42:26.000Z | 2022-03-11T23:38:35.000Z | team10_project/message/urls.py | Davisoye/Unitrade | 99428f3712221b2b641a58f1e064d8a3126885a5 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from message import views
# template tagging for relative url
app_name = 'message'
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^inbox$', views.inbox, name='inbox'),
url(r'^outbox$', views.outbox, name='outbox'),
url(r'^compose$', views.compose, name='compos... | 24.066667 | 53 | 0.68144 | from django.conf.urls import url
from django.contrib import admin
from message import views
# template tagging for relative url
app_name = 'message'
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^inbox$', views.inbox, name='inbox'),
url(r'^outbox$', views.outbox, name='outbox'),
url(r'^compo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 22 |
6faa507e7697542efa1659a32cdaf8a2f46e0ffa | 2,701 | py | Python | mpa/modules/datasets/cls_csv_incr_dataset.py | openvinotoolkit/model_preparation_algorithm | 8d36bf5944837b7a3d22fc2c3a4cb93423619fc2 | [
"Apache-2.0"
] | null | null | null | mpa/modules/datasets/cls_csv_incr_dataset.py | openvinotoolkit/model_preparation_algorithm | 8d36bf5944837b7a3d22fc2c3a4cb93423619fc2 | [
"Apache-2.0"
] | null | null | null | mpa/modules/datasets/cls_csv_incr_dataset.py | openvinotoolkit/model_preparation_algorithm | 8d36bf5944837b7a3d22fc2c3a4cb93423619fc2 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
| 40.313433 | 92 | 0.617549 | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from mmcls.datasets.builder import DATASETS
from .multi_cls_dataset import MultiClsDataset
from .cls_csv_dataset import CSVDatasetCls
from mpa.modules.utils.task_adapt import map_class_names
import numpy as np
@DATASETS.register_module()
... | 0 | 2,363 | 0 | 0 | 0 | 0 | 0 | 100 | 157 |
9d1ac50ab7a8871e2c149a42039149cf44590161 | 132 | py | Python | Python/Unsorted/469a_v2.py | LittleEndu/Codeforces | 82c49b10702c58bc5ce062801d740a2f5f600062 | [
"MIT"
] | null | null | null | Python/Unsorted/469a_v2.py | LittleEndu/Codeforces | 82c49b10702c58bc5ce062801d740a2f5f600062 | [
"MIT"
] | null | null | null | Python/Unsorted/469a_v2.py | LittleEndu/Codeforces | 82c49b10702c58bc5ce062801d740a2f5f600062 | [
"MIT"
] | null | null | null | # Should be smallest now
n=input
print("IO hb,e cmoym ek etyhbeo agrudy!. "[int(n())>len(set(n().split()[1:]+n().split()[1:]))::2]) | 33 | 98 | 0.606061 | # Should be smallest now
n=input
print("IO hb,e cmoym ek etyhbeo agrudy!. "[int(n())>len(set(n().split()[1:]+n().split()[1:]))::2]) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d15c619eb5d8ddd230c9b3eb5f22f4ce204f9ef | 3,862 | py | Python | docs/conf.py | hugmyndakassi/hvmi | fa49a34ba32b327c462224db1cf58d96a076a224 | [
"Apache-2.0"
] | 677 | 2020-07-30T13:59:36.000Z | 2022-03-24T11:02:00.000Z | docs/conf.py | hugmyndakassi/hvmi | fa49a34ba32b327c462224db1cf58d96a076a224 | [
"Apache-2.0"
] | 38 | 2020-08-11T13:59:36.000Z | 2022-02-17T15:03:48.000Z | docs/conf.py | fengjixuchui/hvmi | 72488e8432d26547876a052d24ea44c3e18279a7 | [
"Apache-2.0"
] | 55 | 2020-07-30T14:11:03.000Z | 2022-03-09T05:40:44.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.792793 | 118 | 0.685396 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 0 | 0 | 0 | 0 | 0 | 542 | 0 | -31 | 155 |
10f9d7dfc533d1074e71035424e95b25f68c15f6 | 340 | py | Python | Module_03/mlb.py | JoseGtz/2021_python_selenium | c7b39479c78839ba2e2e2633a0f673a8b02fb4cb | [
"Unlicense"
] | null | null | null | Module_03/mlb.py | JoseGtz/2021_python_selenium | c7b39479c78839ba2e2e2633a0f673a8b02fb4cb | [
"Unlicense"
] | null | null | null | Module_03/mlb.py | JoseGtz/2021_python_selenium | c7b39479c78839ba2e2e2633a0f673a8b02fb4cb | [
"Unlicense"
] | null | null | null | from common.webdriver_factory import get_driver
from selenium.webdriver.support.wait import WebDriverWait
driver = get_driver('chrome')
wait = WebDriverWait(driver, 5)
driver.get('https://www.mlb.com/es/standings')
driver.quit() | 30.909091 | 64 | 0.817647 | from common.webdriver_factory import get_driver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
driver = get_driver('chrome')
wait = WebDriverWait(driver, 5)
driver.get('https://www.mlb.com/es/standin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 65 | 44 |
ebb89cbff519a1c8164f4889b7bcd0d23b450a02 | 409 | py | Python | Logger/migrations/0010_auto_20181009_0131.py | MenheraMikumo/Nextflow-Kanban | 54333f32cf626a021ca097d1a80b81f0d26029ed | [
"MIT"
] | null | null | null | Logger/migrations/0010_auto_20181009_0131.py | MenheraMikumo/Nextflow-Kanban | 54333f32cf626a021ca097d1a80b81f0d26029ed | [
"MIT"
] | null | null | null | Logger/migrations/0010_auto_20181009_0131.py | MenheraMikumo/Nextflow-Kanban | 54333f32cf626a021ca097d1a80b81f0d26029ed | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-10-09 01:31
| 21.526316 | 74 | 0.606357 | # Generated by Django 2.1.1 on 2018-10-09 01:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Logger', '0009_auto_20181009_0128'),
]
operations = [
migrations.AlterField(
model_name='trace',
name='scratch',
... | 0 | 0 | 0 | 295 | 0 | 0 | 0 | 19 | 46 |
78dd0f4f343d910e1055e06008f235f1c97febef | 12 | py | Python | brainstorm/utils/__init__.py | znhv/winsio | 4d4e69961285ea3dcebc5ad6358e2d753d6b4f9d | [
"MIT"
] | null | null | null | brainstorm/utils/__init__.py | znhv/winsio | 4d4e69961285ea3dcebc5ad6358e2d753d6b4f9d | [
"MIT"
] | null | null | null | brainstorm/utils/__init__.py | znhv/winsio | 4d4e69961285ea3dcebc5ad6358e2d753d6b4f9d | [
"MIT"
] | null | null | null | """Pass."""
| 6 | 11 | 0.333333 | """Pass."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fc8a43d5cbe335fdf7db030ba5d558cc7c3fa531 | 567 | py | Python | flypy/compiler/optimizations/tests/test_inlining.py | filmackay/flypy | d64e70959c5c8af9e914dcc3ce1068fb99859c3a | [
"BSD-2-Clause"
] | null | null | null | flypy/compiler/optimizations/tests/test_inlining.py | filmackay/flypy | d64e70959c5c8af9e914dcc3ce1068fb99859c3a | [
"BSD-2-Clause"
] | null | null | null | flypy/compiler/optimizations/tests/test_inlining.py | filmackay/flypy | d64e70959c5c8af9e914dcc3ce1068fb99859c3a | [
"BSD-2-Clause"
] | 1 | 2020-01-01T00:43:24.000Z | 2020-01-01T00:43:24.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
#===------------------------------------------------------------------===
# Tests
#===------------------------------------------------------------------===
if __name__ == '__main__':
unittest.main() | 22.68 | 73 | 0.440917 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
from flypy import jit, ijit
#===------------------------------------------------------------------===
# Tests
#===------------------------------------------------------------------===
class TestInlining(unittest... | 0 | 57 | 0 | 148 | 0 | 0 | 0 | 6 | 46 |
f8557df426480f37626f0aa7ee66e724dc31671e | 4,664 | py | Python | gazoo_device/tests/functional_tests/switchboard_test_suite.py | dedsec-9/gazoo-device | 5ed2867c258da80e53b6aae07ec7a65efe473a28 | [
"Apache-2.0"
] | null | null | null | gazoo_device/tests/functional_tests/switchboard_test_suite.py | dedsec-9/gazoo-device | 5ed2867c258da80e53b6aae07ec7a65efe473a28 | [
"Apache-2.0"
] | null | null | null | gazoo_device/tests/functional_tests/switchboard_test_suite.py | dedsec-9/gazoo-device | 5ed2867c258da80e53b6aae07ec7a65efe473a28 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.015873 | 80 | 0.686106 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 568 | 0 | 3,198 | 0 | 0 | 0 | 19 | 135 |
7eb7815265a0d0cf79d4fdb01038f83ca9367e2a | 168 | py | Python | src-tmp/old_stuff/PyRCC/src/basesplit.py | EulerProject/EulerX | 49e63e6a27be97ab30832180a47d214494388e15 | [
"MIT"
] | 15 | 2016-02-17T20:48:29.000Z | 2021-03-05T20:38:05.000Z | src-tmp/old_stuff/PyRCC/src/basesplit.py | eddy7896/EulerX | 49e63e6a27be97ab30832180a47d214494388e15 | [
"MIT"
] | 16 | 2015-02-05T18:38:48.000Z | 2021-06-14T11:38:36.000Z | src-tmp/old_stuff/PyRCC/src/basesplit.py | eddy7896/EulerX | 49e63e6a27be97ab30832180a47d214494388e15 | [
"MIT"
] | 4 | 2016-01-26T03:24:52.000Z | 2020-01-09T07:57:15.000Z | from helpfuncs import bitdecoding
# initialize and fill list for set based on base relations
bsplit = [(len(bitdecoding(i+1)),bitdecoding(i+1)) for i in xrange(255)]
| 28 | 72 | 0.755952 | from helpfuncs import bitdecoding
# initialize and fill list for set based on base relations
bsplit = [(len(bitdecoding(i+1)),bitdecoding(i+1)) for i in xrange(255)]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
87d6a217d56d8263ab9d4353c7b0143396b66d3f | 31 | py | Python | wrapweb/default_config.py | sarum9in/wrapweb | 0a4aa6e505c587de4f2c4d61719df0c1c016dfa1 | [
"Apache-2.0"
] | null | null | null | wrapweb/default_config.py | sarum9in/wrapweb | 0a4aa6e505c587de4f2c4d61719df0c1c016dfa1 | [
"Apache-2.0"
] | null | null | null | wrapweb/default_config.py | sarum9in/wrapweb | 0a4aa6e505c587de4f2c4d61719df0c1c016dfa1 | [
"Apache-2.0"
] | null | null | null | SECRET_KEY = "changeme please"
| 15.5 | 30 | 0.774194 | SECRET_KEY = "changeme please"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eb8d5aa03cf2b8203a110b9a9f41e9df66b328b6 | 33 | py | Python | lang/py/cookbook/v2/source/cb2_1_15_sol_1.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/cookbook/v2/source/cb2_1_15_sol_1.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/cookbook/v2/source/cb2_1_15_sol_1.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | mystring = mystring.expandtabs()
| 16.5 | 32 | 0.787879 | mystring = mystring.expandtabs()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8518df1171ca8bf2d835fb0e1ccc062c074df5b2 | 973 | py | Python | app/routes.py | TomTom4/Pami | 44bfbabef5735737310b7e1da18faa8ca43ed4af | [
"MIT"
] | null | null | null | app/routes.py | TomTom4/Pami | 44bfbabef5735737310b7e1da18faa8ca43ed4af | [
"MIT"
] | null | null | null | app/routes.py | TomTom4/Pami | 44bfbabef5735737310b7e1da18faa8ca43ed4af | [
"MIT"
] | null | null | null | from app import controller
control = controller.Controller()
| 20.270833 | 74 | 0.644399 | from app import app
from app import controller
from flask import request
control = controller.Controller()
@app.route('/api/login', methods=['POST'])
def login():
data = request.form
print(data)
try:
response = control.connect_imap(data["server_url"], data["email"],
... | 0 | 720 | 0 | 0 | 0 | 0 | 0 | 2 | 182 |
3f7306111a0bfea569e4064702ba956954de5f64 | 2,394 | py | Python | core/migrations/0068_auto_20210514_0739.py | Nephrolog-lt/nephrolog-api | ccd2162aff02b2abfab0f285779e5d8457be1788 | [
"Apache-2.0"
] | 2 | 2020-12-17T13:50:42.000Z | 2021-01-09T07:01:07.000Z | core/migrations/0068_auto_20210514_0739.py | Nephrolog-lt/nephrolog-api | ccd2162aff02b2abfab0f285779e5d8457be1788 | [
"Apache-2.0"
] | 2 | 2021-08-25T05:02:56.000Z | 2022-01-16T18:29:49.000Z | core/migrations/0068_auto_20210514_0739.py | Nephrolog-lt/nephrolog-api | ccd2162aff02b2abfab0f285779e5d8457be1788 | [
"Apache-2.0"
] | 1 | 2020-11-16T01:40:15.000Z | 2020-11-16T01:40:15.000Z | # Generated by Django 3.2.3 on 2021-05-14 07:39
| 28.5 | 59 | 0.560568 | # Generated by Django 3.2.3 on 2021-05-14 07:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0067_auto_20210408_1304'),
]
operations = [
migrations.RemoveField(
model_name='historicaluserprofile',
name='birthd... | 0 | 0 | 0 | 2,288 | 0 | 0 | 0 | 11 | 46 |
6ed4711a33490ba853dc7e6416ae43acafc56d85 | 3,566 | py | Python | models/blocks.py | ghokun-thesis/domain-networks | 8f64182a5ef404a0e41eb023812de5efefe4233e | [
"MIT"
] | 1 | 2020-12-19T11:56:10.000Z | 2020-12-19T11:56:10.000Z | models/blocks.py | ghokun-thesis/domain-networks | 8f64182a5ef404a0e41eb023812de5efefe4233e | [
"MIT"
] | null | null | null | models/blocks.py | ghokun-thesis/domain-networks | 8f64182a5ef404a0e41eb023812de5efefe4233e | [
"MIT"
] | 1 | 2021-01-11T13:55:32.000Z | 2021-01-11T13:55:32.000Z | """
gathering of blocks/group of layers used in domainnet.
author: David-Alexandre Beaupre
date: 2020-04-27
"""
import torch.nn as nn
| 41.952941 | 119 | 0.643298 | """
gathering of blocks/group of layers used in domainnet.
author: David-Alexandre Beaupre
date: 2020-04-27
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class LinearReLU(nn.Module):
def __init__(self, in_dim: int, out_dim: int, bias: bool = True):
"""
represents the ope... | 0 | 0 | 0 | 3,313 | 0 | 0 | 0 | 1 | 114 |
a3d459b729b8723ee3b4d96a4ae3b36fdc6adc97 | 1,877 | py | Python | misc/command_line.py | ELS-RD/anonymisation | 0b02b4e3069729673e0397a1dbbc50ae9612d90f | [
"Apache-2.0"
] | 81 | 2019-05-02T17:29:27.000Z | 2021-10-14T07:24:28.000Z | misc/command_line.py | ELS-RD/anonymisation | 0b02b4e3069729673e0397a1dbbc50ae9612d90f | [
"Apache-2.0"
] | 13 | 2020-07-13T13:15:45.000Z | 2021-01-17T18:33:58.000Z | misc/command_line.py | ELS-RD/anonymisation | 0b02b4e3069729673e0397a1dbbc50ae9612d90f | [
"Apache-2.0"
] | 18 | 2019-05-21T10:04:47.000Z | 2021-11-24T21:44:07.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... | 44.690476 | 119 | 0.720831 | # 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... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa10b7c8627c7e859b8c0b7e281874ed2e93b26d | 2,139 | py | Python | tests/unit/test_units.py | imneonizer/Imageinary | 5b76466290d2021fa1ccdc5db61217fc06b73735 | [
"Apache-2.0"
] | 25 | 2020-11-02T20:05:07.000Z | 2022-03-21T10:44:57.000Z | tests/unit/test_units.py | imneonizer/Imageinary | 5b76466290d2021fa1ccdc5db61217fc06b73735 | [
"Apache-2.0"
] | 21 | 2020-11-03T22:00:08.000Z | 2022-03-02T21:34:11.000Z | tests/unit/test_units.py | imneonizer/Imageinary | 5b76466290d2021fa1ccdc5db61217fc06b73735 | [
"Apache-2.0"
] | 8 | 2021-05-24T08:19:13.000Z | 2022-03-21T11:09:11.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 37.526316 | 76 | 0.596073 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 66 | 0 | 1,388 | 0 | 0 | 0 | -14 | 89 |
9a129b601df40ff4df214bf709dcf1c690cd8c54 | 13,619 | py | Python | appion/bin/pyace2.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/bin/pyace2.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/bin/pyace2.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/usr/bin/env python
#pythonlib
#appion
# other myami
if __name__ == '__main__':
imgLoop = Ace2Loop()
imgLoop.run()
| 37.414835 | 113 | 0.677363 | #!/usr/bin/env python
#pythonlib
import os
import re
import sys
import math
import time
import glob
import numpy
import shutil
import subprocess
#appion
from appionlib import apFile
from appionlib import apParam
from appionlib import apImage
from appionlib import apDisplay
from appionlib import apDatabase
from appionl... | 0 | 0 | 0 | 12,987 | 0 | 0 | 0 | 45 | 463 |
e5448dbf5258ef53de49771abaf05b549b971db2 | 750 | py | Python | config.py | Fgeorgiou/Barber_Shop_App_Flask | 06ead766a93f1efe50cb91e76a6463f61b42dca6 | [
"MIT"
] | 1 | 2021-06-28T19:31:25.000Z | 2021-06-28T19:31:25.000Z | config.py | adifarhaaan/Barber_Shop_App_Flask | 06ead766a93f1efe50cb91e76a6463f61b42dca6 | [
"MIT"
] | null | null | null | config.py | adifarhaaan/Barber_Shop_App_Flask | 06ead766a93f1efe50cb91e76a6463f61b42dca6 | [
"MIT"
] | 1 | 2021-06-28T19:31:44.000Z | 2021-06-28T19:31:44.000Z | #Importing os module and defining application's path
import os
basedir = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
SQLALCHEMY_ECHO = True
#Cross-site_request_forgery_(CSRF)_protection_provided_by_WTforms
WTF_CSRF_ENABLED = True
#The secret key that scrf uses for authentication
SECRET_KEY = '... | 30 | 96 | 0.773333 | #Importing os module and defining application's path
import os
basedir = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
SQLALCHEMY_ECHO = True
#Cross-site_request_forgery_(CSRF)_protection_provided_by_WTforms
WTF_CSRF_ENABLED = True
#The secret key that scrf uses for authentication
SECRET_KEY = '... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a082227134f57b79643b770f0f7a6ad604d437e9 | 11,239 | py | Python | eoncloud_web/biz/account/models.py | eoncloud-dev/eoncloud_web | e671ee49cb8822edad3351d0e9feaf80c6bf5467 | [
"Apache-2.0"
] | 10 | 2015-06-17T11:15:53.000Z | 2021-08-19T22:04:25.000Z | eoncloud_web/biz/account/models.py | eoncloud-dev/eoncloud_web | e671ee49cb8822edad3351d0e9feaf80c6bf5467 | [
"Apache-2.0"
] | 25 | 2015-06-24T03:31:18.000Z | 2015-09-28T02:11:51.000Z | eoncloud_web/biz/account/models.py | eoncloud-dev/eoncloud_web | e671ee49cb8822edad3351d0e9feaf80c6bf5467 | [
"Apache-2.0"
] | 7 | 2015-06-17T10:44:33.000Z | 2018-03-01T15:30:29.000Z | #coding=utf-8
import logging
from django.contrib.auth.models import User
from biz.account.settings import NotificationLevel
LOG = logging.getLogger(__name__)
User.profile = property(lambda u: UserProfile.objects.get_or_create(user=u)[0])
NOTIFICATION_KEY_METHODS = ((NotificationLevel.INFO, 'info'),
... | 33.449405 | 91 | 0.641783 | #coding=utf-8
import logging
import hashlib
import urlparse
import random
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.conf import settings
from django.contrib.auth.models import User, Permission
from django.db import models
from django.utils.translation import ugettext_l... | 0 | 3,187 | 0 | 5,941 | 0 | 480 | 0 | 164 | 550 |
df682920b4e1ed6ff2b5f463d97577f5f5a05326 | 2,477 | py | Python | api/tests/test_restapi.py | ercchy/coding-events | 38db125b351f190e3ff13be7b27d2a4e777cec40 | [
"MIT"
] | null | null | null | api/tests/test_restapi.py | ercchy/coding-events | 38db125b351f190e3ff13be7b27d2a4e777cec40 | [
"MIT"
] | null | null | null | api/tests/test_restapi.py | ercchy/coding-events | 38db125b351f190e3ff13be7b27d2a4e777cec40 | [
"MIT"
] | 1 | 2015-09-22T14:56:49.000Z | 2015-09-22T14:56:49.000Z | # -*- coding: utf-8 -*-
| 29.843373 | 79 | 0.677432 | # -*- coding: utf-8 -*-
import json
import datetime
from geoposition import Geoposition
from web.processors.event import create_or_update_event
class TestRestApi:
def test_event_list_all(self, client, admin_user):
event_data = {
"start_date": datetime.datetime.now() - datetime.timedelta(days=1, hours=3),
"... | 2 | 0 | 0 | 2,306 | 0 | 0 | 0 | 32 | 113 |
8ddd7fe2c9dc87626b6ae7272a75702f54eba691 | 14,573 | py | Python | src/scanmode/subscan.py | flyingfrog81/basie | 0956824f8b8467a6d839957f2a6af4082d95816d | [
"BSD-3-Clause"
] | null | null | null | src/scanmode/subscan.py | flyingfrog81/basie | 0956824f8b8467a6d839957f2a6af4082d95816d | [
"BSD-3-Clause"
] | 35 | 2016-02-12T14:49:15.000Z | 2021-06-22T14:37:04.000Z | src/scanmode/subscan.py | flyingfrog81/basie | 0956824f8b8467a6d839957f2a6af4082d95816d | [
"BSD-3-Clause"
] | 2 | 2016-02-22T16:55:36.000Z | 2021-06-04T12:14:21.000Z | #coding=utf-8
#
#
# Copyright (C) 2013 INAF -IRA Italian institute of radioastronomy, bartolini@ira.inaf.it
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 37.462725 | 121 | 0.584437 | #coding=utf-8
#
#
# Copyright (C) 2013 INAF -IRA Italian institute of radioastronomy, bartolini@ira.inaf.it
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 0 | 0 | 0 | 6,450 | 0 | 1,048 | 0 | 67 | 228 |
532629a6d6ac3182afad366e479f768c8294bd88 | 4,998 | py | Python | Machine_Learning/Design_Tutorials/04-Keras_GoogleNet_ResNet/files/code/eval_graph.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | 1 | 2022-03-15T22:07:18.000Z | 2022-03-15T22:07:18.000Z | Machine_Learning/Design_Tutorials/04-Keras_GoogleNet_ResNet/files/code/eval_graph.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | null | null | null | Machine_Learning/Design_Tutorials/04-Keras_GoogleNet_ResNet/files/code/eval_graph.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
## Copyright (C) 2016-2020 Xilinx, Inc
##
## Licensed under the Apache License, Version 2.0 (the "License"). You may
## not use this file except in compliance with the License. A copy of the
## License is located at
##
## http://www.apache.org/licenses/LICENSE-2.0... | 31.632911 | 83 | 0.636255 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
## © Copyright (C) 2016-2020 Xilinx, Inc
##
## Licensed under the Apache License, Version 2.0 (the "License"). You may
## not use this file except in compliance with the License. A copy of the
## License is located at
##
## http://www.apache.org/licenses/LICENSE-2.... | 2 | 0 | 0 | 0 | 0 | 2,630 | 0 | -21 | 209 |
7924c5f1a461d1f211470639400c3de8ae6b4018 | 7,559 | py | Python | libs/plots.py | protivinsky/python-utils | 145fc8e6385df745c7b73fa0dfbb17abf6f58f82 | [
"MIT"
] | 2 | 2020-04-21T12:46:41.000Z | 2021-03-08T00:27:48.000Z | libs/plots.py | protivinsky/python-utils | 145fc8e6385df745c7b73fa0dfbb17abf6f58f82 | [
"MIT"
] | null | null | null | libs/plots.py | protivinsky/python-utils | 145fc8e6385df745c7b73fa0dfbb17abf6f58f82 | [
"MIT"
] | 1 | 2020-04-21T12:46:43.000Z | 2020-04-21T12:46:43.000Z |
# NOTE - Does not work out of the box, needs a fix:
#
# Annoyingly, the js loading of subpages violates Cross-Origin Requests policy in all browsers
# when files are served locally via file:///. Works fine for http protocol though.
# It is possible to use iframes rather than js loader, but it's ugly and has other... | 40.207447 | 120 | 0.511179 | import os
from yattag import Doc, indent
from libs.utils import create_stamped_temp, slugify
import matplotlib.pyplot as plt
# NOTE - Does not work out of the box, needs a fix:
#
# Annoyingly, the js loading of subpages violates Cross-Origin Requests policy in all browsers
# when files are served locally via f... | 0 | 0 | 0 | 5,884 | 0 | 0 | 0 | 37 | 165 |
4eefb2ee01165f85bd55b4a148829a1648d185bd | 400 | py | Python | ifs/source/elasticsearch.py | cbednarski/ifs-python | 9629ba857b1c397fc1a1f13eeee46e5427fb2744 | [
"0BSD"
] | 6 | 2016-03-29T21:12:43.000Z | 2021-05-01T18:34:10.000Z | ifs/source/elasticsearch.py | cbednarski/ifs-python | 9629ba857b1c397fc1a1f13eeee46e5427fb2744 | [
"0BSD"
] | 2 | 2015-08-12T01:34:51.000Z | 2015-08-25T19:23:17.000Z | ifs/source/elasticsearch.py | cbednarski/ifs-python | 9629ba857b1c397fc1a1f13eeee46e5427fb2744 | [
"0BSD"
] | null | null | null | version = '2.3.1'
version_cmd = 'elasticsearch -version'
download_url = 'http://packages.elasticsearch.org/GPG-KEY-elasticsearch'
install_script = """
apt-key add GPG-KEY-elasticsearch
echo "deb http://packages.elasticsearch.org/elasticsearch/VERSION/debian stable main" > /etc/apt/sources.list.d/elasticsearch.list
apt-... | 36.363636 | 130 | 0.785 | version = '2.3.1'
version_cmd = 'elasticsearch -version'
download_url = 'http://packages.elasticsearch.org/GPG-KEY-elasticsearch'
install_script = """
apt-key add GPG-KEY-elasticsearch
echo "deb http://packages.elasticsearch.org/elasticsearch/VERSION/debian stable main" > /etc/apt/sources.list.d/elasticsearch.list
apt-... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ca4012b1629bc9c733cdb8b446f0f5e58ef51b7 | 992 | py | Python | CONVERT ATAT TO POSCAR/convert_ATAT_to_POSCAR.py | vijindal/cluspand | a3676594354ab59991fe75fccecdc3a400c7b153 | [
"MIT"
] | null | null | null | CONVERT ATAT TO POSCAR/convert_ATAT_to_POSCAR.py | vijindal/cluspand | a3676594354ab59991fe75fccecdc3a400c7b153 | [
"MIT"
] | null | null | null | CONVERT ATAT TO POSCAR/convert_ATAT_to_POSCAR.py | vijindal/cluspand | a3676594354ab59991fe75fccecdc3a400c7b153 | [
"MIT"
] | null | null | null | # Converts a 'str.out' file to the VASP POSCAR format.
#
# Assumes:
# + You have installed the "ase" python package.
# + You have the "str2cif" tool from ATAT in your path.
#
# Author: Jesper Kristensen
import os, sys
from ase import io
#=== USER SETTINGS:
structure_from = 'str.out'
structure_to = 'str.POS... | 25.435897 | 73 | 0.68246 | # Converts a 'str.out' file to the VASP POSCAR format.
#
# Assumes:
# + You have installed the "ase" python package.
# + You have the "str2cif" tool from ATAT in your path.
#
# Author: Jesper Kristensen
import os, sys
from ase import io
#=== USER SETTINGS:
structure_from = 'str.out'
structure_to = 'str... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 |
3fcd8a1cb0c2ff5dc3cc391247bdfc8ca998bf5a | 9,600 | py | Python | src/rdf_builder.py | leolani/leolani-datarepresentation | bc2975310fe623f7548db54bf5d691c7bbcf0c1e | [
"MIT"
] | null | null | null | src/rdf_builder.py | leolani/leolani-datarepresentation | bc2975310fe623f7548db54bf5d691c7bbcf0c1e | [
"MIT"
] | null | null | null | src/rdf_builder.py | leolani/leolani-datarepresentation | bc2975310fe623f7548db54bf5d691c7bbcf0c1e | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 34.532374 | 105 | 0.6025 | import logging
from iribaker import to_iri
from rdflib import URIRef, Literal, Namespace
from representation import Predicate, Entity, Triple, Provenance
logger = logging.getLogger(__name__)
class RdfBuilder(object):
def __init__(self):
# type: () -> None
self.namespaces = {}
self._l... | 0 | 0 | 0 | 9,382 | 0 | 0 | 0 | 73 | 91 |
025e076517441e324caae991ffdeb7b0fe63f7cb | 1,944 | py | Python | wifi-password/__main__.py | Abdelrahman0W/wifi-password | 115f8e9168a8c690d2c7ab8d38fd5c82c65e5e56 | [
"MIT"
] | 1 | 2021-07-26T20:00:56.000Z | 2021-07-26T20:00:56.000Z | wifi-password/__main__.py | Abdelrahman0W/wifi-password | 115f8e9168a8c690d2c7ab8d38fd5c82c65e5e56 | [
"MIT"
] | null | null | null | wifi-password/__main__.py | Abdelrahman0W/wifi-password | 115f8e9168a8c690d2c7ab8d38fd5c82c65e5e56 | [
"MIT"
] | 1 | 2021-07-26T20:04:23.000Z | 2021-07-26T20:04:23.000Z |
if __name__ == "__main__":
main()
| 30.375 | 81 | 0.432613 | from .platform import OS
from .windows.win import winPass
from .linUni.linUni import linUniPass
from .manager import Manager
import inquirer
class wifiPass:
def __init__(self) -> None:
self.platform = OS().getOS
select = [
inquirer.List(
'auto',
... | 0 | 0 | 0 | 1,172 | 0 | 543 | 0 | 31 | 156 |
fc1729841205b1f3d5942d6c7c3e59b48f13a0bf | 3,379 | py | Python | src/app/waveglow/training.py | stefantaubert/tacotron2 | 8475f014391c5066cfe0b92b6c74568639be5e79 | [
"BSD-3-Clause"
] | 3 | 2020-08-04T09:38:22.000Z | 2022-03-26T12:38:30.000Z | src/app/waveglow/training.py | stefantaubert/tacotron2 | 8475f014391c5066cfe0b92b6c74568639be5e79 | [
"BSD-3-Clause"
] | null | null | null | src/app/waveglow/training.py | stefantaubert/tacotron2 | 8475f014391c5066cfe0b92b6c74568639be5e79 | [
"BSD-3-Clause"
] | null | null | null |
if __name__ == "__main__":
mode = 0
if mode == 0:
start_new_training(
base_dir="/datasets/models/taco2pt_v5",
train_name="debug",
prep_name="thchs_ljs",
custom_hparams={
"batch_size": 3,
"iters_per_checkpoint": 5,
"cache_wavs": False
},
validation... | 34.479592 | 290 | 0.748742 | import os
from logging import Logger
from typing import Dict, Optional
from src.app.io import (get_checkpoints_dir, get_train_log_file,
get_train_logs_dir, load_trainset, load_valset,
save_prep_name, save_testset, save_trainset,
save_valset)
from ... | 0 | 0 | 0 | 0 | 0 | 2,129 | 0 | 480 | 312 |
6bc894c811b8ef772b2c827b2589b3237eb861bc | 1,139 | py | Python | hardest/template.py | proggga/hardest | 234cb41115c30a756ee11ed7c5fa41c9979d3303 | [
"MIT"
] | 2 | 2018-02-03T13:43:25.000Z | 2021-12-03T16:13:49.000Z | hardest/template.py | proggga/hardest | 234cb41115c30a756ee11ed7c5fa41c9979d3303 | [
"MIT"
] | 8 | 2017-08-16T08:34:59.000Z | 2018-02-05T18:30:44.000Z | hardest/template.py | proggga/hardest | 234cb41115c30a756ee11ed7c5fa41c9979d3303 | [
"MIT"
] | 1 | 2018-02-05T18:26:20.000Z | 2018-02-05T18:26:20.000Z | """Template class."""
# For Mypy typing
| 31.638889 | 71 | 0.632133 | """Template class."""
import os
# For Mypy typing
from typing import Any # noqa pylint: disable=unused-import
from typing import Dict # noqa pylint: disable=unused-import
import jinja2
class Template(object): # pylint: disable=too-few-public-methods
"""Represents tepmplate which can be rendered."""
def... | 0 | 0 | 0 | 925 | 0 | 0 | 0 | -17 | 188 |
7317364a9d5df033377400f6e8fedf41a3d1fdda | 2,727 | py | Python | elecsus/libs/polarisation_animation_mpl.py | fsponciano/ElecSus | c79444edb18154906caddf438c7e33b02865fa66 | [
"Apache-2.0"
] | 22 | 2016-07-11T15:25:18.000Z | 2021-10-04T08:16:33.000Z | elecsus/libs/polarisation_animation_mpl.py | Quantum-Light-and-Matter/ElecSus | c79444edb18154906caddf438c7e33b02865fa66 | [
"Apache-2.0"
] | 8 | 2019-08-12T09:46:21.000Z | 2021-07-29T09:01:10.000Z | elecsus/libs/polarisation_animation_mpl.py | Quantum-Light-and-Matter/ElecSus | c79444edb18154906caddf438c7e33b02865fa66 | [
"Apache-2.0"
] | 20 | 2016-06-09T14:35:14.000Z | 2021-09-30T13:43:46.000Z | """
Polarisation animation...
the animate_vectors() method creates an interactive 3D plot, visualising the resultant polarisation for a
given input of Ex, Ey and the phase difference (in radians) between them
Last updated 2018-02-19 JK
"""
# py 2.7 compatibility
from __future__ import (division, print_function, absol... | 34.961538 | 176 | 0.674367 | """
Polarisation animation...
the animate_vectors() method creates an interactive 3D plot, visualising the resultant polarisation for a
given input of Ex, Ey and the phase difference (in radians) between them
Last updated 2018-02-19 JK
"""
# py 2.7 compatibility
from __future__ import (division, print_function, absol... | 0 | 0 | 0 | 0 | 0 | 1,856 | 0 | 16 | 91 |
f572ec76ebffa74087c45a7676146ac7f45584e8 | 463 | py | Python | users/migrations/0009_auto_20210810_2244.py | Achyut-0705/Django-Blog-App | d9f331e43f805efa4ef65844c055edee57124621 | [
"MIT"
] | null | null | null | users/migrations/0009_auto_20210810_2244.py | Achyut-0705/Django-Blog-App | d9f331e43f805efa4ef65844c055edee57124621 | [
"MIT"
] | 1 | 2021-08-15T16:27:03.000Z | 2021-08-15T16:27:03.000Z | users/migrations/0009_auto_20210810_2244.py | Achyut-0705/Library-Management-System | d9f331e43f805efa4ef65844c055edee57124621 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-08-10 17:14
| 23.15 | 98 | 0.632829 | # Generated by Django 3.1.7 on 2021-08-10 17:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0008_auto_20210810_2103'),
]
operations = [
migrations.AlterField(
model_name='post',
... | 0 | 0 | 0 | 316 | 0 | 0 | 0 | 30 | 68 |
2afad78a490520061c4c7c8837aabf8f97c65be2 | 10,415 | py | Python | framenet_tools/frame_identification/frameidnetwork.py | inception-project/framenet-tools | ff0f8c334dc0c2a0733673c33b54b51d098e9d40 | [
"Apache-2.0"
] | 6 | 2020-07-23T09:04:54.000Z | 2022-03-01T10:25:51.000Z | framenet_tools/frame_identification/frameidnetwork.py | inception-project/framenet-tools | ff0f8c334dc0c2a0733673c33b54b51d098e9d40 | [
"Apache-2.0"
] | 22 | 2019-07-08T08:10:56.000Z | 2021-06-02T00:13:01.000Z | framenet_tools/frame_identification/frameidnetwork.py | inception-project/framenet-tools | ff0f8c334dc0c2a0733673c33b54b51d098e9d40 | [
"Apache-2.0"
] | 3 | 2019-08-27T12:46:05.000Z | 2020-08-16T14:54:05.000Z | import torch.nn as nn
| 30.014409 | 123 | 0.584926 | import logging
import torch
import torch.nn as nn
import torchtext
import os
from torch.autograd import Variable
from tqdm import tqdm
from tensorboardX import SummaryWriter
from typing import List
from framenet_tools.config import ConfigManager
class Net(nn.Module):
def __init__(
self,
embeddin... | 0 | 0 | 0 | 10,119 | 0 | 0 | 0 | 26 | 246 |
36c4c87462bf79cb67dc00f2e8ad299e8de7e43c | 12,354 | py | Python | build/scripts/build_mn.py | SitdikovRustam/CatBoost | 39fb9dfddb24e977ed87efc71063b03cd4bc8f16 | [
"Apache-2.0"
] | 33 | 2016-12-15T21:47:13.000Z | 2020-10-27T23:53:59.000Z | build/scripts/build_mn.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | null | null | null | build/scripts/build_mn.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | 14 | 2016-12-28T17:00:33.000Z | 2022-01-16T20:15:27.000Z | #!/usr/bin/env python
# Ymake MatrixNet support
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
print >>sys.stderr, "Usage: build_mn.py <funcName> <args...>"
sys.exit(1)
if (sys.argv[2:]):
globals()[sys.argv[1]](sys.argv[2:])
else:
globals()[sys.argv[... | 37.323263 | 185 | 0.581755 | #!/usr/bin/env python
# Ymake MatrixNet support
import sys
import os
import shutil
import re
import subprocess
def get_value(val):
dct = val.split('=', 1)
if len(dct) > 1:
return dct[1]
return ''
class BuildMnBase(object):
def Run(self, mninfo, mnname, mnrankingSuffix, mncppPath, check=Fals... | 0 | 0 | 0 | 11,262 | 0 | 507 | 0 | -36 | 295 |
1a013c58525679a82e132d2ef013f1c9bb9e9a4a | 2,084 | py | Python | Teacher/migrations/0001_initial.py | AnonC0DER/C1Academy | 449b35866b703462e4f2dbe20ed34aed9593b3ad | [
"CC0-1.0"
] | 1 | 2022-02-18T19:46:26.000Z | 2022-02-18T19:46:26.000Z | Teacher/migrations/0001_initial.py | AnonC0DER/C1Academy | 449b35866b703462e4f2dbe20ed34aed9593b3ad | [
"CC0-1.0"
] | null | null | null | Teacher/migrations/0001_initial.py | AnonC0DER/C1Academy | 449b35866b703462e4f2dbe20ed34aed9593b3ad | [
"CC0-1.0"
] | null | null | null | # Generated by Django 3.2.9 on 2022-01-20 19:34
import django.core.validators
| 46.311111 | 241 | 0.62524 | # Generated by Django 3.2.9 on 2022-01-20 19:34
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency... | 0 | 0 | 0 | 1,862 | 0 | 0 | 0 | 31 | 112 |
72166ba3c2141d8936efe5c2be7c7c7edf2b3d04 | 496 | py | Python | Between_Two_Sets.py | Quarantinex/Hackerrank_Python_Algorithm | 4a5fc532bfbdac02e66e9d0d9ae279c4e33ca017 | [
"MIT"
] | null | null | null | Between_Two_Sets.py | Quarantinex/Hackerrank_Python_Algorithm | 4a5fc532bfbdac02e66e9d0d9ae279c4e33ca017 | [
"MIT"
] | null | null | null | Between_Two_Sets.py | Quarantinex/Hackerrank_Python_Algorithm | 4a5fc532bfbdac02e66e9d0d9ae279c4e33ca017 | [
"MIT"
] | null | null | null | if __name__=='__main__':
n,m = map(int,input().split())
arr = list(map(int,input().split()))
brr = list(map(int,input().split()))
count = 0
for i in range(max(arr),min(brr)+1):
flag = True
for j in arr:
if i%j!=0:
flag = False
break
... | 26.105263 | 40 | 0.41129 | if __name__=='__main__':
n,m = map(int,input().split())
arr = list(map(int,input().split()))
brr = list(map(int,input().split()))
count = 0
for i in range(max(arr),min(brr)+1):
flag = True
for j in arr:
if i%j!=0:
flag = False
break
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9564701ea09724db42281703c4a714b201629f77 | 1,913 | py | Python | jes/jes-v5.020-linux/jes/python/jes/bridge/terpcontrol.py | utv-teaching/foundations-computer-science | 568e19fd83a3355dab2814229f335abf31bfd7e9 | [
"MIT"
] | null | null | null | jes/jes-v5.020-linux/jes/python/jes/bridge/terpcontrol.py | utv-teaching/foundations-computer-science | 568e19fd83a3355dab2814229f335abf31bfd7e9 | [
"MIT"
] | null | null | null | jes/jes-v5.020-linux/jes/python/jes/bridge/terpcontrol.py | utv-teaching/foundations-computer-science | 568e19fd83a3355dab2814229f335abf31bfd7e9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jes.bridge.terpcontrol
======================
This interacts with the interpreter, to keep the GUI locked down while
the interpreter runs.
(In JES, "terp" is short for "interpreter," not "terrapin.")
:copyright: (C) 2014 Matthew Frazier and Mark Guzdial
:license: GNU GPL v2 or later, see... | 28.552239 | 74 | 0.681129 | # -*- coding: utf-8 -*-
"""
jes.bridge.terpcontrol
======================
This interacts with the interpreter, to keep the GUI locked down while
the interpreter runs.
(In JES, "terp" is short for "interpreter," not "terrapin.")
:copyright: (C) 2014 Matthew Frazier and Mark Guzdial
:license: GNU GPL v2 or later, see... | 0 | 867 | 0 | 488 | 0 | 0 | 0 | 61 | 133 |
424a8d6e18b6abbcf0e57959bb47419d37865b4b | 1,499 | py | Python | icubam/backoffice/handlers/upload.py | rth/icubam | 316a0fba79360189a06e068f4b1d3d17b91f0275 | [
"Apache-2.0"
] | 33 | 2020-03-27T02:01:33.000Z | 2021-09-10T22:32:42.000Z | icubam/backoffice/handlers/upload.py | rth/icubam | 316a0fba79360189a06e068f4b1d3d17b91f0275 | [
"Apache-2.0"
] | 198 | 2020-03-27T08:35:25.000Z | 2020-11-06T15:20:25.000Z | icubam/backoffice/handlers/upload.py | rth/icubam | 316a0fba79360189a06e068f4b1d3d17b91f0275 | [
"Apache-2.0"
] | 18 | 2020-03-26T20:38:50.000Z | 2021-08-30T07:31:26.000Z | """Creating/edition of ICUs."""
| 29.98 | 79 | 0.688459 | """Creating/edition of ICUs."""
from absl import logging
import io
import json
import tornado.web
from icubam.backoffice.handlers import base
from icubam.db import synchronizer
from typing import Dict, Callable
class UploadHandler(base.BaseHandler):
ROUTE = "upload"
def answer(self, msg, error=False) -> None:
... | 0 | 1,075 | 0 | 188 | 0 | 0 | 0 | 25 | 178 |
f4b9a963494be6d889c49dfb0051dd25e357be3b | 237 | py | Python | user_profile/settings.py | alldevic/nav_info | 32681d1cd3ad43472c8f7fb49922094c4045111c | [
"MIT"
] | 1 | 2019-12-25T07:50:09.000Z | 2019-12-25T07:50:09.000Z | user_profile/settings.py | alldevic/nav_info | 32681d1cd3ad43472c8f7fb49922094c4045111c | [
"MIT"
] | 176 | 2019-11-07T07:08:27.000Z | 2022-03-12T00:04:50.000Z | user_profile/settings.py | alldevic/nav_info | 32681d1cd3ad43472c8f7fb49922094c4045111c | [
"MIT"
] | 4 | 2020-07-20T06:48:27.000Z | 2021-06-29T08:04:26.000Z | from django.conf import settings
USERPROFILE_SETTINGS = {
'app_verbose_name': "Custom User",
'register_proxy_auth_group_model': True,
}
if hasattr(settings, 'USERPROFILE'):
USERPROFILE_SETTINGS.update(settings.USERPROFILE)
| 23.7 | 53 | 0.767932 | from django.conf import settings
USERPROFILE_SETTINGS = {
'app_verbose_name': "Custom User",
'register_proxy_auth_group_model': True,
}
if hasattr(settings, 'USERPROFILE'):
USERPROFILE_SETTINGS.update(settings.USERPROFILE)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b816aab00b223f4a9c26b1dfce0ca81c9134ebc1 | 155 | py | Python | src/testcases/gen.py | tsw303005/MapReduce | e29778a439210963a7cd8047e55123e0c810b79b | [
"MIT"
] | null | null | null | src/testcases/gen.py | tsw303005/MapReduce | e29778a439210963a7cd8047e55123e0c810b79b | [
"MIT"
] | null | null | null | src/testcases/gen.py | tsw303005/MapReduce | e29778a439210963a7cd8047e55123e0c810b79b | [
"MIT"
] | null | null | null | import random
with open('09.loc', 'w') as f:
for i in range(1, 1001):
s = str(i) + ' ' + str(random.randint(1, 100)) + '\n'
f.write(s) | 25.833333 | 61 | 0.503226 | import random
with open('09.loc', 'w') as f:
for i in range(1, 1001):
s = str(i) + ' ' + str(random.randint(1, 100)) + '\n'
f.write(s) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b4aacb6f6ea6f57d2a23509d9fd4d4ca35240d73 | 3,422 | py | Python | dla_cnn/data_model/Prediction.py | AhmedElshaarany/qso_lya_detection_pipeline | fc365326750f1636fe9cad5a1a80b3156375b193 | [
"MIT"
] | 8 | 2016-12-19T07:29:25.000Z | 2019-05-31T06:43:21.000Z | dla_cnn/data_model/Prediction.py | AhmedElshaarany/qso_lya_detection_pipeline | fc365326750f1636fe9cad5a1a80b3156375b193 | [
"MIT"
] | 10 | 2016-11-01T22:16:56.000Z | 2020-02-16T14:54:16.000Z | dla_cnn/data_model/Prediction.py | AhmedElshaarany/qso_lya_detection_pipeline | fc365326750f1636fe9cad5a1a80b3156375b193 | [
"MIT"
] | 8 | 2018-06-05T10:40:17.000Z | 2019-01-15T22:38:09.000Z | import scipy.signal as signal
| 46.876712 | 155 | 0.655172 | import scipy.signal as signal
import numpy as np
class Prediction(object):
def __init__(self, peaks_ixs=None, offset_hist=None, offset_conv_sum=None,
loc_pred=None, loc_conf=None, offsets=None, density_data=None):
# Peaks data
self._peaks_ixs = None
self.peaks_ixs... | 0 | 160 | 0 | 3,182 | 0 | 0 | 0 | -3 | 48 |
59d375a815616f74c0678b19727359655056dc12 | 525 | py | Python | boomslang/api/packages/migrations/0002_package_team_owner.py | arnaudblois/liripype | c1b1436310139f7c0765042b89a881f11fa03aa4 | [
"MIT"
] | null | null | null | boomslang/api/packages/migrations/0002_package_team_owner.py | arnaudblois/liripype | c1b1436310139f7c0765042b89a881f11fa03aa4 | [
"MIT"
] | null | null | null | boomslang/api/packages/migrations/0002_package_team_owner.py | arnaudblois/liripype | c1b1436310139f7c0765042b89a881f11fa03aa4 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2018-08-27 07:36
| 22.826087 | 110 | 0.620952 | # Generated by Django 2.1 on 2018-08-27 07:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('packages', '0001_initial'),
('teams', '0001_initial'),
]
operations = [
migration... | 0 | 0 | 0 | 380 | 0 | 0 | 0 | 30 | 68 |
571b3648a6fd441c10879674bfec152e0b319312 | 1,576 | py | Python | common-files/python-libs/helm.py | microfocus-idol/idol-containers-toolkit | 0b9b19ab86736fa8c662de34f382df406fbc4952 | [
"MIT"
] | 1 | 2020-10-22T07:44:21.000Z | 2020-10-22T07:44:21.000Z | common-files/python-libs/helm.py | microfocus-idol/idol-containers-toolkit | 0b9b19ab86736fa8c662de34f382df406fbc4952 | [
"MIT"
] | 1 | 2020-11-11T10:04:23.000Z | 2020-11-11T10:04:23.000Z | common-files/python-libs/helm.py | microfocus-idol/idol-containers-toolkit | 0b9b19ab86736fa8c662de34f382df406fbc4952 | [
"MIT"
] | 1 | 2021-02-01T18:31:18.000Z | 2021-02-01T18:31:18.000Z | ###
# Copyright (c) 2019-2020 Micro Focus or one of its affiliates.
#
# Licensed under the MIT License (the "License"); you may not use this file
# except in compliance with the License.
#
# The only warranties for products and services of Micro Focus and its affiliates
# and licensors ("Micro Focus") are as may be set... | 36.651163 | 81 | 0.741117 | ###
# Copyright (c) 2019-2020 Micro Focus or one of its affiliates.
#
# Licensed under the MIT License (the "License"); you may not use this file
# except in compliance with the License.
#
# The only warranties for products and services of Micro Focus and its affiliates
# and licensors ("Micro Focus") are as may be set... | 0 | 0 | 0 | 0 | 0 | 737 | 0 | -4 | 138 |
c55b3e1851e7d227d7e876a05a40e2d7bdb3def0 | 5,851 | py | Python | riak/tests/test_btypes.py | albeus/riak-python-client | 51bf875f1f5e394d45540a3850a8453db0951c40 | [
"Apache-2.0"
] | null | null | null | riak/tests/test_btypes.py | albeus/riak-python-client | 51bf875f1f5e394d45540a3850a8453db0951c40 | [
"Apache-2.0"
] | null | null | null | riak/tests/test_btypes.py | albeus/riak-python-client | 51bf875f1f5e394d45540a3850a8453db0951c40 | [
"Apache-2.0"
] | null | null | null | import platform
if platform.python_version() < '2.7':
unittest = __import__('unittest2')
else:
| 36.117284 | 79 | 0.63972 | import platform
if platform.python_version() < '2.7':
unittest = __import__('unittest2')
else:
import unittest
from . import SKIP_BTYPES
from riak.bucket import RiakBucket, BucketType
from riak import RiakError, RiakObject
class BucketTypeTests(object):
def test_btype_init(self):
btype = self.cl... | 0 | 4,092 | 0 | 1,502 | 0 | 0 | 0 | 40 | 116 |
097aa9e3afa4b3733fa3df2e955c167e0ad889a7 | 664 | py | Python | replacer.py | keyansheng/krdict-to-anki | 09c8c37b797100855733aaafb4ca4d86eef6d068 | [
"MIT"
] | null | null | null | replacer.py | keyansheng/krdict-to-anki | 09c8c37b797100855733aaafb4ca4d86eef6d068 | [
"MIT"
] | null | null | null | replacer.py | keyansheng/krdict-to-anki | 09c8c37b797100855733aaafb4ca4d86eef6d068 | [
"MIT"
] | null | null | null | import sys
import csv
import scraper
if __name__ == "__main__":
source_filename = sys.argv[1]
destination_filename = sys.argv[2]
word_column = int(sys.argv[3])
definition_column = int(sys.argv[4])
with open(source_filename, "r") as source_file:
with open(destination_filename, "w") as destin... | 36.888889 | 86 | 0.649096 | import sys
import csv
import scraper
if __name__ == "__main__":
source_filename = sys.argv[1]
destination_filename = sys.argv[2]
word_column = int(sys.argv[3])
definition_column = int(sys.argv[4])
with open(source_filename, "r") as source_file:
with open(destination_filename, "w") as destin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f07100cf5d3d44d98a61e18233ef17c73a0b2a5 | 2,263 | py | Python | test/test_torque4.py | DrNeilSmith/cog | 7fc6ee4790ab68f22828dd5550a616ac8a3c3423 | [
"MIT"
] | null | null | null | test/test_torque4.py | DrNeilSmith/cog | 7fc6ee4790ab68f22828dd5550a616ac8a3c3423 | [
"MIT"
] | null | null | null | test/test_torque4.py | DrNeilSmith/cog | 7fc6ee4790ab68f22828dd5550a616ac8a3c3423 | [
"MIT"
] | null | null | null | import unittest
DIR_NAME = "TorqueTest4"
if __name__ == '__main__':
unittest.main()
| 32.797101 | 97 | 0.601414 | from cog.torque import Graph
import unittest
import os
import shutil
DIR_NAME = "TorqueTest4"
def ordered(obj):
if isinstance(obj, dict):
return sorted((k, ordered(v)) for k, v in list(obj.items()))
if isinstance(obj, list):
return sorted(ordered(x) for x in obj)
else:
return obj
... | 0 | 628 | 0 | 1,243 | 0 | 201 | 0 | -13 | 112 |
5ebb66836b712be7e32c6ffc4e61dd48294c572c | 32 | py | Python | Classificatioons/ample.py | Hackit-2-0/Team-CodeCrafters | 3536289412555a7f92de12458517bcb073007015 | [
"MIT"
] | 3 | 2020-06-02T01:36:52.000Z | 2020-11-15T07:59:17.000Z | Classificatioons/ample.py | Hackit-2-0/Team-CodeCrafters | 3536289412555a7f92de12458517bcb073007015 | [
"MIT"
] | null | null | null | Classificatioons/ample.py | Hackit-2-0/Team-CodeCrafters | 3536289412555a7f92de12458517bcb073007015 | [
"MIT"
] | 3 | 2020-04-21T12:10:39.000Z | 2020-10-30T19:35:16.000Z | import sys
print(sys.argv[0])
| 6.4 | 18 | 0.6875 | import sys
print(sys.argv[0])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c2f9870929753ad3a9c8c17472608b32468ad423 | 1,115 | py | Python | books/urls.py | adilmohak/django_book_sharing | 6d47cb131524dc761becb7d432b7cc75064c4f58 | [
"MIT"
] | 13 | 2021-03-26T05:39:58.000Z | 2021-10-13T22:03:46.000Z | books/urls.py | adilmohak/django_book_sharing | 6d47cb131524dc761becb7d432b7cc75064c4f58 | [
"MIT"
] | 1 | 2021-03-26T05:42:47.000Z | 2021-04-24T17:33:26.000Z | books/urls.py | adilmohak/django_book_sharing | 6d47cb131524dc761becb7d432b7cc75064c4f58 | [
"MIT"
] | 2 | 2021-03-26T05:54:59.000Z | 2021-03-26T09:03:46.000Z | from django.conf.urls import url
from django.views import generic
from .views import (BookListView, BookDetailView, BookUpdateView, delete_book, user_booklist, user_booklist_update, BookCreateView, ReviewCreateView, review_update_view)
app_name = 'books'
urlpatterns = [
url(r'^$', BookListView.as_view(), name='bo... | 48.478261 | 127 | 0.697758 | from django.urls import path
from django.conf.urls import url
from django.views import generic
from .views import (
BookListView, BookDetailView, BookUpdateView,
delete_book, user_booklist, user_booklist_update, BookCreateView, ReviewCreateView, review_update_view
)
app_name = 'books'
urlpatterns = [
url... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 22 |
57894e6230ba29f9646ceb6c2dba47efcded853c | 6,152 | py | Python | covsirphy/cleaning/word.py | skelwadkar/COVID-19_project | 61e315e6d1de872f4b6fec27432ae202bbc6f69b | [
"Apache-2.0"
] | null | null | null | covsirphy/cleaning/word.py | skelwadkar/COVID-19_project | 61e315e6d1de872f4b6fec27432ae202bbc6f69b | [
"Apache-2.0"
] | null | null | null | covsirphy/cleaning/word.py | skelwadkar/COVID-19_project | 61e315e6d1de872f4b6fec27432ae202bbc6f69b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 30.606965 | 96 | 0.563882 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import defaultdict
from datetime import datetime
import numpy as np
import pandas as pd
class Word(object):
"""
Word definition.
"""
# Variables of SIR-like model
N = "Population"
S = "Susceptible"
C = "Confirmed"
CI = "In... | 0 | 4,411 | 0 | 1,565 | 0 | 0 | 0 | 17 | 112 |
a590d346a433b2746f8e174030cd02a2220f6fe0 | 10,771 | py | Python | gsj_2020/figure_2_bulks_yeast.py | asistradition/inferelator_run_scripts | 5f122e8f4ff565f8ccf1b3224bc1408839969097 | [
"MIT"
] | 1 | 2020-04-20T14:53:10.000Z | 2020-04-20T14:53:10.000Z | gsj_2020/figure_2_bulks_yeast.py | asistradition/inferelator_run_scripts | 5f122e8f4ff565f8ccf1b3224bc1408839969097 | [
"MIT"
] | null | null | null | gsj_2020/figure_2_bulks_yeast.py | asistradition/inferelator_run_scripts | 5f122e8f4ff565f8ccf1b3224bc1408839969097 | [
"MIT"
] | null | null | null | # Load modules
from inferelator import inferelator_workflow, inferelator_verbose_level, MPControl
from inferelator.benchmarking.scenic import SCENICWorkflow, SCENICRegression
from inferelator.distributed.inferelator_mp import MPControl
# Set verbosity level to "Talky"
inferelator_verbose_level(1)
# Set the location o... | 45.447257 | 116 | 0.644044 | # Load modules
from inferelator import inferelator_workflow, inferelator_verbose_level, MPControl, crossvalidation_workflow
from inferelator.benchmarking.scenic import SCENICWorkflow, SCENICRegression
from inferelator.distributed.inferelator_mp import MPControl
# Set verbosity level to "Talky"
inferelator_verbose_leve... | 0 | 0 | 0 | 0 | 0 | 511 | 0 | 26 | 45 |
4820f58ee724581a19340bf41c1d6b6e2b8c5698 | 709 | py | Python | manage.py | aarjitpaudel/Nepali-news-portal-kbd | ff42b905361fbbacb617510c0a5bd26adf7f7272 | [
"MIT"
] | 5 | 2019-12-01T14:23:36.000Z | 2021-05-10T13:13:16.000Z | manage.py | aarjitpaudel/Nepali-news-portal-kbd | ff42b905361fbbacb617510c0a5bd26adf7f7272 | [
"MIT"
] | 29 | 2019-11-25T23:21:10.000Z | 2021-03-19T23:17:37.000Z | manage.py | hemanta212/Khabar-board | 37d079c9ae3897e0100bab1396be36e7f6508a08 | [
"MIT"
] | 2 | 2019-12-23T01:01:45.000Z | 2021-07-22T04:45:02.000Z | import os
from flask_final.config import Debug, Secrets
from flask_final import db, create_app
is_env_var_set = os.getenv("SQLALCHEMY_DATABASE_URI")
if not is_env_var_set:
config = Secrets()
else:
config = Debug
# Support for relative sqlite URIs
if config.SQLALCHEMY_DATABASE_URI == "sqlite:///site.db":
... | 23.633333 | 65 | 0.74048 | import os
from flask_final.config import Debug, Secrets
from flask_final import db, create_app
is_env_var_set = os.getenv("SQLALCHEMY_DATABASE_URI")
if not is_env_var_set:
config = Secrets()
else:
config = Debug
# Support for relative sqlite URIs
if config.SQLALCHEMY_DATABASE_URI == "sqlite:///site.db":
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |